1.0.0-SNAPSHOT-U82

+ Fixed issues with skill chance menu
This commit is contained in:
Charles 2018-11-25 22:27:46 +08:00
parent f220a769fe
commit 478183508f
2 changed files with 9 additions and 1 deletions

View File

@ -35,8 +35,12 @@ public class SkillMainEditorPanel extends VariablePanelHandler<BossEntity> {
@Override
public void openFor(Player player, BossEntity bossEntity) {
Map<String, String> replaceMap = new HashMap<>();
Double chance = bossEntity.getSkills().getOverallChance();
if(chance == null) chance = 0.0;
replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity));
replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance));
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
@ -92,6 +96,10 @@ public class SkillMainEditorPanel extends VariablePanelHandler<BossEntity> {
newChance = 0.0;
}
if(newChance > 100.0) {
newChance = 100.0;
}
bossEntity.getSkills().setOverallChance(newChance);
Message.Boss_Skill_SetChance.msg(event.getWhoClicked(), modifyValue, NumberUtils.get().formatDouble(newChance));
openFor((Player) event.getWhoClicked(), bossEntity);

View File

@ -19,7 +19,7 @@
</modules>
<properties>
<plugin.version>maven-version-number-SNAPSHOT-U81</plugin.version>
<plugin.version>maven-version-number-SNAPSHOT-U82</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author>