1.0.0-SNAPSHOT-U184

+ Updated method variables to allow for VariablePanelHandler
+ Fixed imports on AutoSpawnCustomSettingsEditorPanel
This commit is contained in:
Charles 2019-01-07 20:27:04 +08:00
parent 039783663e
commit 5670fed1e9
5 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,7 @@
package com.songoda.epicbosses.autospawns;
import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction;
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
import java.util.List;
@ -11,6 +12,6 @@ import java.util.List;
*/
public interface IAutoSpawnCustomSettingsHandler {
List<ICustomSettingAction> getCustomSettingActions(AutoSpawn autoSpawn);
List<ICustomSettingAction> getCustomSettingActions(AutoSpawn autoSpawn, VariablePanelHandler<AutoSpawn> variablePanelHandler);
}

View File

@ -12,6 +12,7 @@ import com.songoda.epicbosses.holder.autospawn.ActiveIntervalAutoSpawnHolder;
import com.songoda.epicbosses.listeners.IBossDeathHandler;
import com.songoda.epicbosses.utils.*;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@ -88,7 +89,7 @@ public class IntervalSpawnHandler {
return Arrays.asList("&7Click here to update the location", "&7of this interval spawn section.", "&7", "&7This will ask you to put something in chat", "&7in the specific format of the new", "&7location.");
}
public ClickAction getPlaceholderAction(IntervalSpawnElement intervalSpawnElement) {
public ClickAction getPlaceholderAction(IntervalSpawnElement intervalSpawnElement, AutoSpawn autoSpawn, VariablePanelHandler<AutoSpawn> variablePanelHandler) {
return event -> {};
}

View File

@ -9,6 +9,7 @@ import com.songoda.epicbosses.managers.AutoSpawnManager;
import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction;
import com.songoda.epicbosses.utils.StringUtils;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
import lombok.Getter;
import lombok.Setter;
import org.bukkit.Location;
@ -38,12 +39,12 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler {
}
@Override
public List<ICustomSettingAction> getCustomSettingActions(AutoSpawn autoSpawn) {
public List<ICustomSettingAction> getCustomSettingActions(AutoSpawn autoSpawn, VariablePanelHandler<AutoSpawn> variablePanelHandler) {
List<ICustomSettingAction> clickActions = new ArrayList<>();
ItemStack clickStack = new ItemStack(Material.IRON_BLOCK);
ClickAction lastBossKilledAction = this.intervalSpawnHandler.getSpawnAfterLastBossIsKilledAction(this);
ClickAction locationAction = this.intervalSpawnHandler.getLocationAction(this);
ClickAction placeholderAction = this.intervalSpawnHandler.getPlaceholderAction(this);
ClickAction placeholderAction = this.intervalSpawnHandler.getPlaceholderAction(this, autoSpawn, variablePanelHandler);
ClickAction spawnRateAction = this.intervalSpawnHandler.getSpawnRateAction(this, autoSpawn);
clickActions.add(AutoSpawnManager.createAutoSpawnAction("Spawn After Last Boss Is Killed", getSpawnAfterLastBossIsKilled()+"", this.intervalSpawnHandler.getSpawnAfterLastBossIsKilledExtraInformation(), clickStack.clone(), lastBossKilledAction));

View File

@ -3,10 +3,8 @@ package com.songoda.epicbosses.panel.autospawns;
import com.songoda.epicbosses.CustomBosses;
import com.songoda.epicbosses.api.BossAPI;
import com.songoda.epicbosses.autospawns.AutoSpawn;
import com.songoda.epicbosses.managers.AutoSpawnManager;
import com.songoda.epicbosses.managers.BossPanelManager;
import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction;
import com.songoda.epicbosses.utils.ObjectUtils;
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
import com.songoda.epicbosses.utils.panel.Panel;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
@ -39,7 +37,7 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler<Aut
@Override
public void fillPanel(Panel panel, AutoSpawn autoSpawn) {
List<ICustomSettingAction> customButtons = autoSpawn.getIntervalSpawnData().getCustomSettingActions(autoSpawn);
List<ICustomSettingAction> customButtons = autoSpawn.getIntervalSpawnData().getCustomSettingActions(autoSpawn, this);
if(customButtons == null || customButtons.isEmpty()) return;

View File

@ -19,7 +19,7 @@
</modules>
<properties>
<plugin.version>1.0.0-U183</plugin.version>
<plugin.version>1.0.0-U184</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author>