本文整理汇总了Java中org.spongepowered.api.command.CommandSource.sendMessage方法的典型用法代码示例。如果您正苦于以下问题:Java CommandSource.sendMessage方法的具体用法?Java CommandSource.sendMessage怎么用?Java CommandSource.sendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.spongepowered.api.command.CommandSource
的用法示例。
在下文中一共展示了CommandSource.sendMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
@Override
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {
if (!(src instanceof Player)) {
src.sendMessage(Text.of(TextColors.RED, "Lookups can only be performed by players"));
return CommandResult.empty();
}
Player p = (Player) src;
Collection<String> filters = args.getAll("filter");
LookupResult lookup = LookupResultManager.instance().getLookupResult(p);
if (lookup == null) {
src.sendMessage(Text.of(TextColors.DARK_AQUA, "[AS] ", TextColors.YELLOW, "You have no lookup history!"));
return CommandResult.empty();
}
FilterSet filterSet = new FilterSet(plugin, p, false);
filterSet.forceLookupType(lookup.getLookupType());
FilterParser.parse(filters, filterSet, p);
lookup.filterResult(filterSet);
lookup.showPage(p, 1);
return CommandResult.success();
}
示例2: sendRankOfPlayerSuccessfullyChangedToRank
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public static void sendRankOfPlayerSuccessfullyChangedToRank(CommandSource commandSource, String playerName, String rankName) {
Text message = Text.join(
Text.builder("Ранг игрока ").color(BASIC_CHAT_COLOR).build(),
Text.builder(playerName).color(BASIC_HIGHLIGHT).build(),
Text.builder(" изменён на ").color(BASIC_CHAT_COLOR).build(),
Text.builder(rankName).color(BASIC_HIGHLIGHT).build()
);
commandSource.sendMessage(message);
}
示例3: sendNotEnoughCurrencyOnClanBank
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public static void sendNotEnoughCurrencyOnClanBank(CommandSource commandSource, double price, String currencyName) {
Text message = Text.join(
Text.builder("В казне клана нету ").color(WARNING_CHAT_COLOR).build(),
Text.builder(String.valueOf(price)).color(WARNING_HIGHLIGHT).build(),
Text.builder(" " + currencyName).color(WARNING_CHAT_COLOR).build()
);
commandSource.sendMessage(message);
}
示例4: sendYouNeedToUnignoreClanChatBeforeTalking
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public static void sendYouNeedToUnignoreClanChatBeforeTalking(CommandSource commandSource) {
Text message = Text.join(
Text.builder("Чтобы написать в этот чат, нужно разблокировать его. Используйте ").color(WARNING_CHAT_COLOR).build(),
Text.builder("/clan chat ignore clan").color(WARNING_HIGHLIGHT).build()
);
commandSource.sendMessage(message);
}
示例5: doPurge
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public void doPurge(CommandSource src, long before) {
if (plugin.getDatabase().purgeEntries(before)) {
src.sendMessage(Text.of(TextColors.BLUE, "[AS] ", TextColors.YELLOW, "Purge successful"));
} else {
src.sendMessage(Text.of(TextColors.BLUE, "[AS] ", TextColors.RED, "Purge failed! Check console for more information!"));
}
}
示例6: sendYouDoNotHaveEnoughCurrency
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public static void sendYouDoNotHaveEnoughCurrency(CommandSource commandSource, double price, String currencyName) {
Text message = Text.join(
Text.builder("У вас нету ").color(WARNING_CHAT_COLOR).build(),
Text.builder(String.valueOf(price)).color(WARNING_HIGHLIGHT).build(),
Text.builder(" " + currencyName).color(WARNING_CHAT_COLOR).build()
);
commandSource.sendMessage(message);
}
示例7: printCorrectHelper
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
private void printCorrectHelper(int cost, CommandSource src)
{
if (cost != 0)
src.sendMessage(Text.of("§4Usage: §c" + commandAlias + " <slot, 1-6> {-c to confirm}"));
else
src.sendMessage(Text.of("§4Usage: §c" + commandAlias + " <slot, 1-6>"));
}
示例8: sendAddingPermissionFailedRankAlreadyHasThisPermission
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public static void sendAddingPermissionFailedRankAlreadyHasThisPermission(CommandSource commandSource, String pcode) {
Text message = Text.join(
Text.builder("Adding permission ").color(WARNING_CHAT_COLOR).build(),
Text.builder(pcode).color(WARNING_HIGHLIGHT).build(),
Text.builder(" failed: Rank already has this permission").color(WARNING_CHAT_COLOR).build()
);
commandSource.sendMessage(message);
}
示例9: warnBlacklistMod
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public void warnBlacklistMod(CommandSource source){
source.sendMessage(Text.of(TextColors.RED,"This server has mods installed preventing ", TextColors.GOLD,"HuskyCrates",TextColors.RED," from starting."));
source.sendMessage(Text.of(TextColors.RED,TextStyles.BOLD,"Offending Mods"));
for(String data : forceStopIDs){
source.sendMessage(Text.of(TextColors.WHITE," - " + data));
}
source.sendMessage(Text.of(TextColors.RED,"Please remove these mods from your server as they cause exploits with ",TextColors.DARK_RED,"various other Sponge plugins",TextColors.RED," as well."));
}
示例10: sendRankSuccessfullyCreated
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public static void sendRankSuccessfullyCreated(CommandSource commandSource, String rankName) {
Text message = Text.join(
Text.builder("Ранг ").color(BASIC_CHAT_COLOR).build(),
Text.builder(rankName).color(BASIC_HIGHLIGHT).build(),
Text.builder(" успешно создан").color(BASIC_CHAT_COLOR).build()
);
commandSource.sendMessage(message);
}
示例11: sendClanBankBalance
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public static void sendClanBankBalance(CommandSource commandSource, double balance, String currencyName) {
Text message = Text.join(
Text.builder("Баланс клана: ").color(BASIC_CHAT_COLOR).build(),
Text.builder(String.valueOf(balance)).color(BASIC_HIGHLIGHT).build(),
Text.builder(" " + currencyName).color(BASIC_CHAT_COLOR).build()
);
commandSource.sendMessage(message);
}
示例12: sendSuccessfullyRemovedThisPermission
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
public static void sendSuccessfullyRemovedThisPermission(CommandSource commandSource, String pcode) {
Text message = Text.join(
Text.builder("Successfully removed permission ").color(BASIC_CHAT_COLOR).build(),
Text.builder(pcode).color(BASIC_HIGHLIGHT).build()
);
commandSource.sendMessage(message);
}
示例13: execute
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
@Override
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {
Camera cam = args.<Camera>getOne("camera").orElseThrow(() -> new CommandException(Text.of("No Camera")));
plugin.getCameras().remove(cam.getId());
plugin.getConfig().save();
src.sendMessage(plugin.translations.CAMERA_DELTED, cam.templateVariables());
return CommandResult.success();
}
示例14: execute
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
@Override
public CommandResult execute(CommandSource source, CommandContext context) throws CommandException
{
if (source instanceof Player)
{
Player player = (Player)source;
if(EagleFactions.AdminList.contains(player.getUniqueId().toString()))
{
EagleFactions.AdminList.remove(player.getUniqueId().toString());
player.sendMessage(Text.of(PluginInfo.PluginPrefix, TextColors.GOLD, "Admin Mode", TextColors.WHITE, " has been turned ", TextColors.GOLD, "off"));
return CommandResult.success();
}
else
{
EagleFactions.AdminList.add(player.getUniqueId().toString());
player.sendMessage(Text.of(PluginInfo.PluginPrefix, TextColors.GOLD, "Admin Mode", TextColors.WHITE, " has been turned ", TextColors.GOLD, "on"));
return CommandResult.success();
}
}
else
{
source.sendMessage (Text.of (PluginInfo.ErrorPrefix, TextColors.RED, "Only in-game players can use this command!"));
}
return CommandResult.success();
}
示例15: execute
import org.spongepowered.api.command.CommandSource; //导入方法依赖的package包/类
@SuppressWarnings("static-access")
@Override
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {
AurionsVoteListener plugin = new AurionsVoteListener();
for(int i = 0; i<plugin.votetopheader.size();i++){
src.sendMessage(plugin.formatmessage(plugin.votetopheader.get(i),"",src.getName()));
}
SwitchSQL.VoteTop(src);
return CommandResult.success();
}