Fix a couple of ItemMeta related NPEs (#11149)
This commit is contained in:
@@ -4927,15 +4927,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ @Override
|
||||
+ public net.kyori.adventure.text.Component page(final int page) {
|
||||
+ Preconditions.checkArgument(this.isValidPage(page), "Invalid page number");
|
||||
+ Preconditions.checkArgument(this.isValidPage(page), "Invalid page number (%s/%s)", page, this.getPageCount());
|
||||
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(this.pages.get(page - 1));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void page(final int page, net.kyori.adventure.text.Component data) {
|
||||
+ if (!this.isValidPage(page)) {
|
||||
+ throw new IllegalArgumentException("Invalid page number " + page + "/" + this.pages.size());
|
||||
+ }
|
||||
+ Preconditions.checkArgument(this.isValidPage(page), "Invalid page number (%s/%s)", page, this.getPageCount());
|
||||
+ if (data == null) {
|
||||
+ data = net.kyori.adventure.text.Component.empty();
|
||||
+ }
|
||||
@@ -5120,15 +5118,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ @Override
|
||||
+ public net.kyori.adventure.text.Component page(final int page) {
|
||||
+ Preconditions.checkArgument(this.isValidPage(page), "Invalid page number");
|
||||
+ Preconditions.checkArgument(this.isValidPage(page), "Invalid page number (%s/%s)", page, this.getPageCount());
|
||||
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.pages.get(page - 1));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void page(final int page, net.kyori.adventure.text.Component data) {
|
||||
+ if (!this.isValidPage(page)) {
|
||||
+ throw new IllegalArgumentException("Invalid page number " + page + "/" + this.pages.size());
|
||||
+ }
|
||||
+ Preconditions.checkArgument(this.isValidPage(page), "Invalid page number (%s/%s)", page, this.getPageCount());
|
||||
+ this.pages.set(page - 1, io.papermc.paper.adventure.PaperAdventure.asVanillaNullToEmpty(data));
|
||||
+ }
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user