Skip to content

Commit

Permalink
Merge branch 'IntellectualSites:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Telesphoreo authored Apr 21, 2024
2 parents acadc1f + 1a31f39 commit a75f746
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema" : "https://docs.renovatebot.com/renovate-schema.json",
"extends" : [
"config:recommended",
":semanticCommitsDisabled"
":semanticCommitsDisabled",
"schedule:earlyMondays"
],
"automerge" : true,
"ignoreDeps" : [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {
implementation(gradleApi())
implementation("org.ajoberstar.grgit:grgit-gradle:5.2.2")
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 {
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ mapmanager = "1.8.0-SNAPSHOT"
griefprevention = "17.0.0"
griefdefender = "2.1.0-SNAPSHOT"
residence = "4.5._13.1"
towny = "0.100.2.0"
plotsquared = "7.3.7"
towny = "0.100.2.3"
plotsquared = "7.3.8"

# Third party
bstats = "3.0.2"
Expand All @@ -37,9 +37,9 @@ lz4-java = "1.8.0"
lz4-stream = "1.0.0"
commons-cli = "1.6.0"
paperlib = "1.0.8"
paster = "1.1.5"
paster = "1.1.6"
vault = "1.7.1"
serverlib = "2.3.4"
serverlib = "2.3.6"
## Internal
text-adapter = "3.0.6"
text = "3.0.4"
Expand Down
2 changes: 1 addition & 1 deletion worldedit-bukkit/adapters/adapter-1_20_4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ repositories {

dependencies {
// 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)
}
2 changes: 1 addition & 1 deletion worldedit-bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ tasks.named<ShadowJar>("shadowJar") {
include(dependency("it.unimi.dsi:fastutil"))
}
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") {
include(dependency("com.intellectualsites.paster:Paster"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import com.sk89q.worldedit.world.item.ItemTypes;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.TreeType;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
Expand Down Expand Up @@ -186,10 +188,12 @@ default Material adapt(BlockType blockType) {
}

default org.bukkit.entity.EntityType adapt(EntityType entityType) {
if (!entityType.getId().startsWith("minecraft:")) {
throw new IllegalArgumentException("Bukkit only supports vanilla entities");
NamespacedKey entityKey = NamespacedKey.fromString(entityType.toString());
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);
}

/**
Expand Down Expand Up @@ -343,7 +347,7 @@ default GameMode adapt(org.bukkit.GameMode gameMode) {
* @return WorldEdit EntityType
*/
default EntityType adapt(org.bukkit.entity.EntityType entityType) {
return EntityTypes.get(entityType.getName().toLowerCase(Locale.ROOT));
return EntityTypes.get(entityType.getKey().toString());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,15 @@ public static BufferedImage readImage(InputStream stream) 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 {
final URI uri = url.toURI();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri).GET();

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ public static BufferedImage load(@Nullable ProvideBindings.ImageUri uri)
}

public static BufferedImage load(URI uri) throws InputParseException {
try {
return MainUtil.readImage(getInputStream(uri));
try (final InputStream stream = getInputStream(uri)) {
return MainUtil.readImage(stream);
} catch (IOException e) {
throw new InputParseException(TextComponent.of(e.getMessage()));
}
Expand All @@ -190,7 +190,7 @@ public static InputStream getInputStream(URI uri) throws InputParseException {
File file = new File(uri.getPath());
return new FileInputStream(file);
}
return new URL(uriStr).openStream();
return MainUtil.readImageStream(uri);
} catch (IOException e) {
throw new InputParseException(TextComponent.of(e.getMessage()));
}
Expand Down
2 changes: 1 addition & 1 deletion worldedit-fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ dependencies {
}

// 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.
"compileOnly"("net.fabricmc:sponge-mixin:${project.versions.mixin}")
Expand Down

0 comments on commit a75f746

Please sign in to comment.