Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Interface.Remap;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(ResourceLocation.class)
Expand All @@ -45,15 +46,20 @@ public abstract class ResourceLocationMixin_API {
@Shadow public abstract String shadow$getPath();
// @formatter:on

/**
* @author MrHell228 - October 6th, 2025
* @reason Delegate synthetic method to #compareTo(Key) to avoid CCE in case Key is not a ResourceLocation
*/
@Overwrite
public int compareTo(final Object obj) {
return ((Key) this).compareTo((Key) obj);
}

public String adventure$namespace() {
return this.shadow$getNamespace();
}

public String adventure$value() {
return this.shadow$getPath();
}

public int adventure$compareTo(Key o) {
return -o.compareTo((Key) this);
}
}