mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
Feat: Add 'with' methods to CommandSourceStack (#11868)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package io.papermc.paper.command.brigadier;
|
||||
|
||||
import com.mojang.brigadier.RedirectModifier;
|
||||
import com.mojang.brigadier.tree.CommandNode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Entity;
|
||||
@@ -48,4 +50,24 @@ public interface CommandSourceStack {
|
||||
* @return entity that executes this command
|
||||
*/
|
||||
@Nullable Entity getExecutor();
|
||||
|
||||
/**
|
||||
* Creates a new CommandSourceStack object with a different location for redirecting commands to other nodes.
|
||||
*
|
||||
* @param location The location to create a new CommandSourceStack object with
|
||||
* @return The newly created CommandSourceStack
|
||||
* @see #getLocation()
|
||||
* @see com.mojang.brigadier.builder.ArgumentBuilder#fork(CommandNode, RedirectModifier)
|
||||
*/
|
||||
CommandSourceStack withLocation(Location location);
|
||||
|
||||
/**
|
||||
* Creates a new CommandSourceStack object with a different executor for redirecting commands to other nodes.
|
||||
*
|
||||
* @param executor The executing entity to create a new CommandSourceStack object with
|
||||
* @return The newly created CommandSourceStack
|
||||
* @see #getExecutor()
|
||||
* @see com.mojang.brigadier.builder.ArgumentBuilder#fork(CommandNode, RedirectModifier)
|
||||
*/
|
||||
CommandSourceStack withExecutor(Entity executor);
|
||||
}
|
||||
|
Reference in New Issue
Block a user