mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
Use BlockCommandSender for dispatching Command block commands
Also allow commands that don't start with a / to match vanilla behavior By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
parent
ef3acaeea9
commit
31bd23bbfe
1 changed files with 42 additions and 0 deletions
|
@ -0,0 +1,42 @@
|
|||
package org.bukkit.craftbukkit.command;
|
||||
|
||||
import net.minecraft.server.TileEntityCommand;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
|
||||
/**
|
||||
* Represents input from a command block
|
||||
*/
|
||||
public class CraftBlockCommandSender extends ServerCommandSender implements BlockCommandSender {
|
||||
private final TileEntityCommand commandBlock;
|
||||
|
||||
public CraftBlockCommandSender(TileEntityCommand commandBlock) {
|
||||
super();
|
||||
this.commandBlock = commandBlock;
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return commandBlock.world.getWorld().getBlockAt(commandBlock.x, commandBlock.y, commandBlock.z);
|
||||
}
|
||||
|
||||
public void sendMessage(String message) {
|
||||
}
|
||||
|
||||
public void sendRawMessage(String message) {
|
||||
}
|
||||
|
||||
public void sendMessage(String[] messages) {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "@";
|
||||
}
|
||||
|
||||
public boolean isOp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setOp(boolean value) {
|
||||
throw new UnsupportedOperationException("Cannot change operator status of a block");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue