mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 11:27:35 +01:00
API for creating command sender which forwards feedback
This commit is contained in:
parent
5ac3ad3792
commit
23d50f8134
@ -1595,6 +1595,20 @@ public final class Bukkit {
|
|||||||
return server.getConsoleSender();
|
return server.getConsoleSender();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
/**
|
||||||
|
* Creates a special {@link CommandSender} which redirects command feedback (in the form of chat messages) to the
|
||||||
|
* specified listener. The returned sender will have the same effective permissions as {@link #getConsoleSender()}.
|
||||||
|
*
|
||||||
|
* @param feedback feedback listener
|
||||||
|
* @return a command sender
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public static CommandSender createCommandSender(final @NotNull java.util.function.Consumer<? super net.kyori.adventure.text.Component> feedback) {
|
||||||
|
return server.createCommandSender(feedback);
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the folder that contains all of the various {@link World}s.
|
* Gets the folder that contains all of the various {@link World}s.
|
||||||
*
|
*
|
||||||
|
@ -1349,6 +1349,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|||||||
@NotNull
|
@NotNull
|
||||||
public ConsoleCommandSender getConsoleSender();
|
public ConsoleCommandSender getConsoleSender();
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
/**
|
||||||
|
* Creates a special {@link CommandSender} which redirects command feedback (in the form of chat messages) to the
|
||||||
|
* specified listener. The returned sender will have the same effective permissions as {@link #getConsoleSender()}.
|
||||||
|
*
|
||||||
|
* @param feedback feedback listener
|
||||||
|
* @return a command sender
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public CommandSender createCommandSender(final @NotNull java.util.function.Consumer<? super net.kyori.adventure.text.Component> feedback);
|
||||||
|
// Paper end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the folder that contains all of the various {@link World}s.
|
* Gets the folder that contains all of the various {@link World}s.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user