1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 05:55:27 +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>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>C:\Users\Arte\Desktop\Server 1.13\plugins</outputDirectory>
</configuration>
</plugin>
<!-- <plugin> -->
<!-- <groupId>org.apache.maven.plugins</groupId> -->
<!-- <artifactId>maven-jar-plugin</artifactId> -->
<!-- <version>2.3.1</version> -->
<!-- <configuration> -->
<!-- <outputDirectory>C:\Users\Arte\Desktop\Server 1.13\plugins</outputDirectory> -->
<!-- </configuration> -->
<!-- </plugin> -->
</plugins>
</build>
</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(),
"%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 {
List<String> ls = new ArrayList<>();