1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-27 09:43:22 +01:00

Pagination for gtop command

This commit is contained in:
Zrips 2018-12-23 17:38:21 +02:00
parent 46e062d514
commit 24b1272304
2 changed files with 19 additions and 8 deletions

16
pom.xml
View File

@ -154,14 +154,14 @@
<target>1.7</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <!-- <plugin> -->
<groupId>org.apache.maven.plugins</groupId> <!-- <groupId>org.apache.maven.plugins</groupId> -->
<artifactId>maven-jar-plugin</artifactId> <!-- <artifactId>maven-jar-plugin</artifactId> -->
<version>2.3.1</version> <!-- <version>2.3.1</version> -->
<configuration> <!-- <configuration> -->
<outputDirectory>C:\Users\Arte\Desktop\Server 1.13\plugins</outputDirectory> <!-- <outputDirectory>C:\Users\Arte\Desktop\Server 1.13\plugins</outputDirectory> -->
</configuration> <!-- </configuration> -->
</plugin> <!-- </plugin> -->
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -61,6 +61,17 @@ public class gtop implements Cmd {
sender.sendMessage(Jobs.getLanguage().getMessage("command.gtop.output.list", "%number%", i, "%playername%", PlayerName, "%level%", One.getLevel(), sender.sendMessage(Jobs.getLanguage().getMessage("command.gtop.output.list", "%number%", i, "%playername%", PlayerName, "%level%", One.getLevel(),
"%exp%", One.getExp())); "%exp%", One.getExp()));
} }
int prev = page < 2 ? 1 : page - 1;
int next = page + 1;
RawMessage rm = new RawMessage();
rm.add(Jobs.getLanguage().getMessage("command.gtop.output.prev"),
Jobs.getLanguage().getMessage("command.gtop.output.show", "[from]", prev * showPageNum - showPageNum, "[until]", (prev * showPageNum)), "jobs gtop " + prev);
rm.add(Jobs.getLanguage().getMessage("command.gtop.output.next"),
Jobs.getLanguage().getMessage("command.gtop.output.show", "[from]", (next * showPageNum), "[until]", (next * showPageNum + showPageNum)), "jobs gtop " + next);
rm.show(player);
} else { } else {
List<String> ls = new ArrayList<>(); List<String> ls = new ArrayList<>();