本文整理汇总了Java中net.canarymod.api.entity.living.humanoid.Player.message方法的典型用法代码示例。如果您正苦于以下问题:Java Player.message方法的具体用法?Java Player.message怎么用?Java Player.message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.canarymod.api.entity.living.humanoid.Player
的用法示例。
在下文中一共展示了Player.message方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlayerCommand
import net.canarymod.api.entity.living.humanoid.Player; //导入方法依赖的package包/类
@HookHandler(priority = Priority.CRITICAL)
public void onPlayerCommand(final PlayerCommandHook hook) {
final Player player = hook.getPlayer();
final String[] command = hook.getCommand();
if (!player.isOperator()) {
final Tree<? extends IZown> zownTree = zownManager.getZown(player.getLocation());
if (zownTree.getData().getConfiguration().hasCommandRestriction(command[0])) {
hook.setCanceled();
player.message(ChatFormat.GOLD + "That command has been restricted.");
}
}
}
示例2: chat
import net.canarymod.api.entity.living.humanoid.Player; //导入方法依赖的package包/类
@Override
public void chat(final String message) {
if (message.length() > 100) {
this.kick("Message too long!");
}
String out = message.trim();
final Matcher matcher = BAD_CHAT_PATTERN.matcher(out);
if (matcher.find() && !this.canIgnoreRestrictions()) {
out = out.replaceAll(matcher.group(), "");
}
if (out.startsWith("/")) {
this.executeCommand(out.split(" "));
} else if (this.isMuted()) {
this.notice("You are currently muted!");
} else {
final String displayName = this.getDisplayName();
this.defaultChatPattern.put("%name", displayName != null ? displayName : getName());
this.defaultChatPattern.put("%message", out);
this.defaultChatPattern.put("%group", this.getGroup().getName());
ChatHook hook = (ChatHook) new ChatHook(this, CHAT_FORMAT, Canary.getServer().getPlayerList(), this.defaultChatPattern).call();
if (hook.isCanceled()) {
return;
}
final String formattedMessage = hook.buildSendMessage();
for (Player player : hook.getReceiverList()) {
player.message(formattedMessage);
}
log.info(ChatFormat.consoleFormat(formattedMessage));
}
}
示例3: broadcastMessage
import net.canarymod.api.entity.living.humanoid.Player; //导入方法依赖的package包/类
@Override
public void broadcastMessage(String message) {
for (Player player : this.getPlayerList()) {
player.message(message);
}
Canary.log.info(message);
}
示例4: broadcastMessageToOps
import net.canarymod.api.entity.living.humanoid.Player; //导入方法依赖的package包/类
@Override
public void broadcastMessageToOps(String message) {
for (Player player : this.getPlayerList()) {
if (player.isOperator()) {
player.message(message);
}
}
Canary.log.info(message);
}
示例5: broadcastMessageToAdmins
import net.canarymod.api.entity.living.humanoid.Player; //导入方法依赖的package包/类
@Override
public void broadcastMessageToAdmins(String message) {
for (Player player : this.getPlayerList()) {
if (player.isAdmin()) {
player.message(message);
}
}
Canary.log.info(message);
}
示例6: sendMessage
import net.canarymod.api.entity.living.humanoid.Player; //导入方法依赖的package包/类
private void sendMessage(final MessageReceiver caller, final String message) {
if (caller instanceof Player) {
final Player player = (Player) caller;
player.message(message);
} else {
ReturnPlugin.LOG.info(message);
}
}
示例7: broadcastMessage
import net.canarymod.api.entity.living.humanoid.Player; //导入方法依赖的package包/类
@Override
public void broadcastMessage(String s) {
for (Player player : this.getPlayerList()) {
player.message(s);
}
}