When using the page reward type in the pagelayout.yml file, you can never switch to the final page when using the actual page value (e.g. 3, 4) - it switches to the page before that instead.
Rather than using getHighestPage (which would return 3 in this scenario), getDisplayHighestPage should be used in this scenario. I did also test it in my own environment with that method instead, and that fixed the problem. I did test the fix with an erroneous input as well (page 5 when there were only 4 pages) and the plugin responded fine.
If required I can open a pull request for this but this is a tiny fix I'm sure can also be done yourself, I just wanted to highlight the actual cause (since I'm like that, unfortunately for a lot of people ;) ).
When using the page reward type in the pagelayout.yml file, you can never switch to the final page when using the actual page value (e.g. 3, 4) - it switches to the page before that instead.
Files used to reproduce:
menu.yml - https://pastebin.com/2zCv8r25 buy-menu.yml - https://pastebin.com/TSs12q5Q pagelayout.yml - https://pastebin.com/0qJYDhAm
The line of code that I suspect to cause this is the following:
https://github.com/Blackixx/BossShopPro/blob/b8ebbfc58c8849b42152d4acc8d3879abde42b4a/src/main/java/org/black_ixx/bossshop/core/rewards/BSRewardTypeShopPage.java#L74
Rather than using getHighestPage (which would return 3 in this scenario), getDisplayHighestPage should be used in this scenario. I did also test it in my own environment with that method instead, and that fixed the problem. I did test the fix with an erroneous input as well (page 5 when there were only 4 pages) and the plugin responded fine.
If required I can open a pull request for this but this is a tiny fix I'm sure can also be done yourself, I just wanted to highlight the actual cause (since I'm like that, unfortunately for a lot of people ;) ).
Thanks in advance!