sendPlayerSchematicList() rework
Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
5c56e47732
Commit
ba8f3e224a
@ -72,16 +72,31 @@ public class WorldEdit {
|
|||||||
File[] listOfFiles = folder.listFiles();
|
File[] listOfFiles = folder.listFiles();
|
||||||
|
|
||||||
int pages = listOfFiles.length / filesPerPage;
|
int pages = listOfFiles.length / filesPerPage;
|
||||||
|
int currPage = currentPage;
|
||||||
|
if(currPage > pages) {
|
||||||
|
currPage = 0;
|
||||||
|
}
|
||||||
|
|
||||||
for(int i = listOfFiles.length; i <= (currentPage * 10) + 10; i++) {
|
for(int i = currPage * filesPerPage; i < (currPage * filesPerPage) + filesPerPage; i++) {
|
||||||
player.sendMessage(listOfFiles[i].toString());
|
|
||||||
|
|
||||||
TextComponent message = new TextComponent(listOfFiles[i].toString());
|
TextComponent schematics = new TextComponent(listOfFiles[i].toString());
|
||||||
message.setColor(ChatColor.AQUA);
|
schematics.setColor(ChatColor.AQUA);
|
||||||
message.setBold(true);
|
schematics.setBold(true);
|
||||||
|
|
||||||
|
schematics.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Schematic benutzen...").create()));
|
||||||
|
schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "")); //COMMAND MISSING
|
||||||
|
|
||||||
|
player.spigot().sendMessage(schematics);
|
||||||
|
|
||||||
|
|
||||||
|
TextComponent nextPage = new TextComponent("Naechste Seite");
|
||||||
|
nextPage.setColor(ChatColor.RED);
|
||||||
|
|
||||||
|
nextPage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Naechste Seite...").create()));
|
||||||
|
nextPage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "")); //COMMAND MISSING
|
||||||
|
|
||||||
|
player.spigot().sendMessage(nextPage);
|
||||||
|
|
||||||
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Schematic benutzen...").create()));
|
|
||||||
message.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "")); //COMMAND MISSING
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren