mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 03:03:43 +01:00 
			
		
		
		
	Compare commits
	
		
			30 Commits
		
	
	
		
			6.10.2
			...
			drop-http4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					fd1c182251 | ||
| 
						 | 
					becd8c4eaf | ||
| 
						 | 
					339ca8e30f | ||
| 
						 | 
					742d78a505 | ||
| 
						 | 
					120bf37196 | ||
| 
						 | 
					2a40a6b35e | ||
| 
						 | 
					ea1f35b45a | ||
| 
						 | 
					15e63378a7 | ||
| 
						 | 
					f3bc504a6f | ||
| 
						 | 
					3a8fae47a0 | ||
| 
						 | 
					70cb1cd100 | ||
| 
						 | 
					2067cc1670 | ||
| 
						 | 
					e6338976dd | ||
| 
						 | 
					90ebd5d5ed | ||
| 
						 | 
					c973ee8649 | ||
| 
						 | 
					c1543f034c | ||
| 
						 | 
					6baf339ecb | ||
| 
						 | 
					11906ef1c9 | ||
| 
						 | 
					ee8902154a | ||
| 
						 | 
					b5bc1988e5 | ||
| 
						 | 
					2147012beb | ||
| 
						 | 
					52bb561689 | ||
| 
						 | 
					25ce7a83f1 | ||
| 
						 | 
					55c8a590e7 | ||
| 
						 | 
					28bd993680 | ||
| 
						 | 
					8330f37d8a | ||
| 
						 | 
					985fae65b6 | ||
| 
						 | 
					db2d590e8e | ||
| 
						 | 
					c8d356783a | ||
| 
						 | 
					4947450ff0 | 
							
								
								
									
										1
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
								
							@@ -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'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,7 +48,6 @@ dependencies {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // Our libraries
 | 
					    // Our libraries
 | 
				
			||||||
    implementation(libs.arkitektonika)
 | 
					    implementation(libs.arkitektonika)
 | 
				
			||||||
    implementation(libs.http4j)
 | 
					 | 
				
			||||||
    implementation("com.intellectualsites.paster:Paster")
 | 
					    implementation("com.intellectualsites.paster:Paster")
 | 
				
			||||||
    implementation("com.intellectualsites.informative-annotations:informative-annotations")
 | 
					    implementation("com.intellectualsites.informative-annotations:informative-annotations")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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)) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -93,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
 | 
				
			||||||
    ) {
 | 
					    ) {
 | 
				
			||||||
@@ -298,7 +298,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
 | 
				
			|||||||
        int roadSchemHeight;
 | 
					        int roadSchemHeight;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (schematic1 != null) {
 | 
					        if (schematic1 != null) {
 | 
				
			||||||
            roadSchemHeight = schematic1.getClipboard().getDimensions().getY();
 | 
					            roadSchemHeight = Math.max(
 | 
				
			||||||
 | 
					                    schematic1.getClipboard().getDimensions().getY(),
 | 
				
			||||||
 | 
					                    schematic2.getClipboard().getDimensions().getY()
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
            maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
 | 
					            maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
 | 
				
			||||||
            if (maxSchematicHeight == worldGenHeight) {
 | 
					            if (maxSchematicHeight == worldGenHeight) {
 | 
				
			||||||
                SCHEM_Y = getMinGenHeight();
 | 
					                SCHEM_Y = getMinGenHeight();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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"),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										34
									
								
								HEADER.txt
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								HEADER.txt
									
									
									
									
									
								
							@@ -1,16 +1,18 @@
 | 
				
			|||||||
PlotSquared, a land and world management plugin for Minecraft.
 | 
					/*
 | 
				
			||||||
Copyright (C) IntellectualSites <https://intellectualsites.com>
 | 
					 * PlotSquared, a land and world management plugin for Minecraft.
 | 
				
			||||||
Copyright (C) IntellectualSites team and contributors
 | 
					 * 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
 | 
					 * This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
the Free Software Foundation, either version 3 of the License, or
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
(at your option) any later version.
 | 
					 * 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
 | 
					 * This program is distributed in the hope that it will be useful,
 | 
				
			||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
					 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
GNU General Public License for more details.
 | 
					 * 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/>.
 | 
					 * You should have received a copy of the GNU General Public License
 | 
				
			||||||
 | 
					 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,6 @@
 | 
				
			|||||||
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
 | 
					import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
 | 
				
			||||||
import org.cadixdev.gradle.licenser.LicenseExtension
 | 
					 | 
				
			||||||
import org.cadixdev.gradle.licenser.Licenser
 | 
					 | 
				
			||||||
import java.net.URI
 | 
					import java.net.URI
 | 
				
			||||||
 | 
					import com.diffplug.gradle.spotless.SpotlessPlugin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
plugins {
 | 
					plugins {
 | 
				
			||||||
    java
 | 
					    java
 | 
				
			||||||
@@ -10,7 +9,7 @@ plugins {
 | 
				
			|||||||
    signing
 | 
					    signing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    alias(libs.plugins.shadow)
 | 
					    alias(libs.plugins.shadow)
 | 
				
			||||||
    alias(libs.plugins.licenser)
 | 
					    alias(libs.plugins.spotless)
 | 
				
			||||||
    alias(libs.plugins.grgit)
 | 
					    alias(libs.plugins.grgit)
 | 
				
			||||||
    alias(libs.plugins.nexus)
 | 
					    alias(libs.plugins.nexus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -19,7 +18,7 @@ plugins {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
group = "com.plotsquared"
 | 
					group = "com.plotsquared"
 | 
				
			||||||
version = "6.10.2"
 | 
					version = "6.10.6-SNAPSHOT"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
subprojects {
 | 
					subprojects {
 | 
				
			||||||
    group = rootProject.group
 | 
					    group = rootProject.group
 | 
				
			||||||
@@ -57,7 +56,7 @@ subprojects {
 | 
				
			|||||||
        plugin<JavaLibraryPlugin>()
 | 
					        plugin<JavaLibraryPlugin>()
 | 
				
			||||||
        plugin<MavenPublishPlugin>()
 | 
					        plugin<MavenPublishPlugin>()
 | 
				
			||||||
        plugin<ShadowPlugin>()
 | 
					        plugin<ShadowPlugin>()
 | 
				
			||||||
        plugin<Licenser>()
 | 
					        plugin<SpotlessPlugin>()
 | 
				
			||||||
        plugin<SigningPlugin>()
 | 
					        plugin<SigningPlugin>()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        plugin<EclipsePlugin>()
 | 
					        plugin<EclipsePlugin>()
 | 
				
			||||||
@@ -65,7 +64,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 {
 | 
				
			||||||
@@ -87,10 +86,11 @@ subprojects {
 | 
				
			|||||||
        attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
 | 
					        attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    configure<LicenseExtension> {
 | 
					    spotless {
 | 
				
			||||||
        header(rootProject.file("HEADER.txt"))
 | 
					        java {
 | 
				
			||||||
        include("**/*.java")
 | 
					            licenseHeaderFile(rootProject.file("HEADER.txt"))
 | 
				
			||||||
        newLine.set(false)
 | 
					            target("**/*.java")
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    java {
 | 
					    java {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@ guice = "5.1.0"
 | 
				
			|||||||
spotbugs = "4.7.3"
 | 
					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"
 | 
				
			||||||
@@ -13,15 +13,14 @@ 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"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Gradle plugins
 | 
					# Gradle plugins
 | 
				
			||||||
shadow = "7.1.2"
 | 
					shadow = "7.1.2"
 | 
				
			||||||
grgit = "4.1.1"
 | 
					grgit = "4.1.1"
 | 
				
			||||||
licenser = "0.6.1"
 | 
					spotless = "6.12.1"
 | 
				
			||||||
nexus = "1.1.0"
 | 
					nexus = "1.1.0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[libraries]
 | 
					[libraries]
 | 
				
			||||||
@@ -44,10 +43,9 @@ cloudServices = { group = "cloud.commandframework", name = "cloud-services", ver
 | 
				
			|||||||
mvdwapi = { group = "com.intellectualsites.mvdwplaceholderapi", name = "MVdWPlaceholderAPI", version.ref = "mvdwapi" }
 | 
					mvdwapi = { group = "com.intellectualsites.mvdwplaceholderapi", name = "MVdWPlaceholderAPI", version.ref = "mvdwapi" }
 | 
				
			||||||
squirrelid = { group = "org.enginehub", name = "squirrelid", version.ref = "squirrelid" }
 | 
					squirrelid = { group = "org.enginehub", name = "squirrelid", version.ref = "squirrelid" }
 | 
				
			||||||
arkitektonika = { group = "com.intellectualsites.arkitektonika", name = "Arkitektonika-Client", version.ref = "arkitektonika" }
 | 
					arkitektonika = { group = "com.intellectualsites.arkitektonika", name = "Arkitektonika-Client", version.ref = "arkitektonika" }
 | 
				
			||||||
http4j = { group = "com.intellectualsites.http", name = "HTTP4J", version.ref = "http4j" }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
[plugins]
 | 
					[plugins]
 | 
				
			||||||
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
 | 
					shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
 | 
				
			||||||
grgit = { id = "org.ajoberstar.grgit", version.ref = "grgit" }
 | 
					grgit = { id = "org.ajoberstar.grgit", version.ref = "grgit" }
 | 
				
			||||||
licenser = { id = "org.cadixdev.licenser", version.ref = "licenser" }
 | 
					spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
 | 
				
			||||||
nexus = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus" }
 | 
					nexus = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus" }
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								gradle/wrapper/gradle-wrapper.jar
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								gradle/wrapper/gradle-wrapper.jar
									
									
									
									
										vendored
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										3
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							@@ -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
									
									
								
							
							
						
						
									
										12
									
								
								gradlew
									
									
									
									
										vendored
									
									
								
							@@ -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
									
									
								
							
							
						
						
									
										1
									
								
								gradlew.bat
									
									
									
									
										vendored
									
									
								
							@@ -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%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user