Skip to content

Commit

Permalink
chore(deps): update Minestom to 1.20.5 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
LooFifteen authored Jun 6, 2024
2 parents c6cdcc3 + c20a42a commit a5793a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies {
api 'com.github.ben-manes.caffeine:caffeine:2.9.0'
api 'com.squareup.okhttp3:okhttp:3.14.9'
api 'com.squareup.okio:okio:1.17.5'
api 'net.bytebuddy:byte-buddy:1.10.22'
api 'net.bytebuddy:byte-buddy:1.14.17'

api('org.spongepowered:configurate-core:3.7.2') {
transitive = false
Expand Down
10 changes: 5 additions & 5 deletions minestom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
id "java-library"
}

// minestom requires java 17+
sourceCompatibility = 17
targetCompatibility = 17
// minestom requires java 21+
sourceCompatibility = 21
targetCompatibility = 21

repositories {
mavenCentral()
Expand All @@ -21,11 +21,11 @@ dependencies {
exclude group: "org.spongepowered", module: "configurate-hocon"
exclude group: "me.lucko.configurate", module: "configurate-toml"
}
compileOnlyApi("net.minestom:minestom-snapshots:fe46ed4ac2")
compileOnlyApi("net.minestom:minestom-snapshots:1_20_5-b04ef5189f")

// testing
testImplementation project(":common")
testImplementation "net.minestom:minestom-snapshots:fe46ed4ac2"
testImplementation "net.minestom:minestom-snapshots:1_20_5-b04ef5189f"
testImplementation "commons-net:commons-net:3.10.0" // fix vulnerability in minestom
testImplementation "ch.qos.logback:logback-classic:1.4.14" // logger
testImplementation "org.spongepowered:configurate-hocon:3.7.2" // configuration using hocon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import net.minestom.server.event.EventNode;
import net.minestom.server.event.player.PlayerSpawnEvent;
import net.minestom.server.instance.Instance;
import net.minestom.server.utils.NamespaceID;
import net.minestom.server.world.DimensionType;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;

Expand All @@ -27,16 +25,13 @@ public final class DimensionTypeContextProvider implements ContextProvider {
@Override
public @NotNull Optional<String> query(@NotNull Player subject) {
return Optional.ofNullable(subject.getInstance())
.map(Instance::getDimensionType)
.map(DimensionType::getName)
.map(NamespaceID::value);
.map(Instance::getDimensionName);
}

@Override
public @NotNull Set<String> potentialValues() {
return MinecraftServer.getDimensionTypeManager().unmodifiableList().stream()
.map(DimensionType::getName)
.map(NamespaceID::value)
return MinecraftServer.getDimensionTypeRegistry().values().stream()
.map((d) -> d.namespace().value())
.collect(Collectors.toSet());
}

Expand Down

0 comments on commit a5793a0

Please sign in to comment.