mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-31 01:23:44 +01:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			6.9.4
			...
			fix/missin
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 4a703a305b | ||
|   | f9f1a21cab | ||
|   | dce4922d34 | 
							
								
								
									
										3
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
								
							| @@ -27,11 +27,10 @@ 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. | ||||
|       multiple: false | ||||
|       options: | ||||
|         - '1.19.2' | ||||
|         - '1.19.1' | ||||
|         - '1.19' | ||||
|         - '1.18.2' | ||||
|         - '1.18.1' | ||||
|         - '1.18' | ||||
|         - '1.17.1' | ||||
|         - '1.16.5' | ||||
|     validations: | ||||
|   | ||||
| @@ -656,15 +656,20 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | ||||
|             final @NonNull SQLiteUUIDService sqLiteUUIDService, | ||||
|             final @NonNull CacheUUIDService cacheUUIDService | ||||
|     ) { | ||||
|         // Record all unique UUID's and put them into a queue | ||||
|         final Set<UUID> uuidSet = new HashSet<>(); | ||||
|         // Load all uuids into a big chunky boi queue | ||||
|         final Queue<UUID> uuidQueue = new LinkedBlockingQueue<>(); | ||||
|         PlotSquared.get().forEachPlotRaw(plot -> { | ||||
|             uuidSet.add(plot.getOwnerAbs()); | ||||
|             uuidSet.addAll(plot.getMembers()); | ||||
|             uuidSet.addAll(plot.getTrusted()); | ||||
|             uuidSet.addAll(plot.getDenied()); | ||||
|             final Set<UUID> uuids = new HashSet<>(); | ||||
|             uuids.add(plot.getOwnerAbs()); | ||||
|             uuids.addAll(plot.getMembers()); | ||||
|             uuids.addAll(plot.getTrusted()); | ||||
|             uuids.addAll(plot.getDenied()); | ||||
|             for (final UUID uuid : uuids) { | ||||
|                 if (!uuidQueue.contains(uuid)) { | ||||
|                     uuidQueue.add(uuid); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|         final Queue<UUID> uuidQueue = new LinkedBlockingQueue<>(uuidSet); | ||||
|  | ||||
|         LOGGER.info("(UUID) {} UUIDs will be cached", uuidQueue.size()); | ||||
|  | ||||
|   | ||||
| @@ -121,23 +121,6 @@ public class BlockEventListener implements Listener { | ||||
|             Material.TURTLE_EGG, | ||||
|             Material.TURTLE_SPAWN_EGG | ||||
|     ); | ||||
|     private static final Set<Material> SNOW;  // needed as Tag.SNOW isn't present in 1.16.5 | ||||
|  | ||||
|     static { | ||||
|         if (PlotSquared.platform().serverVersion()[1] < 17) { | ||||
|             SNOW = Set.of( | ||||
|                     Material.SNOW, | ||||
|                     Material.SNOW_BLOCK | ||||
|             ); | ||||
|         } else { | ||||
|             SNOW = Set.of( | ||||
|                     Material.SNOW, | ||||
|                     Material.SNOW_BLOCK, | ||||
|                     Material.POWDER_SNOW // only since 1.17 | ||||
|             ); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private final PlotAreaManager plotAreaManager; | ||||
|     private final WorldEdit worldEdit; | ||||
|  | ||||
| @@ -546,7 +529,7 @@ public class BlockEventListener implements Listener { | ||||
|             event.setCancelled(true); | ||||
|             return; | ||||
|         } | ||||
|         if (SNOW.contains(event.getNewState().getType())) { | ||||
|         if (Tag.SNOW.isTagged(event.getNewState().getType())) { | ||||
|             if (!plot.getFlag(SnowFormFlag.class)) { | ||||
|                 plot.debug("Snow could not form because snow-form = false"); | ||||
|                 event.setCancelled(true); | ||||
| @@ -578,7 +561,7 @@ public class BlockEventListener implements Listener { | ||||
|             return; | ||||
|         } | ||||
|         Class<? extends BooleanFlag<?>> flag; | ||||
|         if (SNOW.contains(event.getNewState().getType())) { | ||||
|         if (Tag.SNOW.isTagged(event.getNewState().getType())) { | ||||
|             flag = SnowFormFlag.class; | ||||
|         } else if (Tag.ICE.isTagged(event.getNewState().getType())) { | ||||
|             flag = IceFormFlag.class; | ||||
| @@ -695,7 +678,7 @@ public class BlockEventListener implements Listener { | ||||
|             } | ||||
|             return; | ||||
|         } | ||||
|         if (SNOW.contains(blockType)) { | ||||
|         if (Tag.SNOW.isTagged(blockType)) { | ||||
|             if (!plot.getFlag(SnowMeltFlag.class)) { | ||||
|                 plot.debug("Snow could not melt because snow-melt = false"); | ||||
|                 event.setCancelled(true); | ||||
| @@ -709,7 +692,7 @@ public class BlockEventListener implements Listener { | ||||
|             } | ||||
|             return; | ||||
|         } | ||||
|         if (Tag.CORAL_BLOCKS.isTagged(blockType) || Tag.CORALS.isTagged(blockType) || Tag.WALL_CORALS.isTagged(blockType)) { | ||||
|         if (Tag.CORAL_BLOCKS.isTagged(blockType) || Tag.CORALS.isTagged(blockType)) { | ||||
|             if (!plot.getFlag(CoralDryFlag.class)) { | ||||
|                 plot.debug("Coral could not dry because coral-dry = false"); | ||||
|                 event.setCancelled(true); | ||||
|   | ||||
| @@ -126,16 +126,16 @@ public class EntitySpawnListener implements Listener { | ||||
|         Plot plot = location.getOwnedPlotAbs(); | ||||
|         EntityType type = entity.getType(); | ||||
|         if (plot == null) { | ||||
|             if (!area.isMobSpawning()) { | ||||
|                 if (type == EntityType.PLAYER) { | ||||
|                     return; | ||||
|                 } | ||||
|                 if (type == EntityType.DROPPED_ITEM) { | ||||
|                     if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { | ||||
|                         event.setCancelled(true); | ||||
|                     } | ||||
|                     return; | ||||
|                 } | ||||
|             if (!area.isMobSpawning()) { | ||||
|                 if (type == EntityType.PLAYER) { | ||||
|                     return; | ||||
|                 } | ||||
|                 if (type.isAlive()) { | ||||
|                     event.setCancelled(true); | ||||
|                 } | ||||
|   | ||||
| @@ -229,17 +229,17 @@ public class PaperListener implements Listener { | ||||
|         Plot plot = location.getOwnedPlotAbs(); | ||||
|         if (plot == null) { | ||||
|             EntityType type = event.getType(); | ||||
|             // PreCreatureSpawnEvent **should** not be called for DROPPED_ITEM, just for the sake of consistency | ||||
|             if (type == EntityType.DROPPED_ITEM) { | ||||
|                 if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { | ||||
|                     event.setCancelled(true); | ||||
|                 } | ||||
|                 return; | ||||
|             } | ||||
|             if (!area.isMobSpawning()) { | ||||
|                 if (type == EntityType.PLAYER) { | ||||
|                     return; | ||||
|                 } | ||||
|                 if (type == EntityType.DROPPED_ITEM) { | ||||
|                     if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { | ||||
|                         event.setShouldAbortSpawn(true); | ||||
|                         event.setCancelled(true); | ||||
|                     } | ||||
|                     return; | ||||
|                 } | ||||
|                 if (type.isAlive()) { | ||||
|                     event.setShouldAbortSpawn(true); | ||||
|                     event.setCancelled(true); | ||||
|   | ||||
| @@ -32,6 +32,7 @@ import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| import com.plotsquared.core.util.task.RunnableVal3; | ||||
| import com.plotsquared.core.uuid.UUIDMapping; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
|  | ||||
| import java.util.Collection; | ||||
| @@ -39,7 +40,6 @@ import java.util.Collections; | ||||
| import java.util.LinkedList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.UUID; | ||||
| import java.util.concurrent.CompletableFuture; | ||||
| import java.util.concurrent.TimeoutException; | ||||
| import java.util.stream.Collectors; | ||||
| @@ -88,8 +88,8 @@ public class Grant extends Command { | ||||
|                                 Template.of("value", String.valueOf(uuids)) | ||||
|                         ); | ||||
|                     } else { | ||||
|                         final UUID uuid = uuids.iterator().next(); | ||||
|                         PlotPlayer<?> pp = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); | ||||
|                         final UUIDMapping uuid = uuids.toArray(new UUIDMapping[0])[0]; | ||||
|                         PlotPlayer<?> pp = PlotSquared.platform().playerManager().getPlayerIfExists(uuid.getUuid()); | ||||
|                         if (pp != null) { | ||||
|                             try (final MetaDataAccess<Integer> access = pp.accessPersistentMetaData( | ||||
|                                     PlayerMetaDataKeys.PERSISTENT_GRANTED_PLOTS)) { | ||||
| @@ -103,7 +103,7 @@ public class Grant extends Command { | ||||
|                                 } | ||||
|                             } | ||||
|                         } else { | ||||
|                             DBFunc.getPersistentMeta(uuid, new RunnableVal<>() { | ||||
|                             DBFunc.getPersistentMeta(uuid.getUuid(), new RunnableVal<>() { | ||||
|                                 @Override | ||||
|                                 public void run(Map<String, byte[]> value) { | ||||
|                                     final byte[] array = value.get("grantedPlots"); | ||||
| @@ -128,7 +128,7 @@ public class Grant extends Command { | ||||
|                                         boolean replace = array != null; | ||||
|                                         String key = "grantedPlots"; | ||||
|                                         byte[] rawData = Ints.toByteArray(amount); | ||||
|                                         DBFunc.addPersistentMeta(uuid, key, rawData, replace); | ||||
|                                         DBFunc.addPersistentMeta(uuid.getUuid(), key, rawData, replace); | ||||
|                                         player.sendMessage( | ||||
|                                                 TranslatableCaption.of("grants.added"), | ||||
|                                                 Template.of("grants", String.valueOf(amount)) | ||||
|   | ||||
| @@ -115,8 +115,8 @@ public class Remove extends SubCommand { | ||||
|             } | ||||
|             if (count == 0) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("member.player_not_removed"), | ||||
|                         Template.of("player", args[0]) | ||||
|                         TranslatableCaption.of("errors.invalid_player"), | ||||
|                         Template.of("value", args[0]) | ||||
|                 ); | ||||
|             } else { | ||||
|                 player.sendMessage( | ||||
|   | ||||
| @@ -174,7 +174,7 @@ public final class CaptionLoader { | ||||
|     public @NonNull CaptionMap loadAll(final @NonNull Path directory) throws IOException { | ||||
|         final Map<Locale, CaptionMap> localeMaps = new HashMap<>(); | ||||
|         try (final Stream<Path> files = Files.list(directory)) { | ||||
|             final List<Path> captionFiles = files.filter(Files::isRegularFile).toList(); | ||||
|             final List<Path> captionFiles = files.filter(Files::isRegularFile).collect(Collectors.toList()); | ||||
|             for (Path file : captionFiles) { | ||||
|                 try { | ||||
|                     final CaptionMap localeMap = loadSingle(file); | ||||
| @@ -221,7 +221,7 @@ public final class CaptionLoader { | ||||
|      * @throws IOException              if the file couldn't be accessed or read successfully. | ||||
|      * @throws IllegalArgumentException if the file name doesn't match the specified format. | ||||
|      * @see #loadSingle(Path) | ||||
|      * @since 6.9.3 | ||||
|      * @since TODO | ||||
|      */ | ||||
|     public @NonNull CaptionMap loadOrCreateSingle(final @NonNull Path file) throws IOException { | ||||
|         final Locale locale = this.localeExtractor.apply(file); | ||||
|   | ||||
| @@ -30,18 +30,9 @@ import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  * The Permissions class handles checking user permissions.<br> | ||||
|  * - This will respect * nodes and plots.admin and can be used to check permission ranges (e.g. plots.plot.5)<br> | ||||
|  * - Checking the PlotPlayer class directly will not take the above into account<br> | ||||
|  * | ||||
|  * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|  * classes | ||||
|  */ | ||||
| @Deprecated(forRemoval = true, since = "6.9.3") | ||||
| public class Permissions { | ||||
|  | ||||
|     /** | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasPermission(PlotPlayer<?> player, Permission permission, boolean notify) { | ||||
|         return hasPermission(player, permission.toString(), notify); | ||||
|     } | ||||
| @@ -52,25 +43,18 @@ public class Permissions { | ||||
|      * @param caller     permission holder | ||||
|      * @param permission Permission | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasPermission(final @NonNull PermissionHolder caller, final @NonNull Permission permission) { | ||||
|         return caller.hasPermission(permission.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Check if the owner of the profile has a given (global) permission. There is no guarantee that per-world permissions will | ||||
|      * be checked because unmaintained crap plugins like PEX exist. | ||||
|      * Check if the owner of the profile has a given (global) permission | ||||
|      * | ||||
|      * @param caller     permission holder | ||||
|      * @param permission Permission | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasPermission(final @NonNull PermissionHolder caller, final @NonNull String permission) { | ||||
|         return caller.hasPermission(permission); | ||||
|     } | ||||
| @@ -84,10 +68,7 @@ public class Permissions { | ||||
|      * @param key        Permission "key" | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      * @since 6.0.10 | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasKeyedPermission( | ||||
|             final @NonNull PermissionHolder caller, final @NonNull String permission, | ||||
|             final @NonNull String key | ||||
| @@ -102,10 +83,7 @@ public class Permissions { | ||||
|      * @param permission permission | ||||
|      * @param notify     if to notify the permission holder | ||||
|      * @return if permission is had | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasPermission(PlotPlayer<?> player, String permission, boolean notify) { | ||||
|         if (!hasPermission(player, permission)) { | ||||
|             if (notify) { | ||||
| @@ -119,11 +97,6 @@ public class Permissions { | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static int hasPermissionRange(PlotPlayer<?> player, Permission Permission, int range) { | ||||
|         return hasPermissionRange(player, Permission.toString(), range); | ||||
|     } | ||||
| @@ -137,10 +110,7 @@ public class Permissions { | ||||
|      * @param stub   The permission stub to check e.g. for `plots.plot.#` the stub is `plots.plot` | ||||
|      * @param range  The range to check | ||||
|      * @return The highest permission they have within that range | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static int hasPermissionRange(PlotPlayer<?> player, String stub, int range) { | ||||
|         return player.hasPermissionRange(stub, range); | ||||
|     } | ||||
|   | ||||
| @@ -164,7 +164,7 @@ public final class PlaceholderRegistry { | ||||
|                     PlayerManager.getPlayerList(plot.getDenied(), player)); | ||||
|         }); | ||||
|         this.createPlaceholder("currentplot_creationdate", (player, plot) -> { | ||||
|             if (plot.getTimestamp() == 0 || !plot.hasOwner()) { | ||||
|             if (plot.getTimestamp() == 0) { | ||||
|                 return legacyComponent(TranslatableCaption.of("info.unknown"), player); | ||||
|             } | ||||
|             long creationDate = plot.getTimestamp(); | ||||
|   | ||||
| @@ -414,7 +414,6 @@ | ||||
|   "kick.you_got_kicked": "<prefix><dark_aqua>You got kicked from the plot!</dark_aqua>", | ||||
|   "trusted.trusted_added": "<prefix><dark_aqua>You successfully trusted a user to the plot.</dark_aqua>", | ||||
|   "trusted.plot_removed_user": "<prefix><red>Plot <plot> of which you were added to has been deleted due to owner inactivity.</red>", | ||||
|   "member.player_not_removed": "<prefix><gray><player></gray><red> is neither added, trusted or denied on the plot, thus doesn't need to be removed.</red>", | ||||
|   "member.removed_players": "<prefix><gray>Removed <amount> player(s) from this plot.</gray>", | ||||
|   "member.plot_left": "<prefix><gray><player> left the plot.</gray>", | ||||
|   "member.plot_cant_leave_owner": "<prefix><red>You are the plot owner. You cannot leave this plot.</red>", | ||||
|   | ||||
| @@ -19,7 +19,7 @@ plugins { | ||||
| } | ||||
|  | ||||
| group = "com.plotsquared" | ||||
| version = "6.9.4" | ||||
| version = "6.9.3-SNAPSHOT" | ||||
|  | ||||
| subprojects { | ||||
|     group = rootProject.group | ||||
| @@ -65,12 +65,12 @@ subprojects { | ||||
|     } | ||||
|  | ||||
|     dependencies { | ||||
|         implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.12")) | ||||
|         implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.11")) | ||||
|     } | ||||
|  | ||||
|     dependencies { | ||||
|         // Tests | ||||
|         testImplementation("org.junit.jupiter:junit-jupiter:5.9.0") | ||||
|         testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") | ||||
|     } | ||||
|  | ||||
|     plugins.withId("java") { | ||||
|   | ||||
| @@ -5,7 +5,7 @@ guice = "5.1.0" | ||||
| spotbugs = "4.7.1" | ||||
|  | ||||
| # Plugins | ||||
| worldedit = "7.2.12" | ||||
| worldedit = "7.2.10" | ||||
| placeholderapi = "2.11.2" | ||||
| luckperms = "5.4" | ||||
| essentialsx = "2.19.4" | ||||
|   | ||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @@ -1,5 +1,5 @@ | ||||
| distributionBase=GRADLE_USER_HOME | ||||
| distributionPath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip | ||||
| zipStoreBase=GRADLE_USER_HOME | ||||
| zipStorePath=wrapper/dists | ||||
|   | ||||
| @@ -1,7 +1,9 @@ | ||||
| { | ||||
|   "extends": [ | ||||
|     "config:base" | ||||
|     "config:base", | ||||
|     ":disableDependencyDashboard" | ||||
|   ], | ||||
|   "labels": ["Renovate"], | ||||
|   "commitMessagePrefix": "build: ", | ||||
|   "rebaseWhen": "conflicted" | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user