Skip to content

Commit 80d1c76

Browse files
committed
Add placeholders for total and current pages in BInventory
1 parent 0df8cc6 commit 80d1c76

File tree

1 file changed

+2
-1
lines changed
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/inventory

1 file changed

+2
-1
lines changed

AdvancedCore/src/main/java/com/bencodez/advancedcore/api/inventory/BInventory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ public BInventory addPlaceholder(String toReplace, String replaceWith) {
277277
return this;
278278
}
279279

280-
@SuppressWarnings("rawtypes")
281280
public void addUpdatingButton(AdvancedCorePlugin plugin, long delay, long interval, Runnable runnable) {
282281
if (futures == null) {
283282
futures = new ArrayList<>();
@@ -575,6 +574,7 @@ public void openInventory(Player player) {
575574
if (getHighestSlot() % (maxInvSize - 9) != 0) {
576575
maxPage++;
577576
}
577+
addPlaceholder("totalpages", "" + maxPage);
578578
openInventory(player, 1);
579579
}
580580

@@ -588,6 +588,7 @@ public void openInventory(Player player) {
588588
*/
589589
public void openInventory(Player player, int page) {
590590
BInventory inventory = this;
591+
addPlaceholder("currentpage", "" + page);
591592
inv = Bukkit.createInventory(new GUISession(this, page), maxInvSize, PlaceholderUtils.replaceJavascript(player,
592593
PlaceholderUtils.replacePlaceHolder(inventory.getInventoryName(), getPlaceholders())));
593594
this.page = page;

0 commit comments

Comments
 (0)