1.0.0-SNAPSHOT-U154

+ Fixed issue with pages not being loaded in the RewardPositionListPanel
This commit is contained in:
Charles 2018-12-31 00:18:10 +08:00
parent 3078389e74
commit c9b4fe0ca5
3 changed files with 36 additions and 2 deletions

View File

@ -49,6 +49,14 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler<DropTab
List<String> keys = new ArrayList<>(rewardSections.keySet());
int maxPage = panel.getMaxPage(keys);
panel.setOnPageChange(((player, currentPage, requestedPage) -> {
if(requestedPage < 0 || requestedPage > maxPage) return false;
loadPage(panel, requestedPage, dropTable, giveTableElement, keys, rewardSections);
return true;
}));
loadPage(panel, 0, dropTable, giveTableElement, keys, rewardSections);
}
@Override

View File

@ -1,9 +1,35 @@
package com.songoda.epicbosses.panel.droptables.types.give;
import com.songoda.epicbosses.CustomBosses;
import com.songoda.epicbosses.droptable.DropTable;
import com.songoda.epicbosses.droptable.elements.GiveTableElement;
import com.songoda.epicbosses.managers.BossPanelManager;
import com.songoda.epicbosses.utils.panel.base.handlers.SubSubVariablePanelHandler;
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
import org.bukkit.entity.Player;
/**
* @author Charles Cullen
* @version 1.0.0
* @since 31-Dec-18
*/
public class GiveRewardRewardsListPanel {
public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler<DropTable, GiveTableElement, String> {
private CustomBosses plugin;
public GiveRewardRewardsListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) {
super(bossPanelManager, panelBuilder);
this.plugin = plugin;
}
@Override
public void openFor(Player player, DropTable dropTable, GiveTableElement giveTableElement, String s) {
}
@Override
public void initializePanel(PanelBuilder panelBuilder) {
}
}

View File

@ -20,7 +20,7 @@
<properties>
<!--<plugin.version>maven-version-number-SNAPSHOT-U90</plugin.version>-->
<plugin.version>1.0.0-U153</plugin.version>
<plugin.version>1.0.0-U154</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author>