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:
parent
46e062d514
commit
24b1272304
16
pom.xml
16
pom.xml
@ -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>
|
||||
|
@ -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<>();
|
||||
|
Loading…
Reference in New Issue
Block a user