Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sponge] 1.21.4 #2687

Merged
merged 2 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading