From ad42dd9e8d3d136fc5bf4257baf680465841948b Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 7 Jan 2019 04:41:01 +0800 Subject: [PATCH] 1.0.0-SNAPSHOT-U178 + Connected MainAutoSpawnEditor to the rest of the panel + Updated TODO with more accurate time frame + Connected and set up auto spawn editing in BossPanelManager --- TODO | 4 +-- .../epicbosses/managers/BossPanelManager.java | 25 ++++++++++++++++++- .../autospawns/MainAutoSpawnEditorPanel.java | 7 +++--- pom.xml | 2 +- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 0562c02..c7308b6 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,10 @@ -02:00 -> Add the AutoSpawns Editing GUI (with a button for toggling the type of the autospawn, from wilderness, to spawner, to interval and a button for editing data) +01:00 -> Add the AutoSpawns Editing GUI (with a button for toggling the type of the autospawn, from wilderness, to spawner, to interval and a button for editing data) 01:00 -> Interval - Button to change coords, list of possible spawns, spawnIfChunkIsntLoaded, maxActiveBosses, bossesPerInterval, spawnRate, spawnType (Interval or Random), placeholder, message 00:30 -> Add HolographicDisplay/PlaceholderAPI support for custom placeholders on AutoSpawnInterval times 01:00 -> Add a new branch for the plugin and add support for Legacy version ----------- -4:30 hrs +3:30 hrs 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 a0534b3..2808601 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java @@ -10,6 +10,7 @@ import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.entity.elements.EquipmentElement; import com.songoda.epicbosses.entity.elements.HandsElement; +import com.songoda.epicbosses.panel.autospawns.MainAutoSpawnEditorPanel; import com.songoda.epicbosses.panel.bosses.*; import com.songoda.epicbosses.panel.bosses.commands.OnDeathCommandEditor; import com.songoda.epicbosses.panel.bosses.commands.OnSpawnCommandEditor; @@ -128,7 +129,7 @@ public class BossPanelManager implements ILoadable, IReloadable { @Getter private DropTableNewRewardEditorPanel dropDropNewRewardEditPanel; @Getter private DropTableRewardsListEditorPanel dropDropRewardListPanel; - @Getter private IVariablePanelHandler mainAutoSpawnEditPanel; + @Getter private IVariablePanelHandler mainAutoSpawnEditPanel, autoSpawnEntitiesEditPanel, autoSpawnSpecialSettingsEditorPanel, autoSpawnTypeEditorPanel; private final CustomBosses customBosses; @@ -162,6 +163,7 @@ public class BossPanelManager implements ILoadable, IReloadable { loadSkillEditMenus(); loadDropTableEditMenus(); + loadAutoSpawnEditMenus(); } @Override @@ -190,6 +192,7 @@ public class BossPanelManager implements ILoadable, IReloadable { reloadSkillEditMenus(); reloadDropTableEditMenus(); + reloadAutoSpawnEditMenus(); } public int isItemStackUsed(String name) { @@ -233,6 +236,26 @@ public class BossPanelManager implements ILoadable, IReloadable { return new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("ListPanel"), replaceMap); } + //--------------------------------------------- + // + // A U T O S P A W N E D I T P A N E L S + // + //--------------------------------------------- + + private void loadAutoSpawnEditMenus() { + FileConfiguration editor = this.customBosses.getEditor(); + PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("MainAutoSpawnEditMenu")); + + this.mainAutoSpawnEditPanel = new MainAutoSpawnEditorPanel(this, panelBuilder, this.customBosses); + } + + private void reloadAutoSpawnEditMenus() { + FileConfiguration editor = this.customBosses.getEditor(); + PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("MainAutoSpawnEditMenu")); + + this.mainAutoSpawnEditPanel.initializePanel(panelBuilder); + } + //--------------------------------------------- // // D R O P T A B L E E D I T P A N E L S diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java index e677360..70bbeba 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java @@ -20,7 +20,6 @@ import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter; import org.bukkit.entity.Player; import java.util.HashMap; -import java.util.List; import java.util.Map; /** @@ -63,9 +62,9 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler { PanelBuilderCounter counter = panel.getPanelBuilderCounter(); counter.getSlotsWith("Editing").forEach(slot -> panel.setOnClick(slot, getEditingAction(autoSpawn))); - counter.getSlotsWith("SpecialSettings").forEach(slot -> {}); - counter.getSlotsWith("Type").forEach(slot -> {}); - counter.getSlotsWith("Entities").forEach(slot -> {}); + counter.getSlotsWith("SpecialSettings").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAutoSpawnSpecialSettingsEditorPanel().openFor(player, autoSpawn))); + counter.getSlotsWith("Type").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAutoSpawnTypeEditorPanel().openFor(player, autoSpawn))); + counter.getSlotsWith("Entities").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAutoSpawnEntitiesEditPanel().openFor(player, autoSpawn))); counter.getSlotsWith("CustomSettings").forEach(slot -> {}); panel.openFor(player); diff --git a/pom.xml b/pom.xml index 14d02fe..6bd1715 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ - 1.0.0-U177 + 1.0.0-U178 EpicBosses com.songoda.epicbosses.CustomBosses AMinecraftDev