More CommandBlock API

This commit is contained in:
Jake Potrebic
2021-09-23 10:40:09 -07:00
parent 65ec6cf342
commit 94732f8599
3 changed files with 52 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
public class CraftMinecartCommand extends CraftMinecart implements CommandMinecart {
public class CraftMinecartCommand extends CraftMinecart implements CommandMinecart, io.papermc.paper.commands.PaperCommandBlockHolder {
private final PermissibleBase perm = new PermissibleBase(this);
public CraftMinecartCommand(CraftServer server, MinecartCommandBlock entity) {
@@ -64,6 +64,17 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca
public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getHandle().getCommandBlock().getName());
}
@Override
public net.minecraft.world.level.BaseCommandBlock getCommandBlockHandle() {
return getHandle().getCommandBlock();
}
@Override
public void lastOutput(net.kyori.adventure.text.Component lastOutput) {
io.papermc.paper.commands.PaperCommandBlockHolder.super.lastOutput(lastOutput);
getCommandBlockHandle().onUpdated();
}
// Paper end
@Override