mirror of
https://github.com/songoda/EpicBosses.git
synced 2024-12-23 08:27:49 +01:00
1.0.0-SNAPSHOT-U156
+ Fixed the issue with the NewPosition button on GiveRewardRewardsListPanel
This commit is contained in:
parent
7bb452020a
commit
b4b9f4bf72
@ -135,19 +135,20 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler<DropT
|
||||
|
||||
private ClickAction getNewRewardSectionAction(DropTable dropTable, GiveTableElement giveTableElement, String key) {
|
||||
return event -> {
|
||||
Map<String, Map<String, GiveTableSubElement>> rewards = giveTableElement.getGiveRewards();
|
||||
Map<String, GiveTableSubElement> rewardSections = rewards.get(key);
|
||||
List<String> keys = new ArrayList<>(giveTableElement.getGiveRewards().keySet());
|
||||
Map<String, Map<String, GiveTableSubElement>> rewardSections = giveTableElement.getGiveRewards();
|
||||
Map<String, GiveTableSubElement> rewards = rewardSections.get(key);
|
||||
List<String> keys = new ArrayList<>(rewards.keySet());
|
||||
int nextAvailable = NumberUtils.get().getNextAvailablePosition(keys);
|
||||
String nextKey = ""+nextAvailable;
|
||||
|
||||
if(rewardSections.containsKey(nextKey)) {
|
||||
if(rewards.containsKey(nextKey)) {
|
||||
Debug.FAILED_TO_CREATE_NEWPOSITION.debug(nextKey, BossAPI.getDropTableName(dropTable));
|
||||
return;
|
||||
}
|
||||
|
||||
rewardSections.put(nextKey, new GiveTableSubElement(new HashMap<>(), new HashMap<>(), 3, 3, false, false, 0.0));
|
||||
giveTableElement.setGiveRewards(rewards);
|
||||
rewards.put(nextKey, new GiveTableSubElement(new HashMap<>(), new HashMap<>(), 3, 3, false, false, 0.0));
|
||||
rewardSections.put(key, rewards);
|
||||
giveTableElement.setGiveRewards(rewardSections);
|
||||
saveDropTable((Player) event.getWhoClicked(), dropTable, giveTableElement, key);
|
||||
};
|
||||
}
|
||||
|
2
pom.xml
2
pom.xml
@ -20,7 +20,7 @@
|
||||
|
||||
<properties>
|
||||
<!--<plugin.version>maven-version-number-SNAPSHOT-U90</plugin.version>-->
|
||||
<plugin.version>1.0.0-U155</plugin.version>
|
||||
<plugin.version>1.0.0-U156</plugin.version>
|
||||
<plugin.name>EpicBosses</plugin.name>
|
||||
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
|
||||
<plugin.author>AMinecraftDev</plugin.author>
|
||||
|
Loading…
Reference in New Issue
Block a user