diff --git a/plugin-modules/Core/pom.xml b/plugin-modules/Core/pom.xml index 674d3fb..ed7aa51 100644 --- a/plugin-modules/Core/pom.xml +++ b/plugin-modules/Core/pom.xml @@ -46,7 +46,7 @@ - ${parent.artifactId}-${plugin.version} + ${parent.artifactId}-${plugin.version} (1.13.x) org.apache.maven.plugins @@ -82,24 +82,24 @@ - - org.apache.maven.plugins - maven-antrun-plugin - 1.8 - - - install - - - - - - - run - - - - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java index b963531..437f315 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java @@ -66,9 +66,11 @@ public class BossShopPriceHandler implements IHandler { event.setCancelled(true); if(NumberUtils.get().isDouble(input)) { - getBossEntity().setPrice(NumberUtils.get().getDouble(input)); + double amount = NumberUtils.get().getDouble(input); + getBossEntity().setPrice(amount); getBossesFileManager().save(); setHandled(true); + Message.Boss_Edit_PriceSet.msg(getPlayer(), BossAPI.getBossEntityName(getBossEntity()), NumberUtils.get().formatDouble(amount)); finish(); } else { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java index 579b46a..11f8022 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java @@ -102,7 +102,7 @@ public class BossPanelManager implements ILoadable, IReloadable { @Getter private ISubVariablePanelHandler statisticMainEditMenu, entityTypeEditMenu; @Getter private IVariablePanelHandler mainBossEditMenu, dropsEditMenu, targetingEditMenu, skillsBossEditMenu, skillListBossEditMenu, commandsMainEditMenu, onSpawnCommandEditMenu, onDeathCommandEditMenu, mainDropsEditMenu, mainTextEditMenu, mainTauntEditMenu, onSpawnTextEditMenu, onSpawnSubTextEditMenu, onDeathTextEditMenu, onDeathSubTextEditMenu, onDeathPositionTextEditMenu, - onTauntTextEditMenu, spawnItemEditMenu, bossShopEditMenu; + onTauntTextEditMenu, spawnItemEditMenu, bossShopEditMenu, bossSkillMasterMessageTextEditMenu; @Getter private BossListEditorPanel equipmentListEditMenu, weaponListEditMenu, statisticListEditMenu; @Getter private IVariablePanelHandler mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel; @@ -461,6 +461,7 @@ public class BossPanelManager implements ILoadable, IReloadable { PanelBuilder panelBuilder3 = new PanelBuilder(editor.getConfigurationSection("TauntEditorPanel")); this.mainTextEditMenu = new TextMainEditorPanel(this, panelBuilder); + this.bossSkillMasterMessageTextEditMenu = new SkillMasterMessageTextEditorPanel(this, getListMenu("Boss.Text"), this.customBosses); this.onSpawnSubTextEditMenu = new SpawnTextEditorPanel(this, panelBuilder1, this.customBosses); this.onDeathSubTextEditMenu = new DeathTextEditorPanel(this, panelBuilder2, this.customBosses); this.mainTauntEditMenu = new TauntTextEditorPanel(this, panelBuilder3, this.customBosses); @@ -566,6 +567,7 @@ public class BossPanelManager implements ILoadable, IReloadable { PanelBuilder panelBuilder3 = new PanelBuilder(editor.getConfigurationSection("TauntEditorPanel")); this.mainTextEditMenu.initializePanel(panelBuilder); + this.bossSkillMasterMessageTextEditMenu.initializePanel(getListMenu("Boss.Text")); this.onSpawnSubTextEditMenu.initializePanel(panelBuilder1); this.onDeathSubTextEditMenu.initializePanel(panelBuilder2); this.mainTauntEditMenu.initializePanel(panelBuilder3); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java index 1360a8e..783d31c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java @@ -94,6 +94,8 @@ public class MainBossEditPanel extends VariablePanelHandler { if(bossEntity.isEditing()) { this.bossEntityManager.killAllHolders(bossEntity); } + + openFor(player, bossEntity); } else { List incompleteThings = bossEntity.getIncompleteSectionsToEnable(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java index dc8aa52..07dd0b4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java @@ -61,7 +61,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler { ServerUtils.get().runTaskAsync(() -> { counter.getSlotsWith("OverallChance").forEach(slot -> panel.setOnClick(slot, getOverallChanceAction(bossEntity))); counter.getSlotsWith("SkillList").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getSkillListBossEditMenu().openFor((Player) event.getWhoClicked(), bossEntity))); - counter.getSlotsWith("Message").forEach(slot -> panel.setOnClick(slot, getMessageAction())); + counter.getSlotsWith("Message").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getBossSkillMasterMessageTextEditMenu().openFor((Player) event.getWhoClicked(), bossEntity))); }); panel.openFor(player); @@ -113,9 +113,4 @@ public class SkillMainEditorPanel extends VariablePanelHandler { openFor((Player) event.getWhoClicked(), bossEntity); }; } - - //TODO - private ClickAction getMessageAction() { - return event -> {}; - } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SkillMasterMessageTextEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SkillMasterMessageTextEditorPanel.java new file mode 100644 index 0000000..4352aef --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SkillMasterMessageTextEditorPanel.java @@ -0,0 +1,41 @@ +package com.songoda.epicbosses.panel.bosses.text; + +import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.api.BossAPI; +import com.songoda.epicbosses.entity.BossEntity; +import com.songoda.epicbosses.managers.BossPanelManager; +import com.songoda.epicbosses.panel.handlers.SingleMessageListEditor; +import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler; +import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 20-Jan-19 + */ +public class SkillMasterMessageTextEditorPanel extends SingleMessageListEditor { + + public SkillMasterMessageTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + super(bossPanelManager, panelBuilder, plugin); + } + + @Override + public String getCurrent(BossEntity object) { + return object.getSkills().getMasterMessage(); + } + + @Override + public void updateMessage(BossEntity object, String newPath) { + object.getSkills().setMasterMessage(newPath); + } + + @Override + public IVariablePanelHandler getParentHolder() { + return this.bossPanelManager.getSkillsBossEditMenu(); + } + + @Override + public String getName(BossEntity object) { + return BossAPI.getBossEntityName(object); + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java index 2162c37..d782873 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java @@ -67,6 +67,7 @@ public enum Message { Boss_Edit_NotCompleteEnough("&c&l(!) &cThe boss is not set up enough to be enabled. Please make sure it has the following things: &f{0}&c Once these things are set try toggling again."), Boss_Edit_DoesntExist("&c&l(!) &cThe specified boss does not exist. Please try again with the proper name. If you cannot figure it out please check the bosses.json file to find the one you're looking for."), Boss_Edit_Price("&b&lEpicBosses &8» &7Please input the new price of the &f{0}&7 Boss Entity. Please do not add commas and only use numbers. To cancel this input in to chat &f- &7."), + Boss_Edit_PriceSet("&b&lEpicBosses &8» &7You have set the price of &f{0}&7 to &a$&f{1}&7."), Boss_GiveEgg_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_GiveEgg_InvalidArgs("&c&l(!) &cYou must use &n/boss giveegg [name] [player] (amount)&c to give an egg."), diff --git a/pom.xml b/pom.xml index b5032b9..6754ea4 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ - 1.0.0-U202 + 1.0.0-U203 EpicBosses com.songoda.epicbosses.CustomBosses AMinecraftDev