mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-28 08:03:44 +01:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			docs/plot-
			...
			feature/v6
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 21b3fc294e | ||
|   | 73d57937bb | 
| @@ -56,7 +56,6 @@ 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; | ||||||
| @@ -167,7 +166,7 @@ public class BlockEventListener implements Listener { | |||||||
|         } |         } | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot == null) { |         if (plot == null) { | ||||||
|             if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, RedstoneFlag.class, false)) { |             if (area.isRoadFlagsAndFlagEquals(RedstoneFlag.class, false)) { | ||||||
|                 event.setNewCurrent(0); |                 event.setNewCurrent(0); | ||||||
|             } |             } | ||||||
|             return; |             return; | ||||||
| @@ -1085,7 +1084,7 @@ public class BlockEventListener implements Listener { | |||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|             if (plot == null) { |             if (plot == null) { | ||||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !Permissions.hasPermission( |                 if (!area.isRoadFlagsAndFlagEquals(BlockIgnitionFlag.class, true) && !Permissions.hasPermission( | ||||||
|                         pp, |                         pp, | ||||||
|                         Permission.PERMISSION_ADMIN_BUILD_ROAD |                         Permission.PERMISSION_ADMIN_BUILD_ROAD | ||||||
|                 )) { |                 )) { | ||||||
| @@ -1096,7 +1095,7 @@ public class BlockEventListener implements Listener { | |||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
|             } else if (!plot.hasOwner()) { |             } else if (!plot.hasOwner()) { | ||||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !Permissions.hasPermission( |                 if (!area.isRoadFlagsAndFlagEquals(BlockIgnitionFlag.class, true) && !Permissions.hasPermission( | ||||||
|                         pp, |                         pp, | ||||||
|                         Permission.PERMISSION_ADMIN_BUILD_UNOWNED |                         Permission.PERMISSION_ADMIN_BUILD_UNOWNED | ||||||
|                 )) { |                 )) { | ||||||
|   | |||||||
| @@ -26,7 +26,6 @@ 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; | ||||||
| @@ -92,7 +91,7 @@ public class BlockEventListener117 implements Listener { | |||||||
|         } |         } | ||||||
|  |  | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot == null && !PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) || plot != null && !plot.getFlag( |         if (plot == null && !area.isRoadFlagsAndFlagEquals(MiscInteractFlag.class, true) || plot != null && !plot.getFlag( | ||||||
|                 MiscInteractFlag.class)) { |                 MiscInteractFlag.class)) { | ||||||
|             if (plotPlayer != null) { |             if (plotPlayer != null) { | ||||||
|                 if (plot != null) { |                 if (plot != null) { | ||||||
| @@ -106,12 +105,6 @@ 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,7 +38,6 @@ 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; | ||||||
| @@ -262,7 +261,7 @@ public class EntityEventListener implements Listener { | |||||||
|         } |         } | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot == null) { |         if (plot == null) { | ||||||
|             if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, InvincibleFlag.class, true)) { |             if (area.isRoadFlagsAndFlagEquals(InvincibleFlag.class, true)) { | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
|             return; |             return; | ||||||
|   | |||||||
| @@ -44,7 +44,6 @@ 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; | ||||||
| @@ -335,7 +334,7 @@ public class PaperListener implements Listener { | |||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|  |  | ||||||
|         if (plot == null) { |         if (plot == null) { | ||||||
|             if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission( |             if (!area.isRoadFlagsAndFlagEquals(ProjectilesFlag.class, true) && !Permissions.hasPermission( | ||||||
|                     pp, |                     pp, | ||||||
|                     Permission.PERMISSION_ADMIN_PROJECTILE_ROAD |                     Permission.PERMISSION_ADMIN_PROJECTILE_ROAD | ||||||
|             )) { |             )) { | ||||||
|   | |||||||
| @@ -48,10 +48,6 @@ 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,7 +68,6 @@ 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; | ||||||
| @@ -890,7 +889,7 @@ public class PlayerEventListener implements Listener { | |||||||
|                 } |                 } | ||||||
|             } else { |             } else { | ||||||
|                 PlotArea area = pp.getPlotAreaAbs(); |                 PlotArea area = pp.getPlotAreaAbs(); | ||||||
|                 if (area != null && PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, PreventCreativeCopyFlag.class, true)) { |                 if (area != null && area.isRoadFlagsAndFlagEquals(PreventCreativeCopyFlag.class, true)) { | ||||||
|                     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,7 +997,7 @@ 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 (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) && !Permissions.hasPermission( |             if (!area.isRoadFlagsAndFlagEquals(MiscInteractFlag.class, true) && !Permissions.hasPermission( | ||||||
|                     pp, |                     pp, | ||||||
|                     Permission.PERMISSION_ADMIN_INTERACT_ROAD |                     Permission.PERMISSION_ADMIN_INTERACT_ROAD | ||||||
|             )) { |             )) { | ||||||
| @@ -1594,7 +1593,7 @@ 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 (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, VehicleBreakFlag.class, true) && !Permissions.hasPermission( |                 if (!area.isRoadFlagsAndFlagEquals(VehicleBreakFlag.class, true) && !Permissions.hasPermission( | ||||||
|                         pp, |                         pp, | ||||||
|                         Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD |                         Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD | ||||||
|                 )) { |                 )) { | ||||||
| @@ -1645,7 +1644,7 @@ public class PlayerEventListener implements Listener { | |||||||
|         } |         } | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot == null) { |         if (plot == null) { | ||||||
|             if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ItemDropFlag.class, false)) { |             if (area.isRoadFlagsAndFlagEquals(ItemDropFlag.class, false)) { | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
|             return; |             return; | ||||||
| @@ -1671,7 +1670,7 @@ public class PlayerEventListener implements Listener { | |||||||
|             } |             } | ||||||
|             Plot plot = location.getOwnedPlot(); |             Plot plot = location.getOwnedPlot(); | ||||||
|             if (plot == null) { |             if (plot == null) { | ||||||
|                 if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DropProtectionFlag.class, true)) { |                 if (area.isRoadFlagsAndFlagEquals(DropProtectionFlag.class, true)) { | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
|                 return; |                 return; | ||||||
| @@ -1693,7 +1692,7 @@ public class PlayerEventListener implements Listener { | |||||||
|         } |         } | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot == null) { |         if (plot == null) { | ||||||
|             if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, KeepInventoryFlag.class, true)) { |             if (area.isRoadFlagsAndFlagEquals(KeepInventoryFlag.class, true)) { | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
|             return; |             return; | ||||||
| @@ -1726,7 +1725,7 @@ public class PlayerEventListener implements Listener { | |||||||
|         } |         } | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot == null) { |         if (plot == null) { | ||||||
|             if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DenyPortalTravelFlag.class, true)) { |             if (area.isRoadFlagsAndFlagEquals(DenyPortalTravelFlag.class, true)) { | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
|             return; |             return; | ||||||
| @@ -1771,7 +1770,7 @@ public class PlayerEventListener implements Listener { | |||||||
|             } |             } | ||||||
|             Plot plot = location.getOwnedPlot(); |             Plot plot = location.getOwnedPlot(); | ||||||
|             if (plot == null) { |             if (plot == null) { | ||||||
|                 if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DenyPortalsFlag.class, true)) { |                 if (area.isRoadFlagsAndFlagEquals(DenyPortalsFlag.class, true)) { | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
| @@ -1800,7 +1799,7 @@ public class PlayerEventListener implements Listener { | |||||||
|         } |         } | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot == null) { |         if (plot == null) { | ||||||
|             if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, LecternReadBookFlag.class, true)) { |             if (area.isRoadFlagsAndFlagEquals(LecternReadBookFlag.class, true)) { | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
|             return; |             return; | ||||||
|   | |||||||
| @@ -31,7 +31,6 @@ 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; | ||||||
| @@ -106,7 +105,7 @@ public class ProjectileEventListener implements Listener { | |||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|  |  | ||||||
|         if (plot == null) { |         if (plot == null) { | ||||||
|             if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission( |             if (!area.isRoadFlagsAndFlagEquals(ProjectilesFlag.class, true) && !Permissions.hasPermission( | ||||||
|                     pp, |                     pp, | ||||||
|                     Permission.PERMISSION_ADMIN_PROJECTILE_ROAD |                     Permission.PERMISSION_ADMIN_PROJECTILE_ROAD | ||||||
|             )) { |             )) { | ||||||
| @@ -159,7 +158,7 @@ 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)) { |                 } else if (area.isRoadFlagsAndFlagEquals(ProjectilesFlag.class, true)) { | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
| @@ -170,7 +169,7 @@ public class ProjectileEventListener implements Listener { | |||||||
|  |  | ||||||
|             PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); |             PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); | ||||||
|             if (plot == null) { |             if (plot == null) { | ||||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission( |                 if (!area.isRoadFlagsAndFlagEquals(ProjectilesFlag.class, true) && !Permissions.hasPermission( | ||||||
|                         pp, |                         pp, | ||||||
|                         Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED |                         Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED | ||||||
|                 )) { |                 )) { | ||||||
|   | |||||||
| @@ -44,7 +44,6 @@ 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 | ||||||
| @@ -66,18 +65,10 @@ 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 { | ||||||
|                 if (useOtherRestoreTagMethod && getWorld() != null) { |  | ||||||
|                     sw.restoreTag(getWorld().getName(), x, y, z); |  | ||||||
|                 } else { |  | ||||||
|                 sw.restoreTag(limitedRegion.getBlockState(x, y, z).getBlock()); |                 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; | ||||||
|   | |||||||
| @@ -282,28 +282,7 @@ 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; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -234,19 +234,8 @@ 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) { |  | ||||||
|                                 throw new NullPointerException(String.format( |  | ||||||
|                                         "\"now\" block null attempting to perform plot analysis. Indexes: x=%d of %d, yIndex=%d" + |  | ||||||
|                                                 " of %d, z=%d of %d", |  | ||||||
|                                         x, |  | ||||||
|                                         width, |  | ||||||
|                                         yIndex, |  | ||||||
|                                         height, |  | ||||||
|                                         z, |  | ||||||
|                                         length |  | ||||||
|                                 )); |  | ||||||
|                             } |  | ||||||
|                                 if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) { |                                 if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) { | ||||||
|                                     changes[i]++; |                                     changes[i]++; | ||||||
|                                 } |                                 } | ||||||
| @@ -281,6 +270,9 @@ public class HybridUtils { | |||||||
|                                     } |                                     } | ||||||
|                                     types.add(now.getBlockType()); |                                     types.add(now.getBlockType()); | ||||||
|                                 } |                                 } | ||||||
|  |                             } catch (NullPointerException e) { | ||||||
|  |                                 e.printStackTrace(); | ||||||
|  |                             } | ||||||
|                         } |                         } | ||||||
|                         variety[i] = types.size(); |                         variety[i] = types.size(); | ||||||
|                         i++; |                         i++; | ||||||
|   | |||||||
| @@ -162,7 +162,6 @@ 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"), | ||||||
|   | |||||||
| @@ -46,6 +46,7 @@ import com.plotsquared.core.plot.flag.FlagParseException; | |||||||
| 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.DoneFlag; | import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||||
|  | import com.plotsquared.core.plot.flag.types.BooleanFlag; | ||||||
| import com.plotsquared.core.queue.GlobalBlockQueue; | import com.plotsquared.core.queue.GlobalBlockQueue; | ||||||
| import com.plotsquared.core.queue.QueueCoordinator; | import com.plotsquared.core.queue.QueueCoordinator; | ||||||
| import com.plotsquared.core.util.MathMan; | import com.plotsquared.core.util.MathMan; | ||||||
| @@ -1242,6 +1243,19 @@ public abstract class PlotArea { | |||||||
|         return this.roadFlagContainer.getFlag(flagClass).getValue(); |         return this.roadFlagContainer.getFlag(flagClass).getValue(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * Check if the value of a {@link BooleanFlag} matches the given boolean. If | ||||||
|  |      * road flags are disabled, returns false. | ||||||
|  |      * | ||||||
|  |      * @param flagClass boolean flag to get value of | ||||||
|  |      * @param value     boolean value to check flag value against | ||||||
|  |      * @return Flag value or false if road flags disabled | ||||||
|  |      * @since TODO | ||||||
|  |      */ | ||||||
|  |     public boolean isRoadFlagsAndFlagEquals(final Class<? extends BooleanFlag<?>> flagClass, boolean value) { | ||||||
|  |         return this.roadFlags && (getRoadFlag(flagClass) == value); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Get the value associated with the specified road flag. This will look at |      * Get the value associated with the specified road flag. This will look at | ||||||
|      * the default values stored in {@link GlobalFlagContainer}. |      * the default values stored in {@link GlobalFlagContainer}. | ||||||
|   | |||||||
| @@ -34,9 +34,7 @@ import java.util.UUID; | |||||||
|  * Generic settings class. |  * Generic settings class. | ||||||
|  * - Does not keep a reference to a parent class |  * - Does not keep a reference to a parent class | ||||||
|  * - Direct changes here will not occur in the db (Use the parent plot object for that) |  * - Direct changes here will not occur in the db (Use the parent plot object for that) | ||||||
|  * This class is not part of the API and may change at any time. It is recommended to use equivalent methods in the Plot class. |  | ||||||
|  */ |  */ | ||||||
| @Deprecated |  | ||||||
| public class PlotSettings { | public class PlotSettings { | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|   | |||||||
| @@ -1,53 +0,0 @@ | |||||||
| /* |  | ||||||
|  * 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); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
| } |  | ||||||
| @@ -19,7 +19,7 @@ plugins { | |||||||
| } | } | ||||||
|  |  | ||||||
| group = "com.plotsquared" | group = "com.plotsquared" | ||||||
| version = "6.10.6-SNAPSHOT" | version = "6.10.4-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.20")) |         implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.18")) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     dependencies { |     dependencies { | ||||||
|   | |||||||
							
								
								
									
										
											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,6 +1,5 @@ | |||||||
| distributionBase=GRADLE_USER_HOME | distributionBase=GRADLE_USER_HOME | ||||||
| distributionPath=wrapper/dists | distributionPath=wrapper/dists | ||||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-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/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | #       https://github.com/gradle/gradle/blob/master/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,11 +80,11 @@ do | |||||||
|     esac |     esac | ||||||
| done | done | ||||||
|  |  | ||||||
| # This is normally unused |  | ||||||
| # shellcheck disable=SC2034 |  | ||||||
| APP_BASE_NAME=${0##*/} |  | ||||||
| APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit | ||||||
|  |  | ||||||
|  | APP_NAME="Gradle" | ||||||
|  | APP_BASE_NAME=${0##*/} | ||||||
|  |  | ||||||
| # 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,16 +143,12 @@ 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,7 +26,6 @@ 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