mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +00:00
Use custom version of Shadow for Record support
This is necessary until jdependency updates, and then shadow pulls that update.
This commit is contained in:
1 parent
7479fdf1fc
commit
93a9194711
8 files changed
+48
-37
No files matched your search
@@ -14,12 +14,21 @@ public interface SpongeCommander extends Commander, ForwardingAudience.Single {
|
||||
return new SpongeCommanderImpl(commandCause);
|
||||
}
|
||||
|
||||
record SpongeCommanderImpl(
|
||||
@NonNull CommandCause commandCause) implements SpongeCommander {
|
||||
final class SpongeCommanderImpl implements SpongeCommander {
|
||||
|
||||
private final CommandCause commandCause;
|
||||
|
||||
private SpongeCommanderImpl(final @NonNull CommandCause commandCause) {
|
||||
this.commandCause = commandCause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull
|
||||
Audience audience() {
|
||||
public @NonNull CommandCause commandCause() {
|
||||
return this.commandCause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Audience audience() {
|
||||
return this.commandCause.audience();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,21 +10,19 @@ import org.spongepowered.api.entity.living.player.server.ServerPlayer;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
public record SpongePlayerCommander(CarbonChat carbon,
|
||||
@NonNull ServerPlayer player,
|
||||
@NonNull CommandCause commandCause)
|
||||
implements PlayerCommander, SpongeCommander {
|
||||
public record SpongePlayerCommander(
|
||||
@NonNull CarbonChat carbon,
|
||||
@NonNull ServerPlayer player,
|
||||
@NonNull CommandCause commandCause
|
||||
) implements PlayerCommander, SpongeCommander {
|
||||
|
||||
@Override
|
||||
public @NonNull
|
||||
CarbonPlayer carbonPlayer() {
|
||||
return requireNonNull(this.carbon.userManager().carbonPlayer(this.player.uniqueId()),
|
||||
"No CarbonPlayer for logged in Player!");
|
||||
public @NonNull CarbonPlayer carbonPlayer() {
|
||||
return requireNonNull(this.carbon.userManager().carbonPlayer(this.player.uniqueId()), "No CarbonPlayer for logged in Player!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull
|
||||
Audience audience() {
|
||||
public @NonNull Audience audience() {
|
||||
return this.commandCause.audience();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user