Fix Paper command executor on modern Paper versions (#4791)

This commit is contained in:
Josh Roy 2022-02-01 17:13:16 -05:00 committed by GitHub
parent 5c46bea2ca
commit c6fe160b47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -12,7 +12,7 @@ import java.util.Set;
import java.util.UUID;
public class BukkitSenderProvider implements CommandSender {
private final ConsoleCommandSender base;
protected final ConsoleCommandSender base;
private final MessageHook hook;
public BukkitSenderProvider(ConsoleCommandSender base, MessageHook hook) {

View file

@ -7,7 +7,9 @@ java {
}
dependencies {
implementation project(':providers:BaseProviders')
implementation(project(':providers:BaseProviders')) {
exclude(module: 'spigot-api')
}
compileOnly 'io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT'
compileOnly 'io.papermc.paper:paper-mojangapi:1.18.1-R0.1-SNAPSHOT'
}

View file

@ -7,6 +7,7 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.ComponentLike;
import org.bukkit.Bukkit;
import org.bukkit.command.ConsoleCommandSender;
import org.jetbrains.annotations.NotNull;
public class PaperCommandSender extends BukkitSenderProvider {
public PaperCommandSender(ConsoleCommandSender base, MessageHook hook) {
@ -76,4 +77,9 @@ public class PaperCommandSender extends BukkitSenderProvider {
public void sendDumbComponent(Component message) {
sendMessage(Bukkit.getUnsafe().legacyComponentSerializer().serialize(message));
}
@Override
public @NotNull Component name() {
return base.name();
}
}