mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-25 15:43:44 +02:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			fix-unload
			...
			docs/ploti
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | b858250ffd | ||
|   | 2b0c1465c5 | ||
|   | d46d8b158c | ||
|   | a6fb7b2358 | 
							
								
								
									
										2
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/ISSUE_TEMPLATE/bug_report.yml
									
									
									
									
										vendored
									
									
								
							| @@ -27,7 +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. | ||||
|       multiple: false | ||||
|       options: | ||||
|         - '1.20.2' | ||||
|         - '1.20.1' | ||||
|         - '1.20' | ||||
|         - '1.19.4' | ||||
|         - '1.19.3' | ||||
|   | ||||
							
								
								
									
										2
									
								
								.github/workflows/build-pr.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build-pr.yml
									
									
									
									
										vendored
									
									
								
							| @@ -9,7 +9,7 @@ jobs: | ||||
|         os: [ ubuntu-latest, windows-latest, macos-latest ] | ||||
|     steps: | ||||
|       - name: Checkout Repository | ||||
|         uses: actions/checkout@v4 | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Validate Gradle Wrapper | ||||
|         uses: gradle/wrapper-validation-action@v1 | ||||
|       - name: Setup Java | ||||
|   | ||||
							
								
								
									
										2
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -9,7 +9,7 @@ jobs: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Checkout Repository | ||||
|         uses: actions/checkout@v4 | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Validate Gradle Wrapper | ||||
|         uses: gradle/wrapper-validation-action@v1 | ||||
|       - name: Setup Java | ||||
|   | ||||
							
								
								
									
										2
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							| @@ -20,7 +20,7 @@ jobs: | ||||
|         language: [ 'java' ] | ||||
|     steps: | ||||
|       - name: Checkout repository | ||||
|         uses: actions/checkout@v4 | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Setup Java | ||||
|         uses: actions/setup-java@v3 | ||||
|         with: | ||||
|   | ||||
							
								
								
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -138,5 +138,6 @@ build/ | ||||
|  | ||||
| .DS_Store | ||||
| # Ignore run folders | ||||
| run-[0-9].[0-9][0-9]/ | ||||
| run-[0-9].[0-9][0-9].[0-9]/ | ||||
| run-[0-0].[0-9]/ | ||||
| run-[0-0].[0-9].[0-9]/ | ||||
|  | ||||
|   | ||||
| @@ -100,7 +100,7 @@ tasks { | ||||
|     withType<Javadoc> { | ||||
|         val isRelease = if (rootProject.version.toString().endsWith("-SNAPSHOT")) "TODO" else rootProject.version.toString() | ||||
|         val opt = options as StandardJavadocDocletOptions | ||||
|         opt.links("https://jd.papermc.io/paper/1.20/") | ||||
|         opt.links("https://jd.papermc.io/paper/1.19/") | ||||
|         opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString()) | ||||
|         opt.links("https://intellectualsites.github.io/plotsquared-javadocs/core/") | ||||
|         opt.links("https://jd.advntr.dev/api/4.14.0/") | ||||
|   | ||||
| @@ -252,7 +252,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @SuppressWarnings("deprecation") // Paper deprecation | ||||
|     public void onEnable() { | ||||
|         this.pluginName = getDescription().getName(); | ||||
|  | ||||
| @@ -1161,7 +1160,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | ||||
|         return new BukkitPlotGenerator(world, generator, this.plotAreaManager); | ||||
|     } | ||||
|  | ||||
|     @SuppressWarnings("deprecation") // Paper deprecation | ||||
|     @Override | ||||
|     public @NonNull String pluginsFormatted() { | ||||
|         StringBuilder msg = new StringBuilder(); | ||||
| @@ -1183,7 +1181,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @SuppressWarnings({"ConstantConditions", "deprecation"}) // Paper deprecation | ||||
|     @SuppressWarnings("ConstantConditions") | ||||
|     public @NonNull String worldEditImplementations() { | ||||
|         StringBuilder msg = new StringBuilder(); | ||||
|         if (Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null) { | ||||
|   | ||||
| @@ -74,7 +74,6 @@ public final class ReplicatingEntityWrapper extends EntityWrapper { | ||||
|     private HorseStats horse; | ||||
|     private boolean noGravity; | ||||
|  | ||||
|     @SuppressWarnings("deprecation") // Deprecation exists since 1.20, while we support 1.16 onwards | ||||
|     public ReplicatingEntityWrapper(Entity entity, short depth) { | ||||
|         super(entity); | ||||
|  | ||||
|   | ||||
| @@ -369,7 +369,6 @@ public class PlayerEventListener implements Listener { | ||||
|     } | ||||
|  | ||||
|     @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) | ||||
|     @SuppressWarnings("deprecation") // Paper deprecation | ||||
|     public void onConnect(PlayerJoinEvent event) { | ||||
|         final Player player = event.getPlayer(); | ||||
|         PlotSquared.platform().playerManager().removePlayer(player.getUniqueId()); | ||||
| @@ -734,7 +733,6 @@ public class PlayerEventListener implements Listener { | ||||
|     } | ||||
|  | ||||
|     @EventHandler(priority = EventPriority.LOW) | ||||
|     @SuppressWarnings("deprecation") // Paper deprecation | ||||
|     public void onChat(AsyncPlayerChatEvent event) { | ||||
|         if (event.isCancelled()) { | ||||
|             return; | ||||
| @@ -1065,7 +1063,6 @@ public class PlayerEventListener implements Listener { | ||||
|     } | ||||
|  | ||||
|     @EventHandler(priority = EventPriority.LOW) | ||||
|     @SuppressWarnings("deprecation") // Paper deprecation | ||||
|     public void onCancelledInteract(PlayerInteractEvent event) { | ||||
|         if (event.isCancelled() && event.getAction() == Action.RIGHT_CLICK_AIR) { | ||||
|             Player player = event.getPlayer(); | ||||
|   | ||||
| @@ -44,7 +44,6 @@ import java.util.stream.IntStream; | ||||
| @Singleton | ||||
| public class BukkitInventoryUtil extends InventoryUtil { | ||||
|  | ||||
|     @SuppressWarnings("deprecation") // Paper deprecation | ||||
|     private static @Nullable ItemStack getItem(PlotItemStack item) { | ||||
|         if (item == null) { | ||||
|             return null; | ||||
|   | ||||
| @@ -67,7 +67,6 @@ public class BukkitSetupUtils extends SetupUtils { | ||||
|         this.worldFile = worldFile; | ||||
|     } | ||||
|  | ||||
|     @SuppressWarnings("deprecation") // Paper deprecation | ||||
|     @Override | ||||
|     public void updateGenerators(final boolean force) { | ||||
|         if (loaded && !SetupUtils.generators.isEmpty() && !force) { | ||||
|   | ||||
| @@ -35,7 +35,7 @@ import org.bukkit.scheduler.BukkitTask; | ||||
| import javax.net.ssl.HttpsURLConnection; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStreamReader; | ||||
| import java.net.URI; | ||||
| import java.net.URL; | ||||
|  | ||||
| public class UpdateUtility implements Listener { | ||||
|  | ||||
| @@ -59,9 +59,8 @@ public class UpdateUtility implements Listener { | ||||
|     public void updateChecker() { | ||||
|         task = Bukkit.getScheduler().runTaskTimerAsynchronously(this.javaPlugin, () -> { | ||||
|             try { | ||||
|                 HttpsURLConnection connection = (HttpsURLConnection) URI.create( | ||||
|                         "https://api.spigotmc.org/simple/0.2/index.php?action=getResource&id=77506") | ||||
|                         .toURL() | ||||
|                 HttpsURLConnection connection = (HttpsURLConnection) new URL( | ||||
|                         "https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506") | ||||
|                         .openConnection(); | ||||
|                 connection.setRequestMethod("GET"); | ||||
|                 JsonObject result = new JsonParser() | ||||
|   | ||||
| @@ -57,8 +57,8 @@ tasks.processResources { | ||||
|  | ||||
|     doLast { | ||||
|         copy { | ||||
|             from(layout.buildDirectory.file("$rootDir/LICENSE")) | ||||
|             into(layout.buildDirectory.dir("resources/main")) | ||||
|             from(File("$rootDir/LICENSE")) | ||||
|             into("$buildDir/resources/main/") | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -84,7 +84,7 @@ import java.io.InputStream; | ||||
| import java.io.InputStreamReader; | ||||
| import java.io.ObjectInputStream; | ||||
| import java.io.ObjectOutputStream; | ||||
| import java.net.URI; | ||||
| import java.net.MalformedURLException; | ||||
| import java.net.URISyntaxException; | ||||
| import java.net.URL; | ||||
| import java.nio.file.Files; | ||||
| @@ -210,10 +210,9 @@ public class PlotSquared { | ||||
|             try { | ||||
|                 URL logurl = PlotSquared.class.getProtectionDomain().getCodeSource().getLocation(); | ||||
|                 this.jarFile = new File( | ||||
|                         URI.create( | ||||
|                                 logurl.toURI().toString().split("\\!")[0].replaceAll("jar:file", "file")) | ||||
|                                 .getPath()); | ||||
|             } catch (URISyntaxException | SecurityException e) { | ||||
|                         new URL(logurl.toURI().toString().split("\\!")[0].replaceAll("jar:file", "file")) | ||||
|                                 .toURI().getPath()); | ||||
|             } catch (MalformedURLException | URISyntaxException | SecurityException e) { | ||||
|                 e.printStackTrace(); | ||||
|                 this.jarFile = new File(this.platform.getDirectory().getParentFile(), "PlotSquared.jar"); | ||||
|                 if (!this.jarFile.exists()) { | ||||
|   | ||||
| @@ -41,7 +41,6 @@ import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  | ||||
| import java.net.MalformedURLException; | ||||
| import java.net.URI; | ||||
| import java.net.URL; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| @@ -117,7 +116,7 @@ public class Load extends SubCommand { | ||||
|                     } | ||||
|                     final URL url; | ||||
|                     try { | ||||
|                         url = URI.create(Settings.Web.URL + "saves/" + player.getUUID() + '/' + schematic).toURL(); | ||||
|                         url = new URL(Settings.Web.URL + "saves/" + player.getUUID() + '/' + schematic); | ||||
|                     } catch (MalformedURLException e) { | ||||
|                         e.printStackTrace(); | ||||
|                         player.sendMessage(TranslatableCaption.of("web.load_failed")); | ||||
|   | ||||
| @@ -40,7 +40,6 @@ import net.kyori.adventure.text.minimessage.tag.Tag; | ||||
| import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  | ||||
| import java.net.URI; | ||||
| import java.net.URL; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collection; | ||||
| @@ -131,7 +130,8 @@ public class SchematicCmd extends SubCommand { | ||||
|                     if (location.startsWith("url:")) { | ||||
|                         try { | ||||
|                             UUID uuid = UUID.fromString(location.substring(4)); | ||||
|                             URL url = URI.create(Settings.Web.URL + "uploads/" + uuid + ".schematic").toURL(); | ||||
|                             URL base = new URL(Settings.Web.URL); | ||||
|                             URL url = new URL(base, "uploads/" + uuid + ".schematic"); | ||||
|                             schematic = this.schematicHandler.getSchematic(url); | ||||
|                         } catch (Exception e) { | ||||
|                             e.printStackTrace(); | ||||
|   | ||||
| @@ -189,7 +189,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { | ||||
|                 } | ||||
|                 Object value; | ||||
|                 try { | ||||
|                     final boolean accessible = field.canAccess(this); | ||||
|                     final boolean accessible = field.isAccessible(); | ||||
|                     field.setAccessible(true); | ||||
|                     value = field.get(this); | ||||
|                     field.setAccessible(accessible); | ||||
|   | ||||
| @@ -183,7 +183,7 @@ public class ChunkCoordinatorBuilder { | ||||
|      * Set whether the chunks should be allow to unload after being accessed. This should only be used where the chunks are read from | ||||
|      * and then written to from a separate queue where they're consequently unloaded. | ||||
|      * | ||||
|      * @param unloadAfter if to unload chunks afterwards | ||||
|      * @param unloadAfter if to unload chuns afterwards | ||||
|      * @return this ChunkCoordinatorBuilder instance | ||||
|      */ | ||||
|     public @NonNull ChunkCoordinatorBuilder unloadAfter(final boolean unloadAfter) { | ||||
|   | ||||
| @@ -83,7 +83,6 @@ import java.io.OutputStreamWriter; | ||||
| import java.io.PrintWriter; | ||||
| import java.net.HttpURLConnection; | ||||
| import java.net.MalformedURLException; | ||||
| import java.net.URI; | ||||
| import java.net.URL; | ||||
| import java.net.URLConnection; | ||||
| import java.nio.channels.Channels; | ||||
| @@ -145,7 +144,7 @@ public abstract class SchematicHandler { | ||||
|         } | ||||
|         final URL url; | ||||
|         try { | ||||
|             url = URI.create(Settings.Web.URL + "?key=" + uuid + "&type=" + extension).toURL(); | ||||
|             url = new URL(Settings.Web.URL + "?key=" + uuid + "&type=" + extension); | ||||
|         } catch (MalformedURLException e) { | ||||
|             e.printStackTrace(); | ||||
|             whenDone.run(); | ||||
| @@ -154,7 +153,7 @@ public abstract class SchematicHandler { | ||||
|         TaskManager.runTaskAsync(() -> { | ||||
|             try { | ||||
|                 String boundary = Long.toHexString(System.currentTimeMillis()); | ||||
|                 URLConnection con = URI.create(website).toURL().openConnection(); | ||||
|                 URLConnection con = new URL(website).openConnection(); | ||||
|                 con.setDoOutput(true); | ||||
|                 con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); | ||||
|                 try (OutputStream output = con.getOutputStream(); | ||||
| @@ -499,10 +498,9 @@ public abstract class SchematicHandler { | ||||
|     public List<String> getSaves(UUID uuid) { | ||||
|         String rawJSON; | ||||
|         try { | ||||
|             URLConnection connection = URI.create( | ||||
|                     Settings.Web.URL + "list.php?" + uuid.toString()) | ||||
|                     .toURL() | ||||
|                     .openConnection(); | ||||
|             String website = Settings.Web.URL + "list.php?" + uuid.toString(); | ||||
|             URL url = new URL(website); | ||||
|             URLConnection connection = new URL(url.toString()).openConnection(); | ||||
|             connection.setRequestProperty("User-Agent", "Mozilla/5.0"); | ||||
|             try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) { | ||||
|                 rawJSON = reader.lines().collect(Collectors.joining()); | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| import com.diffplug.gradle.spotless.SpotlessPlugin | ||||
| import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin | ||||
| import groovy.json.JsonSlurper | ||||
| import java.net.URI | ||||
| import xyz.jpenilla.runpaper.task.RunServer | ||||
|  | ||||
| @@ -171,9 +170,8 @@ subprojects { | ||||
|  | ||||
|                     scm { | ||||
|                         url.set("https://github.com/IntellectualSites/PlotSquared") | ||||
|                         connection.set("scm:git:https://github.com/IntellectualSites/PlotSquared.git") | ||||
|                         developerConnection.set("scm:git:git@github.com:IntellectualSites/PlotSquared.git") | ||||
|                         tag.set("${project.version}") | ||||
|                         connection.set("scm:https://IntellectualSites@github.com/IntellectualSites/PlotSquared.git") | ||||
|                         developerConnection.set("scm:git://github.com/IntellectualSites/PlotSquared.git") | ||||
|                     } | ||||
|  | ||||
|                     issueManagement { | ||||
| @@ -220,23 +218,14 @@ tasks.getByName<Jar>("jar") { | ||||
|     enabled = false | ||||
| } | ||||
|  | ||||
| val supportedVersions = listOf("1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.1", "1.20.2") | ||||
| val supportedVersions = listOf("1.16.5", "1.17", "1.17.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4", "1.20") | ||||
| tasks { | ||||
|     val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL() | ||||
|     val artifact = ((JsonSlurper().parse(lastSuccessfulBuildUrl) as Map<*, *>)["artifacts"] as List<*>) | ||||
|             .map { it as Map<*, *> } | ||||
|             .map { it["fileName"] as String } | ||||
|             .first { it.contains("Bukkit") } | ||||
|  | ||||
|     supportedVersions.forEach { | ||||
|         register<RunServer>("runServer-$it") { | ||||
|             minecraftVersion(it) | ||||
|             pluginJars(*project(":plotsquared-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile } | ||||
|                     .toTypedArray()) | ||||
|             jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true") | ||||
|             downloadPlugins { | ||||
|                 url("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/$artifact") | ||||
|             } | ||||
|             group = "run paper" | ||||
|             runDirectory.set(file("run-$it")) | ||||
|         } | ||||
|   | ||||
| @@ -1,20 +1,20 @@ | ||||
| [versions] | ||||
| # Platform expectations | ||||
| paper = "1.20.2-R0.1-SNAPSHOT" | ||||
| paper = "1.20.1-R0.1-SNAPSHOT" | ||||
| guice = "7.0.0" | ||||
| spotbugs = "4.7.3" | ||||
| checkerqual = "3.38.0" | ||||
| checkerqual = "3.37.0" | ||||
| gson = "2.10" | ||||
| guava = "31.1-jre" | ||||
| snakeyaml = "2.0" | ||||
| adventure = "4.14.0" | ||||
| adventure-bukkit = "4.3.1" | ||||
| adventure-bukkit = "4.3.0" | ||||
| log4j = "2.19.0" | ||||
|  | ||||
| # Plugins | ||||
| worldedit = "7.2.16" | ||||
| fawe = "2.8.0" | ||||
| placeholderapi = "2.11.4" | ||||
| worldedit = "7.2.15" | ||||
| fawe = "2.7.1" | ||||
| placeholderapi = "2.11.3" | ||||
| luckperms = "5.4" | ||||
| essentialsx = "2.20.1" | ||||
| mvdwapi = "3.1.1" | ||||
| @@ -22,7 +22,7 @@ mvdwapi = "3.1.1" | ||||
| # Third party | ||||
| prtree = "2.0.1" | ||||
| aopalliance = "1.0" | ||||
| cloud-services = "1.8.4" | ||||
| cloud-services = "1.8.3" | ||||
| arkitektonika = "2.1.2" | ||||
| squirrelid = "0.3.2" | ||||
| paster = "1.1.5" | ||||
| @@ -35,9 +35,9 @@ serverlib = "2.3.4" | ||||
| # Gradle plugins | ||||
| shadow = "8.1.1" | ||||
| grgit = "4.1.1" | ||||
| spotless = "6.22.0" | ||||
| spotless = "6.21.0" | ||||
| nexus = "1.3.0" | ||||
| runPaper = "2.2.0" | ||||
| runPaper = "2.1.0" | ||||
|  | ||||
| [libraries] | ||||
| # Platform expectations | ||||
|   | ||||
		Reference in New Issue
	
	Block a user