Skip to content

Commit

Permalink
[Sponge] 1.21.4 (#2687)
Browse files Browse the repository at this point in the history
* [Sponge] 1.21.4

* Fix an error on launch
  • Loading branch information
me4502 authored Jan 5, 2025
1 parent 97630e6 commit 805bde1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ fabric-api = "0.110.5+1.21.4"
neogradle = "7.0.171"
neoforge-minecraft = "1.21.4"

sponge-minecraft = "1.21.3"
sponge-minecraft = "1.21.4"
# https://repo.spongepowered.org/service/rest/repository/browse/maven-public/org/spongepowered/spongeapi/
sponge-api = "13.0.0-20241025.155029-3"
sponge-api-major = "13"
sponge-api = "14.0.0-20241229.134205-2"
sponge-api-major = "14"

# https://parchmentmc.org/docs/getting-started; note that we use older MC versions some times which is OK
parchment-minecraft = "1.21"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import org.spongepowered.plugin.PluginContainer;
import org.spongepowered.plugin.builtin.jvm.Plugin;

import java.lang.invoke.MethodHandles;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
Expand Down Expand Up @@ -142,7 +143,8 @@ public void onPluginConstruction(ConstructPluginEvent event) {

event.game().eventManager().registerListeners(
container,
new CUIChannelHandler.RegistrationHandler()
new CUIChannelHandler.RegistrationHandler(),
MethodHandles.lookup()
);
logger.info("WorldEdit for Sponge (version " + getInternalVersion() + ") is loaded");
}
Expand Down Expand Up @@ -440,8 +442,8 @@ SpongeConfiguration getConfig() {

public Actor wrapCommandCause(CommandCause cause) {
Object rootCause = cause.root();
if (rootCause instanceof ServerPlayer) {
return SpongeAdapter.adapt((ServerPlayer) rootCause);
if (rootCause instanceof ServerPlayer serverPlayer) {
return SpongeAdapter.adapt(serverPlayer);
}
if (rootCause instanceof LocatableBlock locatableBlock) {
Optional<? extends BlockEntity> optionalBlockEntity = locatableBlock.world().blockEntity(locatableBlock.blockPosition());
Expand All @@ -452,8 +454,8 @@ public Actor wrapCommandCause(CommandCause cause) {
}
}
}
if (rootCause instanceof Audience) {
return new SpongeCommandSender((Audience) rootCause);
if (rootCause instanceof Audience audience) {
return new SpongeCommandSender(audience);
}

throw new UnsupportedOperationException("Cannot wrap " + rootCause.getClass());
Expand Down

0 comments on commit 805bde1

Please sign in to comment.