mirror of
https://github.com/songoda/EpicBosses.git
synced 2024-06-26 14:44:58 +02:00
1.0.0-SNAPSHOT-U194
+ Added /Boss New AutoSpawn command + Made all the panel opening Async to remove any lag from spam button clicking + Connected AutoSpawn right click in MainMenu to the /boss new autospawn command + Connected DropTable Editing Button in the DropsEditorPanel
This commit is contained in:
parent
0dc48bf1ea
commit
d0e2dd008d
|
@ -4,6 +4,8 @@ import com.google.gson.JsonObject;
|
|||
import com.google.gson.JsonParser;
|
||||
import com.songoda.epicbosses.CustomBosses;
|
||||
import com.songoda.epicbosses.autospawns.AutoSpawn;
|
||||
import com.songoda.epicbosses.autospawns.settings.AutoSpawnSettings;
|
||||
import com.songoda.epicbosses.autospawns.types.IntervalSpawnElement;
|
||||
import com.songoda.epicbosses.droptable.DropTable;
|
||||
import com.songoda.epicbosses.droptable.elements.DropTableElement;
|
||||
import com.songoda.epicbosses.droptable.elements.GiveTableElement;
|
||||
|
@ -433,6 +435,28 @@ public class BossAPI {
|
|||
return minionEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to create a new base auto spawn
|
||||
* with the specified arguments.
|
||||
*
|
||||
* @param name - name of the auto spawn.
|
||||
* @return an instance of the auto spawn if successful
|
||||
*/
|
||||
public static AutoSpawn createBaseAutoSpawn(String name) {
|
||||
if(PLUGIN.getAutoSpawnFileManager().getAutoSpawn(name) != null) {
|
||||
Debug.AUTOSPAWN_NAME_EXISTS.debug(name);
|
||||
return null;
|
||||
}
|
||||
|
||||
IntervalSpawnElement intervalSpawnElement = new IntervalSpawnElement("world,0,100,0", "{boss_" + name + "}", 30, false);
|
||||
AutoSpawn autoSpawn = new AutoSpawn(true, new ArrayList<>(), new AutoSpawnSettings(1, 1, false, false));
|
||||
|
||||
autoSpawn.setCustomData(BossAPI.convertObjectToJsonObject(intervalSpawnElement));
|
||||
PLUGIN.getAutoSpawnFileManager().saveAutoSpawn(name, autoSpawn);
|
||||
|
||||
return autoSpawn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to spawn a new active boss for the
|
||||
* specified bossEntity.
|
||||
|
|
|
@ -4,19 +4,13 @@ import com.google.gson.JsonObject;
|
|||
import com.songoda.epicbosses.CustomBosses;
|
||||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.autospawns.AutoSpawn;
|
||||
import com.songoda.epicbosses.autospawns.settings.AutoSpawnSettings;
|
||||
import com.songoda.epicbosses.autospawns.types.IntervalSpawnElement;
|
||||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.handlers.AutoSpawnVariableHandler;
|
||||
import com.songoda.epicbosses.handlers.variables.AutoSpawnLocationVariableHandler;
|
||||
import com.songoda.epicbosses.handlers.variables.AutoSpawnPlaceholderVariableHandler;
|
||||
import com.songoda.epicbosses.holder.ActiveBossHolder;
|
||||
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;
|
||||
|
||||
|
|
|
@ -2,13 +2,12 @@ package com.songoda.epicbosses.commands.boss;
|
|||
|
||||
import com.songoda.epicbosses.CustomBosses;
|
||||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.autospawns.AutoSpawn;
|
||||
import com.songoda.epicbosses.autospawns.SpawnType;
|
||||
import com.songoda.epicbosses.droptable.DropTable;
|
||||
import com.songoda.epicbosses.managers.BossDropTableManager;
|
||||
import com.songoda.epicbosses.managers.BossSkillManager;
|
||||
import com.songoda.epicbosses.managers.files.CommandsFileManager;
|
||||
import com.songoda.epicbosses.managers.files.DropTableFileManager;
|
||||
import com.songoda.epicbosses.managers.files.MessagesFileManager;
|
||||
import com.songoda.epicbosses.managers.files.SkillsFileManager;
|
||||
import com.songoda.epicbosses.managers.files.*;
|
||||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.SkillMode;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
|
@ -28,9 +27,11 @@ import java.util.List;
|
|||
* boss new skill [name] [type] [mode]
|
||||
* boss new command [name] [commands]
|
||||
* boss new message [name] [message]
|
||||
* boss new autospawn [name] [type]
|
||||
*/
|
||||
public class BossNewCmd extends SubCommand {
|
||||
|
||||
private AutoSpawnFileManager autoSpawnFileManager;
|
||||
private DropTableFileManager dropTableFileManager;
|
||||
private BossDropTableManager bossDropTableManager;
|
||||
private MessagesFileManager messagesFileManager;
|
||||
|
@ -47,6 +48,7 @@ public class BossNewCmd extends SubCommand {
|
|||
this.bossDropTableManager = plugin.getBossDropTableManager();
|
||||
this.messagesFileManager = plugin.getBossMessagesFileManager();
|
||||
this.commandsFileManager = plugin.getBossCommandFileManager();
|
||||
this.autoSpawnFileManager = plugin.getAutoSpawnFileManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,6 +58,29 @@ public class BossNewCmd extends SubCommand {
|
|||
return;
|
||||
}
|
||||
|
||||
//--------------------
|
||||
// A U T O S P A W N
|
||||
//--------------------
|
||||
if(args.length == 4 && args[1].equalsIgnoreCase("autospawn")) {
|
||||
String nameInput = args[2];
|
||||
|
||||
if(this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) {
|
||||
Message.Boss_New_AlreadyExists.msg(sender, "AutoSpawn");
|
||||
return;
|
||||
}
|
||||
|
||||
AutoSpawn autoSpawn = BossAPI.createBaseAutoSpawn(nameInput);
|
||||
|
||||
if(autoSpawn == null) {
|
||||
Message.Boss_New_SomethingWentWrong.msg(sender, "AutoSpawn");
|
||||
} else {
|
||||
Message.Boss_New_AutoSpawn.msg(sender, nameInput);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//-------------------
|
||||
// C O M M A N D
|
||||
//-------------------
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.songoda.epicbosses.CustomBosses;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.PanelHandler;
|
||||
|
@ -50,6 +51,7 @@ public class AddItemsPanel extends PanelHandler {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Panel panel = getPanelBuilder().getPanel()
|
||||
.setDestroyWhenDone(true)
|
||||
.setCancelClick(true)
|
||||
|
@ -76,6 +78,7 @@ public class AddItemsPanel extends PanelHandler {
|
|||
});
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
private ClickAction getSelectedSlotAction(PanelBuilderCounter panelBuilderCounter) {
|
||||
|
|
|
@ -52,6 +52,7 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler<BossEntity, E
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity, EntityStatsElement entityStatsElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -67,6 +68,7 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler<BossEntity, E
|
|||
fillPanel(panel, bossEntity, entityStatsElement);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -81,7 +81,7 @@ public class MainMenuPanel extends PanelHandler {
|
|||
if(event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) {
|
||||
this.bossPanelManager.getAutoSpawns().openFor(player);
|
||||
} else if(event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) {
|
||||
//TODO: Set up create auto spawn command
|
||||
Message.Boss_New_CreateArgumentsAutoSpawn.msg(event.getWhoClicked());
|
||||
player.closeInventory();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.songoda.epicbosses.autospawns.AutoSpawn;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
|
@ -57,6 +58,7 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler<Aut
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, AutoSpawn autoSpawn) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
|
@ -68,6 +70,7 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler<Aut
|
|||
|
||||
fillPanel(panel, autoSpawn);
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.songoda.epicbosses.managers.files.BossesFileManager;
|
|||
import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ObjectUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
|
@ -63,6 +64,7 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler<AutoSpawn
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, AutoSpawn autoSpawn) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -74,6 +76,7 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler<AutoSpawn
|
|||
|
||||
fillPanel(panel, autoSpawn);
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.songoda.epicbosses.managers.files.AutoSpawnFileManager;
|
|||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ObjectUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -29,13 +30,11 @@ import java.util.Map;
|
|||
public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<AutoSpawn> {
|
||||
|
||||
private AutoSpawnFileManager autoSpawnFileManager;
|
||||
private CustomBosses plugin;
|
||||
|
||||
public AutoSpawnSpecialSettingsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) {
|
||||
super(bossPanelManager, panelBuilder);
|
||||
|
||||
this.autoSpawnFileManager = plugin.getAutoSpawnFileManager();
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,6 +44,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, AutoSpawn autoSpawn) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
AutoSpawnSettings autoSpawnSettings = autoSpawn.getAutoSpawnSettings();
|
||||
|
@ -76,6 +76,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au
|
|||
counter.getSlotsWith("SpawnMessage").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAutoSpawnMessageEditorPanel().openFor((Player) event.getWhoClicked(), autoSpawn)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.autospawns.types.IntervalSpawnElement;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.AutoSpawnFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -39,6 +40,7 @@ public class AutoSpawnTypeEditorPanel extends VariablePanelHandler<AutoSpawn> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, AutoSpawn autoSpawn) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -55,6 +57,7 @@ public class AutoSpawnTypeEditorPanel extends VariablePanelHandler<AutoSpawn> {
|
|||
counter.getSlotsWith("SpawnerSystem");
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.AutoSpawnFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ObjectUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
|
@ -46,6 +47,7 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler<AutoSpawn> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, AutoSpawn autoSpawn) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
String type = ObjectUtils.getValue(autoSpawn.getType(), "INTERVAL");
|
||||
String editing = ""+ObjectUtils.getValue(autoSpawn.isEditing(), false);
|
||||
|
@ -68,6 +70,7 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler<AutoSpawn> {
|
|||
counter.getSlotsWith("CustomSettings").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getAutoSpawnCustomSettingsEditorPanel().openFor(player, autoSpawn)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.songoda.epicbosses.entity.elements.HandsElement;
|
|||
import com.songoda.epicbosses.entity.elements.MainStatsElement;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
|
||||
|
@ -88,6 +89,7 @@ public abstract class BossListEditorPanel extends VariablePanelHandler<BossEntit
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity));
|
||||
|
@ -119,6 +121,7 @@ public abstract class BossListEditorPanel extends VariablePanelHandler<BossEntit
|
|||
}));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.songoda.epicbosses.panel.bosses;
|
|||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
|
||||
|
@ -30,6 +31,7 @@ public class CommandsMainEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -49,6 +51,7 @@ public class CommandsMainEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
counter.getSlotsWith("OnDeath").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getOnDeathCommandEditMenu().openFor(player, bossEntity)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.managers.files.DropTableFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -69,6 +70,7 @@ public class DropsEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity));
|
||||
|
@ -83,17 +85,18 @@ public class DropsEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
.setCancelClick(true)
|
||||
.setCancelLowerClick(true);
|
||||
PanelBuilderCounter counter = panel.getPanelBuilderCounter();
|
||||
String dropTableName = bossEntity.getDrops().getDropTable();
|
||||
DropTable dropTable = this.dropTableFileManager.getDropTable(dropTableName);
|
||||
|
||||
fillPanel(panel, bossEntity);
|
||||
counter.getSlotsWith("Selected").forEach(slot -> panel.setOnClick(slot, event -> {
|
||||
/* TODO: GO TO EDIT PANEL FOR DROP TABLE */
|
||||
}));
|
||||
counter.getSlotsWith("Selected").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getMainDropTableEditMenu().openFor((Player) event.getWhoClicked(), dropTable)));
|
||||
counter.getSlotsWith("CreateDropTable").forEach(slot -> panel.setOnClick(slot, event -> {
|
||||
player.closeInventory();
|
||||
Message.Boss_New_CreateArgumentsDropTable.msg(event.getWhoClicked());
|
||||
}));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
private void loadPage(Panel panel, int requestedPage, Map<String, DropTable> dropTableMap, List<String> entryList, BossEntity bossEntity) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.songoda.epicbosses.entity.BossEntity;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -38,6 +39,7 @@ public class DropsMainEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
Boolean naturalDrops = bossEntity.getDrops().getNaturalDrops();
|
||||
Boolean naturalExp = bossEntity.getDrops().getDropExp();
|
||||
|
@ -69,6 +71,7 @@ public class DropsMainEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
counter.getSlotsWith("NaturalEXP").forEach(slot -> panel.setOnClick(slot, getNaturalExpAction(bossEntity, finalNaturalEXP)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.songoda.epicbosses.api.BossAPI;
|
|||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.entity.elements.EntityStatsElement;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
|
||||
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
|
||||
|
@ -36,6 +37,7 @@ public class EquipmentEditorPanel extends SubVariablePanelHandler<BossEntity, En
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity, EntityStatsElement entityStatsElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity));
|
||||
|
@ -57,5 +59,6 @@ public class EquipmentEditorPanel extends SubVariablePanelHandler<BossEntity, En
|
|||
panelBuilderCounter.getSlotsWith("Boots").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getBootsEditorMenu().openFor(player, bossEntity, entityStatsElement)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.managers.BossEntityManager;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -47,6 +48,7 @@ public class MainBossEditPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity));
|
||||
|
@ -73,6 +75,7 @@ public class MainBossEditPanel extends VariablePanelHandler<BossEntity> {
|
|||
counter.getSlotsWith("Text").forEach(slot -> panel.setOnClick(slot, e -> this.bossPanelManager.getMainTextEditMenu().openFor((Player) e.getWhoClicked(), bossEntity)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
private ClickAction getEditingAction(BossEntity bossEntity) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.SkillsFileManager;
|
||||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -60,6 +61,7 @@ public class SkillListEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -75,6 +77,7 @@ public class SkillListEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
fillPanel(panel, bossEntity);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -40,6 +41,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
Double chance = bossEntity.getSkills().getOverallChance();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
@ -62,6 +64,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
counter.getSlotsWith("Message").forEach(slot -> panel.setOnClick(slot, getMessageAction()));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.songoda.epicbosses.managers.files.BossesFileManager;
|
|||
import com.songoda.epicbosses.utils.EntityFinder;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
|
||||
|
@ -44,6 +45,7 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler<BossEntity
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity, EntityStatsElement entityStatsElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
String displayName = entityStatsElement.getMainStats().getDisplayName();
|
||||
|
@ -58,8 +60,7 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler<BossEntity
|
|||
replaceMap.put("{displayName}", displayName);
|
||||
panelBuilder.addReplaceData(replaceMap);
|
||||
|
||||
counter
|
||||
.addSlotCounter("DisplayName")
|
||||
counter.addSlotCounter("DisplayName")
|
||||
.addSlotCounter("EntityType")
|
||||
.addSlotCounter("Health");
|
||||
|
||||
|
@ -76,6 +77,7 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler<BossEntity
|
|||
counter.getSlotsWith("Health").forEach(slot -> panel.setOnClick(slot, getHealthAction(bossEntity, entityStatsElement)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.songoda.epicbosses.api.BossAPI;
|
|||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
|
||||
|
@ -35,6 +36,7 @@ public class TargetingEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity));
|
||||
|
@ -60,6 +62,7 @@ public class TargetingEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
}));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.songoda.epicbosses.panel.bosses;
|
|||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
|
||||
|
@ -30,6 +31,7 @@ public class TextMainEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -48,6 +50,7 @@ public class TextMainEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
counter.getSlotsWith("Taunts").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getMainTauntEditMenu().openFor((Player) event.getWhoClicked(), bossEntity)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.songoda.epicbosses.api.BossAPI;
|
|||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.entity.elements.EntityStatsElement;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
|
||||
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
|
||||
|
@ -31,6 +32,7 @@ public class WeaponsEditorPanel extends SubVariablePanelHandler<BossEntity, Enti
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity, EntityStatsElement entityStatsElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity));
|
||||
|
@ -50,6 +52,7 @@ public class WeaponsEditorPanel extends SubVariablePanelHandler<BossEntity, Enti
|
|||
panelBuilderCounter.getSlotsWith("OffHand").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getOffHandEditorMenu().openFor(player, bossEntity, entityStatsElement)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.songoda.epicbosses.api.BossAPI;
|
|||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.CommandsFileManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -59,6 +60,7 @@ public class OnDeathCommandEditor extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -74,6 +76,7 @@ public class OnDeathCommandEditor extends VariablePanelHandler<BossEntity> {
|
|||
fillPanel(panel, bossEntity);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.songoda.epicbosses.api.BossAPI;
|
|||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.CommandsFileManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -59,6 +60,7 @@ public class OnSpawnCommandEditor extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -74,6 +76,7 @@ public class OnSpawnCommandEditor extends VariablePanelHandler<BossEntity> {
|
|||
fillPanel(panel, bossEntity);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -41,6 +42,7 @@ public class DeathTextEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
OnDeathMessageElement onDeathMessageElement = bossEntity.getMessages().getOnDeath();
|
||||
Integer radius = onDeathMessageElement.getRadius();
|
||||
|
@ -74,6 +76,7 @@ public class DeathTextEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
counter.getSlotsWith("PositionMessage").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getOnDeathPositionTextEditMenu().openFor((Player) event.getWhoClicked(), bossEntity)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -40,6 +41,7 @@ public class SpawnTextEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
Integer radius = bossEntity.getMessages().getOnSpawn().getRadius();
|
||||
String message = bossEntity.getMessages().getOnDeath().getMessage();
|
||||
|
@ -64,6 +66,7 @@ public class SpawnTextEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
counter.getSlotsWith("Radius").forEach(slot -> panel.setOnClick(slot, getRadiusAction(bossEntity)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
|
@ -44,6 +45,7 @@ public class TauntTextEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
TauntElement tauntElement = bossEntity.getMessages().getTaunts();
|
||||
Integer radius = tauntElement.getRadius();
|
||||
|
@ -73,6 +75,7 @@ public class TauntTextEditorPanel extends VariablePanelHandler<BossEntity> {
|
|||
counter.getSlotsWith("Taunts").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getOnTauntTextEditMenu().openFor((Player) event.getWhoClicked(), bossEntity)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.songoda.epicbosses.CustomBosses;
|
|||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.droptable.DropTable;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -37,6 +38,7 @@ public class DropTableTypeEditorPanel extends VariablePanelHandler<DropTable> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
|
@ -52,6 +54,7 @@ public class DropTableTypeEditorPanel extends VariablePanelHandler<DropTable> {
|
|||
panelBuilderCounter.getSlotsWith("Give").forEach(slot -> panel.setOnClick(slot, getGiveAction(dropTable)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.droptable.elements.GiveTableElement;
|
|||
import com.songoda.epicbosses.droptable.elements.SprayTableElement;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.Debug;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
|
@ -36,6 +37,7 @@ public class MainDropTableEditorPanel extends VariablePanelHandler<DropTable> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
|
@ -51,6 +53,7 @@ public class MainDropTableEditorPanel extends VariablePanelHandler<DropTable> {
|
|||
panelBuilderCounter.getSlotsWith("Rewards").forEach(slot -> panel.setOnClick(slot, getRewardsAction(dropTable)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
||||
import com.songoda.epicbosses.panel.droptables.rewards.interfaces.IDropTableNewRewardEditor;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
|
||||
|
@ -55,11 +56,13 @@ public abstract class DropTableNewRewardEditorPanel<SubVariable> extends SubVari
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, SubVariable subVariable) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Panel panel = getPanelBuilder().getPanel()
|
||||
.setParentPanelHandler(getParentPanelHandler(), dropTable, subVariable);
|
||||
|
||||
fillPanel(panel, dropTable, subVariable);
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.songoda.epicbosses.panel.droptables.rewards.interfaces.IDropTableRewa
|
|||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ObjectUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubSubVariablePanelHandler;
|
||||
|
@ -37,6 +38,7 @@ public abstract class DropTableRewardMainEditorPanel<SubVariable> extends SubSub
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, SubVariable subVariable, String s) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
double chance = ObjectUtils.getValue(getChance(subVariable, s), 50.0);
|
||||
|
@ -53,6 +55,7 @@ public abstract class DropTableRewardMainEditorPanel<SubVariable> extends SubSub
|
|||
panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, getRemoveAction(dropTable, subVariable, s)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
||||
import com.songoda.epicbosses.panel.droptables.rewards.interfaces.IDropTableRewardsListEditor;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
|
||||
|
@ -56,6 +57,7 @@ public abstract class DropTableRewardsListEditorPanel<SubVariable> extends SubVa
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, SubVariable subVariable) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
|
@ -70,6 +72,7 @@ public abstract class DropTableRewardsListEditorPanel<SubVariable> extends SubVa
|
|||
fillPanel(panel, dropTable, subVariable);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.songoda.epicbosses.panel.droptables.types.give.handlers.GiveRewardEdi
|
|||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ObjectUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
|
||||
|
@ -40,6 +41,7 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler<DropTable,
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, GiveRewardEditHandler giveRewardEditHandler) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
GiveTableSubElement giveTableSubElement = giveRewardEditHandler.getGiveTableSubElement();
|
||||
|
@ -75,6 +77,7 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler<DropTable,
|
|||
counter.getSlotsWith("RandomDrops").forEach(slot -> panel.setOnClick(slot, getRandomCommandsAction(dropTable, giveRewardEditHandler)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
|||
import com.songoda.epicbosses.utils.Debug;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
|
@ -61,6 +62,7 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler<DropTab
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, GiveTableElement giveTableElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
|
@ -74,6 +76,7 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler<DropTab
|
|||
panelBuilderCounter.getSlotsWith("NewPosition").forEach(slot -> panel.setOnClick(slot, getNewPositionAction(dropTable, giveTableElement)));
|
||||
fillPanel(panel, dropTable, giveTableElement);
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.songoda.epicbosses.panel.droptables.types.give.handlers.GiveRewardEdi
|
|||
import com.songoda.epicbosses.utils.Debug;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ObjectUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
|
@ -46,6 +47,7 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler<DropT
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, GiveTableElement giveTableElement, String s) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
|
@ -59,6 +61,7 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler<DropT
|
|||
panelBuilderCounter.getSlotsWith("NewRewardSection").forEach(slot -> panel.setOnClick(slot, getNewRewardSectionAction(dropTable, giveTableElement, s)));
|
||||
fillPanel(panel, dropTable, giveTableElement, s);
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.songoda.epicbosses.managers.files.CommandsFileManager;
|
|||
import com.songoda.epicbosses.managers.files.DropTableFileManager;
|
||||
import com.songoda.epicbosses.panel.droptables.types.give.handlers.GiveRewardEditHandler;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -67,11 +68,13 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler<DropTable
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, GiveRewardEditHandler giveRewardEditHandler) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Panel panel = getPanelBuilder().getPanel()
|
||||
.setParentPanelHandler(this.bossPanelManager.getGiveCommandRewardListPanel(), dropTable, giveRewardEditHandler);
|
||||
|
||||
fillPanel(panel, dropTable, giveRewardEditHandler);
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
|
|||
import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
||||
import com.songoda.epicbosses.panel.droptables.types.give.handlers.GiveRewardEditHandler;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
|
@ -57,6 +58,7 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler<DropTabl
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, GiveRewardEditHandler giveRewardEditHandler) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
|
@ -71,6 +73,7 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler<DropTabl
|
|||
fillPanel(panel, dropTable, giveRewardEditHandler);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.songoda.epicbosses.panel.droptables.types.give.handlers.GiveRewardEdi
|
|||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ObjectUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubSubVariablePanelHandler;
|
||||
|
@ -39,6 +40,7 @@ public class GiveCommandRewardMainEditPanel extends SubSubVariablePanelHandler<D
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, GiveRewardEditHandler giveRewardEditHandler, String s) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, Double> rewardMap = giveRewardEditHandler.getGiveTableSubElement().getCommands();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
@ -56,6 +58,7 @@ public class GiveCommandRewardMainEditPanel extends SubSubVariablePanelHandler<D
|
|||
panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, getRemoveAction(dropTable, giveRewardEditHandler, s)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.songoda.epicbosses.droptable.elements.SprayTableElement;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
|
@ -42,6 +43,7 @@ public class SprayDropTableMainEditorPanel extends SubVariablePanelHandler<DropT
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, SprayTableElement sprayTableElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
Boolean randomSprayDrops = sprayTableElement.getRandomSprayDrops();
|
||||
|
@ -68,6 +70,7 @@ public class SprayDropTableMainEditorPanel extends SubVariablePanelHandler<DropT
|
|||
panelBuilderCounter.getSlotsWith("MaxDrops").forEach(slot -> panel.setOnClick(slot, getMaxDropsAction(dropTable, sprayTableElement)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.songoda.epicbosses.entity.elements.EntityStatsElement;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
|
||||
|
@ -71,6 +72,7 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, BossEntity bossEntity, EntityStatsElement entityStatsElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity));
|
||||
|
@ -97,6 +99,7 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl
|
|||
fillPanel(panel, bossEntity, entityStatsElement);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.songoda.epicbosses.api.BossAPI;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.CommandsFileManager;
|
||||
import com.songoda.epicbosses.managers.files.MessagesFileManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -68,6 +69,7 @@ public abstract class ListCommandListEditor<T> extends VariablePanelHandler<T> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, T object) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -83,6 +85,7 @@ public abstract class ListCommandListEditor<T> extends VariablePanelHandler<T> {
|
|||
fillPanel(panel, object);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.songoda.epicbosses.api.BossAPI;
|
|||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.MessagesFileManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -68,6 +69,7 @@ public abstract class ListMessageListEditor<T> extends VariablePanelHandler<T> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, T object) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -83,6 +85,7 @@ public abstract class ListMessageListEditor<T> extends VariablePanelHandler<T> {
|
|||
fillPanel(panel, object);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.songoda.epicbosses.panel.handlers;
|
||||
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.PanelHandler;
|
||||
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
|
||||
|
@ -24,6 +25,7 @@ public abstract class MainListPanelHandler extends PanelHandler {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Panel panel = getPanelBuilder().getPanel()
|
||||
.setDestroyWhenDone(true)
|
||||
.setCancelClick(true)
|
||||
|
@ -33,5 +35,6 @@ public abstract class MainListPanelHandler extends PanelHandler {
|
|||
fillPanel(panel);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.songoda.epicbosses.CustomBosses;
|
|||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.MessagesFileManager;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -67,6 +68,7 @@ public abstract class SingleMessageListEditor<T> extends VariablePanelHandler<T>
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, T object) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -82,6 +84,7 @@ public abstract class SingleMessageListEditor<T> extends VariablePanelHandler<T>
|
|||
fillPanel(panel, object);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.songoda.epicbosses.skills.Skill;
|
|||
import com.songoda.epicbosses.skills.SkillMode;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -41,6 +42,7 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
String customMessage = skill.getCustomMessage();
|
||||
Double radius = skill.getRadius();
|
||||
|
@ -77,6 +79,7 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
counter.getSlotsWith("Type").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getSkillTypeEditMenu().openFor((Player) event.getWhoClicked(), skill)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.songoda.epicbosses.api.BossAPI;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.managers.files.SkillsFileManager;
|
||||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -38,6 +39,7 @@ public class SkillTypeEditorPanel extends VariablePanelHandler<Skill> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -57,6 +59,7 @@ public class SkillTypeEditorPanel extends VariablePanelHandler<Skill> {
|
|||
counter.getSlotsWith("Group").forEach(slot -> panel.setOnClick(slot, getGroupAction(skill)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.songoda.epicbosses.skills.Skill;
|
|||
import com.songoda.epicbosses.skills.elements.SubCommandSkillElement;
|
||||
import com.songoda.epicbosses.skills.types.CommandSkillElement;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
|
@ -54,6 +55,7 @@ public class CommandSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -68,6 +70,7 @@ public class CommandSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
fillPanel(panel, skill);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.songoda.epicbosses.skills.Skill;
|
|||
import com.songoda.epicbosses.skills.types.CustomSkillElement;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler;
|
||||
|
@ -42,6 +43,7 @@ public class CustomSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
CustomSkillElement customSkillElement = this.bossSkillManager.getCustomSkillElement(skill);
|
||||
|
@ -62,6 +64,7 @@ public class CustomSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
counter.getSlotsWith("Multiplier").forEach(slot -> panel.setOnClick(slot, getMultiplierAction(skill, customSkillElement)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
|||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.types.GroupSkillElement;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
|
@ -60,6 +61,7 @@ public class GroupSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -72,6 +74,7 @@ public class GroupSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
fillPanel(panel, skill);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.songoda.epicbosses.managers.files.SkillsFileManager;
|
|||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.types.PotionSkillElement;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
|
@ -70,6 +71,7 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -88,6 +90,7 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> {
|
|||
fillPanel(panel, skill);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -67,6 +67,7 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler<Skill,
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill, SubCommandSkillElement subCommandSkillElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -79,6 +80,7 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler<Skill,
|
|||
fillPanel(panel, skill, subCommandSkillElement);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.songoda.epicbosses.skills.elements.SubCommandSkillElement;
|
|||
import com.songoda.epicbosses.skills.types.CommandSkillElement;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
|
@ -49,6 +50,7 @@ public class ModifyCommandEditorPanel extends SubVariablePanelHandler<Skill, Sub
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill, SubCommandSkillElement subCommandSkillElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
List<String> commands = subCommandSkillElement.getCommands();
|
||||
Double chance = subCommandSkillElement.getChance();
|
||||
|
@ -69,6 +71,7 @@ public class ModifyCommandEditorPanel extends SubVariablePanelHandler<Skill, Sub
|
|||
counter.getSlotsWith("Commands").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getCommandListSkillEditMenu().openFor((Player) event.getWhoClicked(), skill, subCommandSkillElement)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.songoda.epicbosses.skills.CustomSkillHandler;
|
|||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
|
||||
import com.songoda.epicbosses.skills.types.CustomSkillElement;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
|
@ -43,6 +44,7 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler<Skill, C
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill, CustomSkillElement customSkillElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
||||
|
@ -56,6 +58,7 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler<Skill, C
|
|||
fillPanel(panel, skill, customSkillElement);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.songoda.epicbosses.CustomBosses;
|
|||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.types.CustomSkillElement;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
|
@ -56,11 +57,13 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler<Sk
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill, CustomSkillElement customSkillElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Panel panel = getPanelBuilder().getPanel()
|
||||
.setParentPanelHandler(getParentHolder(), skill, customSkillElement);
|
||||
|
||||
fillPanel(panel, skill, customSkillElement);
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.songoda.epicbosses.managers.files.MinionsFileManager;
|
|||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.elements.CustomMinionSkillElement;
|
||||
import com.songoda.epicbosses.skills.types.CustomSkillElement;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.StringUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackConverter;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
|
@ -65,11 +66,13 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler<Skill, Cust
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill, CustomSkillElement customSkillElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Panel panel = getPanelBuilder().getPanel()
|
||||
.setParentPanelHandler(this.bossPanelManager.getSpecialSettingsEditorMenu(), skill, customSkillElement);
|
||||
|
||||
fillPanel(panel, skill, customSkillElement);
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction;
|
|||
import com.songoda.epicbosses.skills.Skill;
|
||||
import com.songoda.epicbosses.skills.types.CustomSkillElement;
|
||||
import com.songoda.epicbosses.utils.Debug;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
|
@ -41,6 +42,7 @@ public class SpecialSettingsEditorPanel extends SubVariablePanelHandler<Skill, C
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill, CustomSkillElement customSkillElement) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
|
||||
|
@ -54,6 +56,7 @@ public class SpecialSettingsEditorPanel extends SubVariablePanelHandler<Skill, C
|
|||
fillPanel(panel, skill, customSkillElement);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.songoda.epicbosses.skills.types.PotionSkillElement;
|
|||
import com.songoda.epicbosses.utils.Message;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.PotionEffectFinder;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import com.songoda.epicbosses.utils.panel.Panel;
|
||||
import com.songoda.epicbosses.utils.panel.base.ClickAction;
|
||||
import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler;
|
||||
|
@ -53,6 +54,7 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill, PotionEffectHolder potionEffectHolder) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
String effect = potionEffectHolder.getType();
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
|
@ -79,10 +81,9 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill
|
|||
counter.getSlotsWith("Effect").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getPotionEffectTypeEditMenu().openFor((Player) event.getWhoClicked(), skill, potionEffectHolder)));
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ClickAction getDurationAction(Skill skill, PotionEffectHolder potionEffectHolder) {
|
||||
return event -> {
|
||||
ClickType clickType = event.getClick();
|
||||
|
|
|
@ -59,12 +59,14 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill,
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, Skill skill, PotionEffectHolder potionEffectHolder) {
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
Panel panel = getPanelBuilder().getPanel()
|
||||
.setParentPanelHandler(this.bossPanelManager.getCreatePotionEffectMenu(), skill, potionEffectHolder);
|
||||
|
||||
fillPanel(panel, skill, potionEffectHolder);
|
||||
|
||||
panel.openFor(player);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,6 +17,7 @@ public enum Debug {
|
|||
MECHANIC_APPLICATION_FAILED("Some mechanics have failed to be applied. It got stuck at {0} mechanic."),
|
||||
BOSS_NAME_EXISTS("A boss was attempted to be created with the name {0} but there is already a boss with that name."),
|
||||
DROPTABLE_NAME_EXISTS("A droptable was attempted to be created with the name {0} but there is already a drop table with that name."),
|
||||
AUTOSPAWN_NAME_EXISTS("A autospawn was attempted to be created with the name {0} but there is already an auto spawn with that name."),
|
||||
SKILL_NAME_EXISTS("A skill was attempted to be created with the name {0} but there is already a skill with that name."),
|
||||
MINION_NAME_EXISTS("A minion was attempted to be created with the name {0} but there is already a minion with that name."),
|
||||
BOSS_CONTAINER_SAVE("The BossEntity map was saved in, {0} succeeded, and {1} failed. Listed below are the saved data which already existed in the container: \n{2}"),
|
||||
|
|
|
@ -115,7 +115,7 @@ public enum Message {
|
|||
"&7&o(To add a new line use &7||&7&o in-between the messages.)\n" +
|
||||
"&b/boss new message [name] [messages] &8» &7Used to create a new message section.\n" +
|
||||
"&7&o(To add a new line use &7||&7&o in-between the messages.)\n" +
|
||||
"&7\n" +
|
||||
"&7/boss new autospawn [name] &8» &7Used to create a new auto spawn section.\n" +
|
||||
"&7\n" +
|
||||
"&7\n" +
|
||||
"&7\n" +
|
||||
|
@ -165,11 +165,13 @@ public enum Message {
|
|||
Boss_New_CreateArgumentsSkill("&b&lEpicBosses &8» &7Create a new skill with the command &f/boss new skill [name] [type] [mode]&7."),
|
||||
Boss_New_CreateArgumentsMessage("&b&lEpicBosses &8» &7Create a new message with the command &f/boss new message [name] [message(s)]. \n&7&oUse &f|| &7&oto reference a new line."),
|
||||
Boss_New_CreateArgumentsCommand("&b&lEpicBosses &8» &7Create a new command with the command &f/boss new command [name] [command(s)]. \n&7&oUse &f|| &7&oto reference a new line."),
|
||||
Boss_New_CreateArgumentsAutoSpawn("&b&lEpicBosses &8» &7Create a new auto spawn with the command &f/boss new autospawn [name]."),
|
||||
Boss_New_AlreadyExists("&c&l(!) &cThe specified {0} name already exists. Please try another name."),
|
||||
Boss_New_InvalidDropTableType("&c&l(!) &cThe specified DropTable type is invalid. Please use &fGive, Drop, Spray&c."),
|
||||
Boss_New_InvalidSkillType("&c&l(!) &cThe specified Skill type is invalid. Please use &fCustom, Command, Group, Potion&c."),
|
||||
Boss_New_InvalidSkillMode("&c&l(!) &cThe specified Skill mode is invalid. Please use &fAll, Random, One, Boss&c."),
|
||||
Boss_New_DropTable("&b&lEpicBosses &8» &7You have created a new drop table with the name &f{0}&7 and type &f{1}&7."),
|
||||
Boss_New_AutoSpawn("&b&lEpicBosses &8» &7You have created a new auto spawn with the name &f{0}&7."),
|
||||
Boss_New_Skill("&b&lEpicBosses &8» &7You have created a new skill with the name &f{0}&7 and type &f{1}&7."),
|
||||
Boss_New_Command("&b&lEpicBosses &8» &7You have created a new command with the name &f{0}&7."),
|
||||
Boss_New_Message("&b&lEpicBosses &8» &7You have created a new message with the name &f{0}&7."),
|
||||
|
|
Loading…
Reference in New Issue
Block a user