Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
SPIGOT-783: API for book generation data.
Dieser Commit ist enthalten in:
Ursprung
dd0e968c6a
Commit
cee5bbf00c
@ -199,6 +199,16 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
|
|||||||
this.author = author;
|
this.author = author;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Generation getGeneration() {
|
||||||
|
return (generation == null) ? null : Generation.values()[generation];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGeneration(Generation generation) {
|
||||||
|
this.generation = (generation == null) ? null : generation.ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
public String getPage(final int page) {
|
public String getPage(final int page) {
|
||||||
Validate.isTrue(isValidPage(page), "Invalid page number");
|
Validate.isTrue(isValidPage(page), "Invalid page number");
|
||||||
return CraftChatMessage.fromComponent(pages.get(page - 1));
|
return CraftChatMessage.fromComponent(pages.get(page - 1));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren