From fc9924754ac7560c3f1e34e1ca5ecdaf93075e3d Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 5 Jun 2022 22:13:20 -0500 Subject: [PATCH] Update for 1.2 --- .idea/codeStyles/Plexus_Code_Style.xml | 49 +++++++++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 +++ CONTRIBUTING.md | 2 +- build.gradle.kts | 9 +++-- src/main/java/dev/plex/HTTPDModule.java | 19 +++++++--- src/main/resources/module.yml | 2 +- 6 files changed, 75 insertions(+), 11 deletions(-) create mode 100644 .idea/codeStyles/Plexus_Code_Style.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml diff --git a/.idea/codeStyles/Plexus_Code_Style.xml b/.idea/codeStyles/Plexus_Code_Style.xml new file mode 100644 index 0000000..a7db3e4 --- /dev/null +++ b/.idea/codeStyles/Plexus_Code_Style.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..df773a2 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9c962b..a6199f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ For those who are wanting to contribute, we fully encourage doing so. There are 3. Create a new branch that describes the new feature, enhancement, or bug fix. For example, this is good: `feature/add-xyz`. This is bad: `fix-this-lol`. 4. Write the code that addresses your change. - Keep in mind that it **must** be formatted correctly. If you are using IntelliJ, there is a `codeStyle.xml` file that tells IntelliJ how to format your code. Check this link for information on how to use the file: https://www.jetbrains.com/help/idea/configuring-code-style.html#import-export-schemes -- If you are not using IntelliJ, that is fine. We use Allman style so please format your code accordingly. +- If you are not using IntelliJ, that is fine. We use the Plexus Code Style (which is almost the same as Allman) so please format your code accordingly. 6. Push your changes to your new branch and make a PR based off of that branch. ## Requirements for a PR diff --git a/build.gradle.kts b/build.gradle.kts index dd8fe4c..4031e7b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "dev.plex" -version = "1.1" +version = "1.2-SNAPSHOT" description = "Module-HTTPD" repositories { @@ -21,6 +21,9 @@ repositories { maven { url = uri("https://jitpack.io") + content { + includeGroup("com.github.MilkBowl") + } } } @@ -28,8 +31,8 @@ dependencies { implementation("org.projectlombok:lombok:1.18.24") annotationProcessor("org.projectlombok:lombok:1.18.24") implementation("io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT") - implementation("dev.plex:server:1.1") - implementation("dev.plex:api:1.1") + implementation("dev.plex:server:1.2-SNAPSHOT") + implementation("dev.plex:api:1.2-SNAPSHOT") implementation("org.json:json:20220320") implementation("org.reflections:reflections:0.10.2") implementation("org.eclipse.jetty:jetty-server:11.0.9") diff --git a/src/main/java/dev/plex/HTTPDModule.java b/src/main/java/dev/plex/HTTPDModule.java index 9f45450..7bae589 100644 --- a/src/main/java/dev/plex/HTTPDModule.java +++ b/src/main/java/dev/plex/HTTPDModule.java @@ -5,13 +5,17 @@ import dev.plex.config.ModuleConfig; import dev.plex.module.PlexModule; import dev.plex.request.AbstractServlet; import dev.plex.request.SchematicUploadServlet; -import dev.plex.request.impl.*; +import dev.plex.request.impl.AdminsEndpoint; +import dev.plex.request.impl.IndefBansEndpoint; +import dev.plex.request.impl.IndexEndpoint; +import dev.plex.request.impl.ListEndpoint; +import dev.plex.request.impl.PunishmentsEndpoint; +import dev.plex.request.impl.SchematicDownloadEndpoint; +import dev.plex.request.impl.SchematicUploadEndpoint; import dev.plex.util.PlexLog; - +import jakarta.servlet.MultipartConfigElement; import java.io.File; import java.util.concurrent.atomic.AtomicReference; - -import jakarta.servlet.MultipartConfigElement; import lombok.Getter; import net.milkbowl.vault.permission.Permission; import org.bukkit.Bukkit; @@ -81,7 +85,10 @@ public class HTTPDModule extends PlexModule ServletHolder uploadHolder = HTTPDModule.context.addServlet(SchematicUploadServlet.class, "/api/schematics/uploading"); File uploadLoc = new File(System.getProperty("java.io.tmpdir"), "schematic-temp-dir"); - if (!uploadLoc.exists()) uploadLoc.mkdirs(); + if (!uploadLoc.exists()) + { + uploadLoc.mkdirs(); + } uploadHolder.getRegistration().setMultipartConfig(new MultipartConfigElement(uploadLoc.getAbsolutePath(), 1024 * 1024 * 5, 1024 * 1024 * 25, 1024 * 1024)); server.setConnectors(new Connector[]{connector}); @@ -140,7 +147,7 @@ public class HTTPDModule extends PlexModule } } - private static boolean isFileSystemCaseSensitive = !new File( "a" ).equals( new File( "A" ) ); + private static boolean isFileSystemCaseSensitive = !new File("a").equals(new File("A")); public static boolean fileNameEquals(String filename1, String filename2) { diff --git a/src/main/resources/module.yml b/src/main/resources/module.yml index 3aa5fa3..a6a56f0 100644 --- a/src/main/resources/module.yml +++ b/src/main/resources/module.yml @@ -1,4 +1,4 @@ name: Module-HTTPD -version: 1.1 +version: 1.2-SNAPSHOT description: HTTPD server for Plex main: dev.plex.HTTPDModule \ No newline at end of file