Deprecated CommandSender.isPlayer (instanceof!) and added ConsoleCommandSender
This commit is contained in:
parent
fb9fdc518e
commit
61f6259762
@ -20,6 +20,8 @@ public interface CommandSender {
|
||||
* Checks if this sender is a player
|
||||
*
|
||||
* @return true if they are
|
||||
* @deprecated Use instanceof
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isPlayer();
|
||||
}
|
19
src/main/java/org/bukkit/command/ConsoleCommandSender.java
Normal file
19
src/main/java/org/bukkit/command/ConsoleCommandSender.java
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
package org.bukkit.command;
|
||||
|
||||
/**
|
||||
* Represents CLI input from a console
|
||||
*/
|
||||
public class ConsoleCommandSender implements CommandSender {
|
||||
public void sendMessage(String message) {
|
||||
System.out.println(message);
|
||||
}
|
||||
|
||||
public boolean isOp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isPlayer() {
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user