Merge branch 'IntellectualSites:main' into main

This commit is contained in:
Telesphoreo 2024-04-21 15:01:41 -05:00 committed by GitHub
commit a75f746156
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 36 additions and 27 deletions

View File

@ -2,7 +2,8 @@
"$schema" : "https://docs.renovatebot.com/renovate-schema.json", "$schema" : "https://docs.renovatebot.com/renovate-schema.json",
"extends" : [ "extends" : [
"config:recommended", "config:recommended",
":semanticCommitsDisabled" ":semanticCommitsDisabled",
"schedule:earlyMondays"
], ],
"automerge" : true, "automerge" : true,
"ignoreDeps" : [ "ignoreDeps" : [

View File

@ -11,7 +11,7 @@ jobs:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Validate Gradle Wrapper - name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2 uses: gradle/actions/wrapper-validation@v3
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:

View File

@ -11,7 +11,7 @@ jobs:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Validate Gradle Wrapper - name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2 uses: gradle/actions/wrapper-validation@v3
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:

View File

@ -9,7 +9,7 @@ jobs:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Validate Gradle Wrapper - name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2 uses: gradle/actions/wrapper-validation@v3
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:

View File

@ -28,7 +28,7 @@ dependencies {
implementation(gradleApi()) implementation(gradleApi())
implementation("org.ajoberstar.grgit:grgit-gradle:5.2.2") implementation("org.ajoberstar.grgit:grgit-gradle:5.2.2")
implementation("com.github.johnrengelman:shadow:8.1.1") implementation("com.github.johnrengelman:shadow:8.1.1")
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.5.13") implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.5.15")
} }
kotlin { kotlin {

View File

@ -14,8 +14,8 @@ mapmanager = "1.8.0-SNAPSHOT"
griefprevention = "17.0.0" griefprevention = "17.0.0"
griefdefender = "2.1.0-SNAPSHOT" griefdefender = "2.1.0-SNAPSHOT"
residence = "4.5._13.1" residence = "4.5._13.1"
towny = "0.100.2.0" towny = "0.100.2.3"
plotsquared = "7.3.7" plotsquared = "7.3.8"
# Third party # Third party
bstats = "3.0.2" bstats = "3.0.2"
@ -37,9 +37,9 @@ lz4-java = "1.8.0"
lz4-stream = "1.0.0" lz4-stream = "1.0.0"
commons-cli = "1.6.0" commons-cli = "1.6.0"
paperlib = "1.0.8" paperlib = "1.0.8"
paster = "1.1.5" paster = "1.1.6"
vault = "1.7.1" vault = "1.7.1"
serverlib = "2.3.4" serverlib = "2.3.6"
## Internal ## Internal
text-adapter = "3.0.6" text-adapter = "3.0.6"
text = "3.0.4" text = "3.0.4"

View File

@ -12,6 +12,6 @@ repositories {
dependencies { dependencies {
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.20.4-R0.1-SNAPSHOT // url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.20.4-R0.1-SNAPSHOT
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.20.4-R0.1-20240407.005218-157") the<PaperweightUserDependenciesExtension>().paperDevBundle("1.20.4-R0.1-20240420.200855-173")
compileOnly(libs.paperlib) compileOnly(libs.paperlib)
} }

View File

@ -173,7 +173,7 @@ tasks.named<ShadowJar>("shadowJar") {
include(dependency("it.unimi.dsi:fastutil")) include(dependency("it.unimi.dsi:fastutil"))
} }
relocate("org.incendo.serverlib", "com.fastasyncworldedit.serverlib") { relocate("org.incendo.serverlib", "com.fastasyncworldedit.serverlib") {
include(dependency("dev.notmyfault.serverlib:ServerLib:2.3.4")) include(dependency("dev.notmyfault.serverlib:ServerLib:2.3.6"))
} }
relocate("com.intellectualsites.paster", "com.fastasyncworldedit.paster") { relocate("com.intellectualsites.paster", "com.fastasyncworldedit.paster") {
include(dependency("com.intellectualsites.paster:Paster")) include(dependency("com.intellectualsites.paster:Paster"))

View File

@ -31,6 +31,8 @@ import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.item.ItemTypes;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.TreeType; import org.bukkit.TreeType;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
@ -186,10 +188,12 @@ public interface IBukkitAdapter {
} }
default org.bukkit.entity.EntityType adapt(EntityType entityType) { default org.bukkit.entity.EntityType adapt(EntityType entityType) {
if (!entityType.getId().startsWith("minecraft:")) { NamespacedKey entityKey = NamespacedKey.fromString(entityType.toString());
throw new IllegalArgumentException("Bukkit only supports vanilla entities"); if (entityKey == null) {
throw new IllegalArgumentException("Entity key '" + entityType + "' does not map to Bukkit");
} }
return org.bukkit.entity.EntityType.fromName(entityType.getId().substring(10).toLowerCase(Locale.ROOT));
return Registry.ENTITY_TYPE.get(entityKey);
} }
/** /**
@ -343,7 +347,7 @@ public interface IBukkitAdapter {
* @return WorldEdit EntityType * @return WorldEdit EntityType
*/ */
default EntityType adapt(org.bukkit.entity.EntityType entityType) { default EntityType adapt(org.bukkit.entity.EntityType entityType) {
return EntityTypes.get(entityType.getName().toLowerCase(Locale.ROOT)); return EntityTypes.get(entityType.getKey().toString());
} }
/** /**

View File

@ -554,8 +554,15 @@ public class MainUtil {
} }
public static BufferedImage readImage(URL url) throws IOException { public static BufferedImage readImage(URL url) throws IOException {
try (final InputStream stream = readImageStream(url.toURI())) {
return readImage(stream);
} catch (URISyntaxException e) {
throw new IOException("failed to parse url to uri reference", e);
}
}
public static InputStream readImageStream(final URI uri) throws IOException {
try { try {
final URI uri = url.toURI();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri).GET(); HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri).GET();
if (uri.getHost().equalsIgnoreCase("i.imgur.com")) { if (uri.getHost().equalsIgnoreCase("i.imgur.com")) {
@ -566,16 +573,13 @@ public class MainUtil {
requestBuilder.build(), requestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream() HttpResponse.BodyHandlers.ofInputStream()
); );
try (final InputStream body = response.body()) { final InputStream body = response.body();
if (response.statusCode() > 299) { if (response.statusCode() > 299) {
throw new IOException("Expected 2xx as response code, but received " + response.statusCode()); throw new IOException("Expected 2xx as response code, but received " + response.statusCode());
}
return readImage(body);
} }
return body;
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new IOException("request was interrupted", e); throw new IOException("request was interrupted", e);
} catch (URISyntaxException e) {
throw new IOException("failed to parse url to uri reference", e);
} }
} }

View File

@ -176,8 +176,8 @@ public class ImageUtil {
} }
public static BufferedImage load(URI uri) throws InputParseException { public static BufferedImage load(URI uri) throws InputParseException {
try { try (final InputStream stream = getInputStream(uri)) {
return MainUtil.readImage(getInputStream(uri)); return MainUtil.readImage(stream);
} catch (IOException e) { } catch (IOException e) {
throw new InputParseException(TextComponent.of(e.getMessage())); throw new InputParseException(TextComponent.of(e.getMessage()));
} }
@ -190,7 +190,7 @@ public class ImageUtil {
File file = new File(uri.getPath()); File file = new File(uri.getPath());
return new FileInputStream(file); return new FileInputStream(file);
} }
return new URL(uriStr).openStream(); return MainUtil.readImageStream(uri);
} catch (IOException e) { } catch (IOException e) {
throw new InputParseException(TextComponent.of(e.getMessage())); throw new InputParseException(TextComponent.of(e.getMessage()));
} }

View File

@ -100,7 +100,7 @@ dependencies {
} }
// No need for this at runtime // No need for this at runtime
"modCompileOnly"("me.lucko:fabric-permissions-api:0.1-SNAPSHOT") "modCompileOnly"("me.lucko:fabric-permissions-api:0.3.1")
// Hook these up manually, because Fabric doesn't seem to quite do it properly. // Hook these up manually, because Fabric doesn't seem to quite do it properly.
"compileOnly"("net.fabricmc:sponge-mixin:${project.versions.mixin}") "compileOnly"("net.fabricmc:sponge-mixin:${project.versions.mixin}")