当前位置: 首页>>代码示例>>Java>>正文


Java Player.message方法代码示例

本文整理汇总了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.");
        }
    }
}
 
开发者ID:toddharrison,项目名称:Zown,代码行数:14,代码来源:CommandListener.java

示例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));
    }
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:37,代码来源:MixinEntityPlayerMP.java

示例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);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:8,代码来源:MixinMinecraftServer.java

示例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);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:10,代码来源:MixinMinecraftServer.java

示例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);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:10,代码来源:MixinMinecraftServer.java

示例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);
	}
}
 
开发者ID:toddharrison,项目名称:ReturnToWild,代码行数:9,代码来源:ReturnCommand.java

示例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);
    }
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:7,代码来源:MixinWorldServer.java


注:本文中的net.canarymod.api.entity.living.humanoid.Player.message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。