• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PaginationService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.spongepowered.api.service.pagination.PaginationService的典型用法代码示例。如果您正苦于以下问题:Java PaginationService类的具体用法?Java PaginationService怎么用?Java PaginationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PaginationService类属于org.spongepowered.api.service.pagination包,在下文中一共展示了PaginationService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public CommandResult execute(CommandSource source, CommandContext context) throws CommandException
{
    HashSet<Faction> factionsList = new HashSet<>(FactionLogic.getFactions());
    List<Text> helpList = new ArrayList<>();

    for(Faction faction: factionsList)
    {
        String tag = "";
        if(faction.Tag != null && !faction.Tag.equals("")) tag = "[" + faction.Tag + "] ";

        Text factionHelp = Text.builder()
                .append(Text.builder()
                        .append(Text.of(TextColors.AQUA, "- " + tag + faction.Name + " (" + faction.Power + "/" + PowerService.getFactionMaxPower(faction) + ")"))
                        .build())
                .build();

        helpList.add(factionHelp);
    }

    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    PaginationList.Builder paginationBuilder = paginationService.builder().title(Text.of(TextColors.GREEN, "Factions List")).padding(Text.of("-")).contents(helpList);
    paginationBuilder.sendTo(source);

    return CommandResult.success();
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:27,代码来源:ListCommand.java


示例2: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public CommandResult execute(CommandSource src, CommandContext args)
        throws CommandException {
    List<User> annointedUsers = AnnointmentDataManager
            .getAllAnnointedUsers().collect(Collectors.toList());
    if (annointedUsers.isEmpty()) {
        src.sendMessage(
                Texts.of(TextColors.RED, "No one has been annointed."));
    } else {
        PaginationBuilder builder = Sponge.getServiceManager()
                .provideUnchecked(PaginationService.class).builder();
        builder.title(Texts.of(TextColors.GREEN,
                "Annointed Users [Name (UUID) [Flags]]"));
        builder.contents(annointedUsersToContents(annointedUsers));
        builder.sendTo(src);
    }
    return CommandResult.success();
}
 
开发者ID:kenzierocks,项目名称:Annointment,代码行数:19,代码来源:ListCommand.java


示例3: sendAllNews

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
    public void sendAllNews(MessageReceiver msgReceiver) throws CommandException {
//        CommandExceptions.doOrThrow("NewsService.sendAllNews()", () -> {
            Iterable<News> newsList = newsRegistry.getAllNews();
            if (Iterables.isEmpty(newsList)) {
                msgReceiver.sendMessage(Texts.inRed("Sorry, no news."));
                return;
            } else {
                PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
                PaginationList.Builder paginationBuilder = paginationService.builder();
                paginationBuilder.title(Text.of("NEWS"));
                paginationBuilder.contents(Iterables.transform(newsList, news -> news2text(news)));
                paginationBuilder.sendTo(msgReceiver);
            }
//        });
    }
 
开发者ID:vorburger,项目名称:ch.vorburger.minecraft.osgi,代码行数:17,代码来源:NewsServiceImpl.java


示例4: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {

    if (!(src instanceof Player)) {
        return CommandResult.empty();
    }

    Player player = (Player) src;
    PlayerEntity playerEntity = PlayerCache.instance.get(player);

    List<Text> list = new CopyOnWriteArrayList<>();
    Set<HomeEntity> homes = playerEntity.getHomes();
    homes.forEach(home -> list.add(Text.of(getHomeAction(player, home.getName()), Text.of(" - "), getDeleteHomeAction(player, home.getName()))));

    if (list.isEmpty()) {
        player.sendMessage(MessagesUtil.error(player, "home.empty"));
        return CommandResult.success();
    }

    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    paginationService.builder().title(MessagesUtil.get(player, "home.title")).contents(list).padding(Text.of("-")).sendTo(player);
    return CommandResult.success();
}
 
开发者ID:mmonkey,项目名称:Destinations,代码行数:24,代码来源:ListHomesCommand.java


示例5: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {

    if (!(src instanceof Player)) {
        return CommandResult.empty();
    }

    Player player = (Player) src;
    PlayerEntity playerEntity = PlayerCache.instance.get(player);
    Set<WarpEntity> warps = PlayerUtil.getPlayerWarps(playerEntity);

    if (warps.size() == 0) {
        player.sendMessage(MessagesUtil.error(player, "warp.empty"));
        return CommandResult.success();
    }

    List<Text> list = new CopyOnWriteArrayList<>();
    warps.forEach(warp -> list.add(Text.of(getWarpAction(player, warp), getDeleteWarpAction(player, warp, playerEntity))));

    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    paginationService.builder().title(MessagesUtil.get(player, "warp.title")).contents(list).padding(Text.of("-")).sendTo(player);
    return CommandResult.success();
}
 
开发者ID:mmonkey,项目名称:Destinations,代码行数:24,代码来源:ListWarpsCommand.java


示例6: showClaims

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
public static void showClaims(CommandSource src, List<Claim> claims, int height, boolean visualizeClaims) {
    final String worldName = src instanceof Player ? ((Player) src).getWorld().getName() : Sponge.getServer().getDefaultWorldName();
    final boolean canListOthers = src.hasPermission(GPPermissions.LIST_OTHER_CLAIMS);
    List<Text> claimsTextList = generateClaimTextList(new ArrayList<Text>(), claims, worldName, null, src, createShowClaimsConsumer(src, claims, height, visualizeClaims), canListOthers, false);

    if (visualizeClaims && src instanceof Player) {
        Player player = (Player) src;
        final GPPlayerData playerData = GriefPreventionPlugin.instance.dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
        if (claims.size() > 1) {
            if (height != 0) {
                height = playerData.lastValidInspectLocation != null ? playerData.lastValidInspectLocation.getBlockY() : player.getProperty(EyeLocationProperty.class).get().getValue().getFloorY();
            }
            Visualization visualization = Visualization.fromClaims(claims, playerData.optionClaimCreateMode == 1 ? height : player.getProperty(EyeLocationProperty.class).get().getValue().getFloorY(), player.getLocation(), playerData, null);
            visualization.apply(player);
        } else {
            GPClaim gpClaim = (GPClaim) claims.get(0);
            gpClaim.getVisualizer().createClaimBlockVisuals(height, player.getLocation(), playerData);
            gpClaim.getVisualizer().apply(player);
        }
    }

    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    PaginationList.Builder paginationBuilder = paginationService.builder()
            .title(Text.of(TextColors.RED,"Claim list")).padding(Text.of(TextStyles.STRIKETHROUGH, "-")).contents(claimsTextList);
    paginationBuilder.sendTo(src);
}
 
开发者ID:MinecraftPortCentral,项目名称:GriefPrevention,代码行数:27,代码来源:CommandHelper.java


示例7: executeAsync

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public void executeAsync(CommandSource src, CommandContext ctx)
{
	ArrayList<String> worlds = EssentialCmds.getEssentialCmds().getGame().getServer().getWorlds().stream().filter(world -> world.getProperties().isEnabled()).map(World::getName).collect(Collectors.toCollection(ArrayList::new));

	PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
	ArrayList<Text> worldText = Lists.newArrayList();

	for (String name : worlds)
	{
		Text item = Text.builder(name)
			.onClick(TextActions.runCommand("/tpworld " + name))
			.onHover(TextActions.showText(Text.of(TextColors.WHITE, "Teleport to world ", TextColors.GOLD, name)))
			.color(TextColors.DARK_AQUA)
			.style(TextStyles.UNDERLINE)
			.build();

		worldText.add(item);
	}

	PaginationList.Builder paginationBuilder = paginationService.builder().contents(worldText).title(Text.of(TextColors.GREEN, "Showing Worlds")).padding(Text.of("-"));
	paginationBuilder.sendTo(src);
}
 
开发者ID:hsyyid,项目名称:EssentialCmds,代码行数:24,代码来源:WorldsBase.java


示例8: executeAsync

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public void executeAsync(CommandSource src, CommandContext ctx)
{
	ArrayList<String> rules = Utils.getRules();
	List<Text> ruleText = Lists.newArrayList();
	
	if (rules.isEmpty())
	{
		src.sendMessage(Text.of(TextColors.DARK_RED, "Error! ", TextColors.RED, "The rules for this server are not defined."));
		return;
	}

	for (String rule : rules)
	{
		ruleText.add(Text.of(TextColors.GRAY, (rules.indexOf(rule) + 1) + ". ", TextColors.GOLD, rule));
	}

	PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
	PaginationList.Builder paginationBuilder = paginationService.builder().contents(ruleText).title(Text.of(TextColors.GOLD, "Rules")).padding(Text.of("-"));
	paginationBuilder.sendTo(src);
}
 
开发者ID:hsyyid,项目名称:EssentialCmds,代码行数:22,代码来源:RuleExecutor.java


示例9: sendPlayerInfo

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public void sendPlayerInfo(IActiveCharacter character, List<CharacterBase> target) {
	PaginationService paginationService = game.getServiceManager().provide(PaginationService.class).get();
	PaginationList.Builder builder = paginationService.builder();
	builder.padding(Text.builder("=").color(TextColors.GREEN).build());
	List<Text> content = new ArrayList<>();
	for (CharacterBase characterBase : target) {
		String name = characterBase.getName();
		int level = character.getPrimaryClass().getLevel();
		String name1 = character.getRace().getName();
		Text.Builder b = Text.builder();
		b.append(Text.builder(" [").color(TextColors.DARK_GRAY).build())
				.append(Text.builder("SELECT").color(TextColors.GREEN).build())
				.append(Text.builder("] - ").color(TextColors.DARK_GRAY).build());
		b.append(Text.of(name));
		if (character.getPrimaryClass() != ExtendedNClass.Default) {
			b.append(Text.builder(" ").build()).append(Text.of(level));
		}
		if (character.getRace() != Race.Default) {
			b.append(Text.of(name1));
		}
		content.add(b.build());
	}
	builder.contents(content);
	builder.sendTo(character.getPlayer());
}
 
开发者ID:NeumimTo,项目名称:NT-RPG,代码行数:27,代码来源:VanilaMessaging.java


示例10: sendListOfRunes

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public void sendListOfRunes(IActiveCharacter character) {
	PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
	PaginationList.Builder builder = paginationService.builder();

	List<Text> content = new ArrayList<>();
	List<Rune> r = new ArrayList<>(rwService.getRunes().values());
	Collections.sort(r, (o1, o2) -> (int) (o1.getSpawnchance() - o2.getSpawnchance()));
	for (Rune rune : r) {
		LiteralText.Builder b = Text.builder(rune.getName()).color(TextColors.GOLD);
		if (rune.getLore() != null) {
			b.append(Text.of(" - " + rune.getLore(), TextColors.WHITE, TextStyles.ITALIC));
		}
		content.add(b.build());
	}
	builder.contents(content);
	builder.linesPerPage(10);
	builder.padding(Text.builder("=").color(TextColors.DARK_GRAY).build());
	builder.sendTo(character.getPlayer());


}
 
开发者ID:NeumimTo,项目名称:NT-RPG,代码行数:23,代码来源:VanilaMessaging.java


示例11: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {
  WorldService service = Sponge.getServiceManager().provideUnchecked(WorldService.class);
  PaginationService pagination = Sponge.getServiceManager().provideUnchecked(PaginationService.class);

  WildernessWorldWrapper wrapper = service.getEffectWrapper(WildernessWorldWrapper.class).get();

  List<Text> result = wrapper.getMetaInformation().stream()
      .sorted(Comparator.comparing(a -> a.getKey().getName()))
      .map(this::createLine)
      .collect(Collectors.toList());

  pagination.builder()
      .contents(result)
      .title(Text.of(TextColors.GOLD, "Meta Info List"))
      .padding(Text.of(" "))
      .sendTo(src);

  return CommandResult.success();
}
 
开发者ID:Skelril,项目名称:Skree,代码行数:21,代码来源:WildernessMetaCommand.java


示例12: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
/**
 * Gets the currently loaded warps, paginates them into pages of size
 * WARPS_PER_PAGE, and sends the warp names in a message to the player
 *
 * @param source
 * @param args
 * @return
 * @throws CommandException
 */
@Override
public CommandResult execute(CommandSource source, CommandContext args) throws CommandException {
    List<Text> warpNames = new ArrayList<Text>();

    for (Warp w : this.plugin.getWarpManager().getPayload()) {
        if (Util.hasPermission(source, w)) {
            warpNames.add(Text.of(Util.warpText(w), TextColors.WHITE, " - ", Util.warpInfoText(w), " - ", Util.deleteWarpText(w)));
        }
    }

    if (warpNames.isEmpty()) {
        source.sendMessage(Constants.NO_WARPS_MSG);
        return CommandResult.success();
    }

    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    paginationService.builder().contents(warpNames).title(Text.of(TextColors.BLUE, "Warps")).padding(Text.of("-")).sendTo(source);

    return CommandResult.success();
}
 
开发者ID:RobertHerhold,项目名称:BLWarps,代码行数:30,代码来源:ListWarpsExecutor.java


示例13: listBuilder

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
private PaginationList.Builder listBuilder(WorldProperties world,
                                           Map<String, List<Graveyard>> graveyardMap, Graveyards plugin) {

    List<Text> graveyardInfo = new ArrayList<>();
    graveyardMap.forEach((name, list) -> {
        graveyardInfo.add(Text.of(TextColors.GREEN, name, ":"));
        graveyardInfo.addAll(list.stream().map(graveyard -> Text.of("  ", graveyard.getName(), ": ",
                graveyard.getLocation().toString())).collect(Collectors.toList()));
    });

    PaginationService pagServ = plugin.getGame().getServiceManager().provide(PaginationService.class).get();
    PaginationList.Builder builder = pagServ.builder();
    builder.contents(graveyardInfo)
            .title(Text
                    .builder("Graveyards in ")
                    .color(TextColors.GREEN)
                    .append(Text.builder(world.getWorldName())
                            .color(TextColors.DARK_GREEN).build()).build())
            .padding(Text.of("-"));
    return builder;
}
 
开发者ID:Zerthick,项目名称:Graveyards,代码行数:22,代码来源:GraveyardListExecutor.java


示例14: sendPaginatedMessage

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
private void sendPaginatedMessage(Node node, CommandSource source) {
    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    PaginationList.Builder builder = paginationService.builder();
    List<Text> contents = node.getSubcategories().stream()
            .map(category -> Text.builder("> " + category.getName()).color(TextColors.GRAY).onClick(TextActions.executeCallback(commandSource -> {
                if (commandSource instanceof Player) {
                    sendPaginatedMessage(node.getChild(category), source);
                }
            })).build()).collect(Collectors.toList());
    for (Package p : node.getPackages()) {
        contents.add(Text.builder(p.getName()).color(TextColors.WHITE).append(Text.builder(" - ").color(TextColors.GRAY).build())
                .append(Text.builder("$x".replace("$", plugin.getServerInformation().getAccount().getCurrency().getSymbol())
                        .replace("x", "" + p.getEffectivePrice())).color(TextColors.GREEN).build())
                .onClick(TextActions.executeCallback(commandSource -> {
                    if (commandSource instanceof Player) {
                        plugin.getPlatform().executeAsync(new SendCheckoutLinkTask(plugin, p.getId(), (Player) commandSource));
                    }
                })).build());
    }
    builder.title(Text.builder(plugin.getI18n().get("sponge_listing")).color(TextColors.AQUA).build()).contents(contents).padding(Text.of("-")).sendTo(source);
}
 
开发者ID:BuycraftPlugin,项目名称:BuycraftX,代码行数:22,代码来源:ListPackagesCmd.java


示例15: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public CommandResult execute(CommandSource sender, CommandContext args) throws CommandException {
    checkPermission(sender, JailPermissions.UC_JAIL_JAILLIST_BASE);
    List<Jail> jails = GlobalData.get(JailKeys.JAILS).get();
    List<Text> texts = new ArrayList<>();

    //Add entry to texts for every jail
    for (Jail jail : jails) {
        texts.add(Messages.getFormatted("jail.command.jaillist.entry", "%jail%", jail.getName(), "%description%", jail.getDescription()).toBuilder().onHover(TextActions.showText(Messages.getFormatted("jail.command.jaillist.hoverentry", "%jail%", jail.getName()))).onClick(TextActions.runCommand("/jailtp " + jail.getName())).build());
    }

    //If empty send message
    if (texts.isEmpty()) {
        throw new ErrorMessageException(Messages.getFormatted(sender, "jail.command.jaillist.empty"));
    }

    //Sort alphabetically
    Collections.sort(texts);

    //Send page
    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    PaginationList paginationList = paginationService.builder().contents(texts).title(Messages.getFormatted("jail.command.jaillist.header").toBuilder().color(TextColors.DARK_GREEN).build()).build();
    paginationList.sendTo(sender);
    return CommandResult.success();
}
 
开发者ID:Bammerbom,项目名称:UltimateCore,代码行数:26,代码来源:JaillistCommand.java


示例16: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public CommandResult execute(CommandSource sender, CommandContext args) throws CommandException {
    checkPermission(sender, WarpPermissions.UC_WARP_WARPLIST_BASE);
    //Send the player a paginated list of all warps
    List<Warp> warps = GlobalData.get(WarpKeys.WARPS).get();
    List<Text> texts = new ArrayList<>();
    //Add entry to texts for every warp
    for (Warp warp : warps) {
        if (!sender.hasPermission("uc.warp.warp." + warp.getName().toLowerCase())) {
            continue;
        }
        texts.add(Messages.getFormatted("warp.command.warplist.entry", "%warp%", warp.getName(), "%description%", warp.getDescription()).toBuilder().onHover(TextActions.showText(Messages.getFormatted("warp.command.warplist.hoverentry", "%warp%", warp.getName()))).onClick(TextActions.runCommand("/warp " + warp.getName())).build());
    }
    //If empty send message
    if (texts.isEmpty()) {
        throw new ErrorMessageException(Messages.getFormatted(sender, "warp.command.warplist.empty"));
    }
    //Sort alphabetically
    Collections.sort(texts);
    //Send page
    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    PaginationList paginationList = paginationService.builder().contents(texts).title(Messages.getFormatted("warp.command.warplist.header").toBuilder().color(TextColors.DARK_GREEN).build()).build();
    paginationList.sendTo(sender);
    return CommandResult.success();
}
 
开发者ID:Bammerbom,项目名称:UltimateCore,代码行数:26,代码来源:WarplistCommand.java


示例17: showPlayerInfo

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
private void showPlayerInfo(CommandSource source, Player player)
{
    if(player.hasPlayedBefore())
    {
        List<Text> playerInfo = new ArrayList<Text>();

        String playerFactionName = FactionLogic.getFactionName(player.getUniqueId());
        if(playerFactionName == null) playerFactionName = "";

        Date lastPlayed = Date.from(player.getJoinData().lastPlayed().get());
        SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
        String formattedDate = formatter.format(lastPlayed);

        //TODO: Show if player is online or offline.

        Text info = Text.builder()
                .append(Text.of(TextColors.AQUA, "Name: ", TextColors.GOLD, PlayerService.getPlayerName(player.getUniqueId()).get() + "\n"))
                .append(Text.of(TextColors.AQUA, "Last Played: ", TextColors.GOLD, formattedDate + "\n"))
                .append(Text.of(TextColors.AQUA, "Faction: ", TextColors.GOLD, playerFactionName + "\n"))
                .append(Text.of(TextColors.AQUA, "Power: ", TextColors.GOLD, PowerService.getPlayerPower(player.getUniqueId()) + "/" + PowerService.getPlayerMaxPower(player.getUniqueId())))
                .build();

        playerInfo.add(info);

        PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
        PaginationList.Builder paginationBuilder = paginationService.builder().title(Text.of(TextColors.GREEN, "Player Info")).padding(Text.of("=")).contents(playerInfo);
        paginationBuilder.sendTo(source);
    }
    else
    {
        player.sendMessage (Text.of (PluginInfo.ErrorPrefix, TextColors.RED, "This player has not played on this server!"));
    }
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:34,代码来源:PlayerCommand.java


示例18: execute

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Override
public CommandResult execute(CommandSource source, CommandContext context) throws CommandException
{
    List<Faction> factionsList = new ArrayList<>(FactionLogic.getFactions());
    List<Text> helpList = new ArrayList<>();
    int index = 0;

    factionsList.sort((o1, o2) -> o2.Power.compareTo(o1.Power));

    //This should show only top 10 factions on the server.

    for(Faction faction: factionsList)
    {
        if(faction.Name.equalsIgnoreCase("safezone") || faction.Name.equalsIgnoreCase("warzone")) continue;
        if(index == 11) break;

        index++;
        String tag = "";
        if(faction.Tag != null && !faction.Tag.equals("")) tag = "[" + faction.Tag + "] ";

        Text factionHelp = Text.builder()
                .append(Text.builder()
                        .append(Text.of(TextColors.AQUA, index + ". " + tag + faction.Name + " (" + faction.Power + "/" + PowerService.getFactionMaxPower(faction) + ")"))
                        .build())
                .build();

        helpList.add(factionHelp);
    }

    PaginationService paginationService = Sponge.getServiceManager().provide(PaginationService.class).get();
    PaginationList.Builder paginationBuilder = paginationService.builder().title(Text.of(TextColors.GREEN, "Factions List")).padding(Text.of("-")).contents(helpList);
    paginationBuilder.sendTo(source);

    return CommandResult.success();
}
 
开发者ID:Aquerr,项目名称:EagleFactions,代码行数:36,代码来源:TopCommand.java


示例19: getPaginationList

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
private static PaginationList getPaginationList() {
    final List<Text> contents = new ArrayList<>();

    contents.add(formatHelpText("/ip", "Displays basic information about IPLog.",
            Text.of("IPLog v0.2.0")));
    contents.add(formatHelpText("/ip help", "Displays this page, giving information about IPLog commands.",
            Text.of("Click here for IPLog help")));
    contents.add(formatHelpText("/ip alias [player]", "Shows all possible players associated with this player.",
            Text.of("Good for finding alternate accounts")));
    contents.add(formatHelpText("/ip lookup [player]", "Lists all the IPs associated with the specified player.",
            Text.of("Can also be used with IPs")));
    contents.add(formatHelpText("/ip lookup [ip]", "Lists all the players associated with the specified IP.",
            Text.of("Can also be used with users")));
    contents.add(formatHelpText("/ip history [player]", "Displays all IPs associated with a player and their last date of login",
            Text.of("Can also be used with IPs")));
    contents.add(formatHelpText("/ip history [ip]", "Displays all users associated with an IP and their last date of login",
            Text.of("Can also be used with users")));
    contents.add(formatHelpText("/ip add [player] [ip]", "Adds a connection between a player and an IP",
            Text.of("You must specify both")));
    contents.add(formatHelpText("/ip purge [player] [ip]", "Removes the connection between a player and an IP",
            Text.of("You must specify both")));

    return Sponge.getServiceManager().provide(PaginationService.class).get().builder()
            .title(Text.of(TextColors.DARK_GREEN, "IPLog Help"))
            .linesPerPage(14)
            .padding(Text.of(TextColors.GRAY, "="))
            .contents(contents)
            .build();
}
 
开发者ID:ichorpowered,项目名称:iplog,代码行数:30,代码来源:HelpCommand.java


示例20: onPostInit

import org.spongepowered.api.service.pagination.PaginationService; //导入依赖的package包/类
@Listener(order = Order.POST)
public void onPostInit(GamePostInitializationEvent event) {
    Optional<ProviderRegistration<PaginationService>> optService = Sponge.getGame().getServiceManager().getRegistration(PaginationService.class);
    if (optService.isPresent()) {
        PaginationService service = optService.get().getProvider();
        Sponge.getGame().getServiceManager().setProvider(this, PaginationService.class, new TabbedPaginationService(service));
    }
    this.features.load();
}
 
开发者ID:simon816,项目名称:ChatUI,代码行数:10,代码来源:ChatUI.java



注:本文中的org.spongepowered.api.service.pagination.PaginationService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Type类代码示例发布时间:2022-05-21
下一篇:
Java JWT类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap