mirror of
https://github.com/songoda/EpicBosses.git
synced 2024-12-23 16:38:52 +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) {
|
private ClickAction getNewRewardSectionAction(DropTable dropTable, GiveTableElement giveTableElement, String key) {
|
||||||
return event -> {
|
return event -> {
|
||||||
Map<String, Map<String, GiveTableSubElement>> rewards = giveTableElement.getGiveRewards();
|
Map<String, Map<String, GiveTableSubElement>> rewardSections = giveTableElement.getGiveRewards();
|
||||||
Map<String, GiveTableSubElement> rewardSections = rewards.get(key);
|
Map<String, GiveTableSubElement> rewards = rewardSections.get(key);
|
||||||
List<String> keys = new ArrayList<>(giveTableElement.getGiveRewards().keySet());
|
List<String> keys = new ArrayList<>(rewards.keySet());
|
||||||
int nextAvailable = NumberUtils.get().getNextAvailablePosition(keys);
|
int nextAvailable = NumberUtils.get().getNextAvailablePosition(keys);
|
||||||
String nextKey = ""+nextAvailable;
|
String nextKey = ""+nextAvailable;
|
||||||
|
|
||||||
if(rewardSections.containsKey(nextKey)) {
|
if(rewards.containsKey(nextKey)) {
|
||||||
Debug.FAILED_TO_CREATE_NEWPOSITION.debug(nextKey, BossAPI.getDropTableName(dropTable));
|
Debug.FAILED_TO_CREATE_NEWPOSITION.debug(nextKey, BossAPI.getDropTableName(dropTable));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rewardSections.put(nextKey, new GiveTableSubElement(new HashMap<>(), new HashMap<>(), 3, 3, false, false, 0.0));
|
rewards.put(nextKey, new GiveTableSubElement(new HashMap<>(), new HashMap<>(), 3, 3, false, false, 0.0));
|
||||||
giveTableElement.setGiveRewards(rewards);
|
rewardSections.put(key, rewards);
|
||||||
|
giveTableElement.setGiveRewards(rewardSections);
|
||||||
saveDropTable((Player) event.getWhoClicked(), dropTable, giveTableElement, key);
|
saveDropTable((Player) event.getWhoClicked(), dropTable, giveTableElement, key);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
2
pom.xml
2
pom.xml
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!--<plugin.version>maven-version-number-SNAPSHOT-U90</plugin.version>-->
|
<!--<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.name>EpicBosses</plugin.name>
|
||||||
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
|
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
|
||||||
<plugin.author>AMinecraftDev</plugin.author>
|
<plugin.author>AMinecraftDev</plugin.author>
|
||||||
|
Loading…
Reference in New Issue
Block a user