diff --git a/.github/workflows/publish_to_nexus.yml b/.github/workflows/publish_to_nexus.yml index ab79e5e3..c31d6070 100644 --- a/.github/workflows/publish_to_nexus.yml +++ b/.github/workflows/publish_to_nexus.yml @@ -9,6 +9,7 @@ on: - feature/* - release/* - fix/* + - deps/* jobs: build: diff --git a/build.gradle.kts b/build.gradle.kts index cb7b079e..b6923ee9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "de.eldoria" -version = "2.6.1" +version = "2.6.2" var publishModules = setOf("schematicbrushreborn-api", "schematicbrushreborn-core", @@ -67,7 +67,7 @@ allprojects { } compileOnly(libs.fawe.bukkit) - testImplementation(platform("org.junit:junit-bom:5.10.1")) + testImplementation(platform("org.junit:junit-bom:5.10.2")) testImplementation("org.junit.jupiter", "junit-jupiter") testImplementation(testlibs.mockbukkit) testImplementation(libs.worldedit) { @@ -79,6 +79,10 @@ allprojects { testImplementation(libs.fawe.bukkit) } + publishData { + useInternalEldoNexusRepos() + } + tasks { compileJava { options.encoding = "UTF-8" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd491..e6441136 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e093..b82aa23a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..7101f8e4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/schematicbrushreborn-core/build.gradle.kts b/schematicbrushreborn-core/build.gradle.kts index 08f0a6e4..085d022d 100644 --- a/schematicbrushreborn-core/build.gradle.kts +++ b/schematicbrushreborn-core/build.gradle.kts @@ -16,12 +16,12 @@ dependencies { compileOnly(libs.jackson.yaml) compileOnly(libs.adventure.bukkit) compileOnly(libs.adventure.minimessage) - compileOnly("org.apache.logging.log4j", "log4j-slf4j2-impl", "2.22.1") - compileOnly("org.apache.logging.log4j", "log4j-core", "2.22.1") + compileOnly("org.apache.logging.log4j", "log4j-slf4j2-impl", "2.23.1") + compileOnly("org.apache.logging.log4j", "log4j-core", "2.23.1") testImplementation(project(":schematicbrushreborn-api")) testImplementation(libs.jetbrains.annotations) - testImplementation("org.mockito", "mockito-core", "5.8.0") + testImplementation("org.mockito", "mockito-core", "5.11.0") testImplementation(libs.jackson.databind) } publishData { diff --git a/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/schematics/SchematicBrushCache.java b/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/schematics/SchematicBrushCache.java index ca18861f..2a3235fa 100644 --- a/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/schematics/SchematicBrushCache.java +++ b/schematicbrushreborn-core/src/main/java/de/eldoria/schematicbrush/schematics/SchematicBrushCache.java @@ -9,6 +9,7 @@ import de.eldoria.eldoutilities.utils.TextUtil; import de.eldoria.schematicbrush.SchematicBrushRebornImpl; import de.eldoria.schematicbrush.config.Configuration; +import de.eldoria.schematicbrush.config.sections.SchematicSource; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; @@ -76,15 +77,17 @@ public void reload() { path = path.replace("\\", "/"); + logger.info("Loading Schematics from " + path); + var load = source.isRelative() ? Paths.get(root, path) : Paths.get(path); - loadSchematics(load); + loadSchematics(load, source); } } - private void loadSchematics(Path schematicFolder) { + private void loadSchematics(Path schematicFolder, SchematicSource source) { // fail silently if this folder does not exist. if (!schematicFolder.toFile().exists()) { - logger.config(schematicFolder.toString() + " does not exist. Skipping."); + logger.config(schematicFolder + " does not exist. Skipping."); return; } @@ -115,7 +118,7 @@ private void loadSchematics(Path schematicFolder) { // Build schematic references for (var file : directoryData.get().files()) { - addSchematic(file.toPath()); + addSchematic(file.toPath(), source); } logger.log(Level.CONFIG, "Loaded " + directoryData.get().files().size() + "schematics from " + path.toString()); } @@ -132,17 +135,30 @@ public void removeSchematic(File file) { } } - public void addSchematic(Path file) { - var directory = file.getParent(); + public void addSchematic(Path path, SchematicSource source) { + try { + importSchematic(path, source); + } catch (Exception e) { + logger.log(Level.WARNING, "Could not load schematic " + path.toString() + ".", e); + } + } - var sourceForPath = configuration.schematicConfig().getSourceForPath(directory); + public void addSchematic(Path path) { + try { + var sourceForPath = configuration.schematicConfig().getSourceForPath(path.getParent()); - if (sourceForPath.isEmpty()) { - logger.log(Level.CONFIG, "File " + directory + " is not part of a source"); - return; + if (sourceForPath.isEmpty()) { + logger.log(Level.CONFIG, "File " + path.getParent() + " is not part of a source"); + return; + } + importSchematic(path, sourceForPath.get()); + } catch (Exception e) { + logger.log(Level.WARNING, "Could not load schematic " + path.toString() + ".", e); } + } - var source = sourceForPath.get(); + private void importSchematic(Path path, SchematicSource source) { + var directory = path.getParent(); if (source.isExcluded(directory)) { logger.log(Level.CONFIG, "Directory " + directory + "is excluded."); @@ -175,9 +191,9 @@ public void addSchematic(Path file) { Schematic schematic; try { - schematic = Schematic.of(file); + schematic = Schematic.of(path); } catch (InvalidClipboardFormatException e) { - logger.log(Level.WARNING, "Format of " + file + " is invalid."); + logger.log(Level.WARNING, "Format of " + path + " is invalid."); return; } diff --git a/schematicbrushreborn-paper/build.gradle.kts b/schematicbrushreborn-paper/build.gradle.kts index 7034c17f..a93d6a77 100644 --- a/schematicbrushreborn-paper/build.gradle.kts +++ b/schematicbrushreborn-paper/build.gradle.kts @@ -98,7 +98,7 @@ bukkit { register("schematicbrush") { description = "Create and use schematic brushes" aliases = listOf("sbr", "schbr", "schembrush") - permission = "schematicbrush.use" + permission = "schematicbrush.brush.use" } register("schematicbrushsettings") { diff --git a/settings.gradle.kts b/settings.gradle.kts index d49f4050..04b563c2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -30,10 +30,10 @@ dependencyResolutionManagement { // adventure library("adventure-bukkit", "net.kyori:adventure-platform-bukkit:4.3.2") - library("adventure-minimessage", "net.kyori:adventure-text-minimessage:4.15.0") + library("adventure-minimessage", "net.kyori:adventure-text-minimessage:4.17.0") // utilities library("eldoutil-legacy", "de.eldoria:eldo-util:1.14.4") - library("eldoutil-jackson", "de.eldoria.util:jackson-configuration:2.0.3") + library("eldoutil-jackson", "de.eldoria.util:jackson-configuration:2.0.6") library("messageblocker", "de.eldoria:messageblocker:1.1.2") // misc library("jetbrains-annotations", "org.jetbrains:annotations:24.1.0") @@ -45,14 +45,14 @@ dependencyResolutionManagement { library("paper-v17", "io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT") library("spigot-v16", "io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT") // world edit - library("worldedit", "com.sk89q.worldedit:worldedit-bukkit:7.2.18") - version("fawe", "2.8.4") + library("worldedit", "com.sk89q.worldedit:worldedit-bukkit:7.3.0") + version("fawe", "2.9.2") library("fawe-core", "com.fastasyncworldedit","FastAsyncWorldEdit-Core").versionRef("fawe") library("fawe-bukkit", "com.fastasyncworldedit","FastAsyncWorldEdit-Bukkit").versionRef("fawe") // plugins - plugin("publishdata", "de.chojo.publishdata").version("1.3.0") - plugin("spotless", "com.diffplug.spotless").version("6.24.0") + plugin("publishdata", "de.chojo.publishdata").version("1.4.0") + plugin("spotless", "com.diffplug.spotless").version("6.25.0") plugin("shadow", "com.github.johnrengelman.shadow").version("8.1.1") plugin("pluginyml-bukkit", "net.minecrell.plugin-yml.bukkit").version("0.6.0") //plugin("pluginyml-paper","net.minecrell.plugin-yml.paper").version( "0.5.3")