1.0.0-SNAPSHOT-U201
+ Fixed all the GUI buttons that weren't working + Updated the default droptables.json to work with the default give table
This commit is contained in:
parent
36b2aa73b1
commit
57ca5c0099
|
@ -1,19 +1,122 @@
|
|||
{
|
||||
"SkeletonTableSpray": {
|
||||
"dropType": "SPRAY",
|
||||
"SkeletonTableGive": {
|
||||
"dropType": "GIVE",
|
||||
"rewards": {
|
||||
"sprayRewards": {
|
||||
"SKSpawnItem": 10.0,
|
||||
"SKHelmet": 45.0,
|
||||
"SKChestplate": 45.0,
|
||||
"SKLeggings": 45.0,
|
||||
"SKBoots": 45.0,
|
||||
"SKMainHand": 30.0,
|
||||
"SKOffHand": 30.0
|
||||
},
|
||||
"randomSprayDrops": true,
|
||||
"sprayMaxDistance": 10,
|
||||
"sprayMaxDrops": 5
|
||||
"giveRewards": {
|
||||
"1": {
|
||||
"1": {
|
||||
"items": {
|
||||
"SKEco500": 30.0,
|
||||
"SKEco2500": 50.0,
|
||||
"SKEco5000": 10.0
|
||||
},
|
||||
"commands": {
|
||||
"SKEco500": 30.0,
|
||||
"SKEco2500": 50.0,
|
||||
"SKEco5000": 10.0
|
||||
},
|
||||
"maxDrops": 3,
|
||||
"maxCommands": 1,
|
||||
"randomDrops": true,
|
||||
"randomCommands": true,
|
||||
"requiredPercentage": 80.0
|
||||
},
|
||||
"2": {
|
||||
"items": {
|
||||
"SKCustomDrop1": 50.0
|
||||
},
|
||||
"commands": {},
|
||||
"maxDrops": 1,
|
||||
"maxCommands": 0,
|
||||
"randomDrops": false,
|
||||
"randomCommands": false,
|
||||
"requiredPercentage": 50.0
|
||||
},
|
||||
"3": {
|
||||
"items": {
|
||||
"SKCustomDrop1": 100.0
|
||||
},
|
||||
"commands": {},
|
||||
"maxDrops": 1,
|
||||
"maxCommands": 0,
|
||||
"randomDrops": false,
|
||||
"randomCommands": false,
|
||||
"requiredPercentage": 0.0
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
"1": {
|
||||
"items": {
|
||||
"SKMainHand": 8.0,
|
||||
"SKOffHand": 8.0,
|
||||
"SKHelmet": 8.0,
|
||||
"SKLeggings": 20.0,
|
||||
"SKChestplate": 20.0,
|
||||
"SKBoots": 20.0
|
||||
},
|
||||
"commands": {},
|
||||
"maxDrops": -1,
|
||||
"maxCommands": 0,
|
||||
"randomDrops": false,
|
||||
"randomCommands": false,
|
||||
"requiredPercentage": 0.0
|
||||
}
|
||||
},
|
||||
"3": {
|
||||
"1": {
|
||||
"items": {
|
||||
"SKMainHand": 5.0,
|
||||
"SKOffHand": 5.0,
|
||||
"SKHelmet": 5.0,
|
||||
"SKLeggings": 15.0,
|
||||
"SKChestplate": 15.0,
|
||||
"SKBoots": 15.0
|
||||
},
|
||||
"commands": {},
|
||||
"maxDrops": -1,
|
||||
"maxCommands": 0,
|
||||
"randomDrops": false,
|
||||
"randomCommands": false,
|
||||
"requiredPercentage": 0.0
|
||||
}
|
||||
},
|
||||
"4": {
|
||||
"1": {
|
||||
"items": {
|
||||
"SKMainHand": 3.0,
|
||||
"SKOffHand": 3.0,
|
||||
"SKHelmet": 3.0,
|
||||
"SKLeggings": 10.0,
|
||||
"SKChestplate": 10.0,
|
||||
"SKBoots": 10.0
|
||||
},
|
||||
"commands": {},
|
||||
"maxDrops": -1,
|
||||
"maxCommands": 0,
|
||||
"randomDrops": false,
|
||||
"randomCommands": false,
|
||||
"requiredPercentage": 0.0
|
||||
}
|
||||
},
|
||||
"5": {
|
||||
"1": {
|
||||
"items": {
|
||||
"SKMainHand": 1.0,
|
||||
"SKOffHand": 1.0,
|
||||
"SKHelmet": 1.0,
|
||||
"SKLeggings": 5.0,
|
||||
"SKChestplate": 5.0,
|
||||
"SKBoots": 5.0
|
||||
},
|
||||
"commands": {},
|
||||
"maxDrops": -1,
|
||||
"maxCommands": 0,
|
||||
"randomDrops": false,
|
||||
"randomCommands": false,
|
||||
"requiredPercentage": 0.0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"SkeletonTableDrop": {
|
||||
|
@ -32,95 +135,21 @@
|
|||
"dropMaxDrops": 4
|
||||
}
|
||||
},
|
||||
"SkeletonTableGive": {
|
||||
"dropType": "GIVE",
|
||||
"SkeletonTableSpray": {
|
||||
"dropType": "SPRAY",
|
||||
"rewards": {
|
||||
"giveRewards": {
|
||||
"1": {
|
||||
"1": {
|
||||
"items": {
|
||||
"SKHelmet": 10.0,
|
||||
"SKChestplate": 25.0,
|
||||
"SKLeggings": 25.0,
|
||||
"SKBoots": 25.0,
|
||||
"SKMainHand": 10.0,
|
||||
"SKOffHand": 10.0
|
||||
},
|
||||
"commands": {
|
||||
"SKEco500": 30.0,
|
||||
"SKEco2500": 50.0,
|
||||
"SKEco5000": 10.0
|
||||
},
|
||||
"maxDrops": 3,
|
||||
"maxCommands": 1,
|
||||
"randomDrops": true,
|
||||
"randomCommands": true,
|
||||
"requiredPercentage": 80.0
|
||||
},
|
||||
"2": {
|
||||
"items": {
|
||||
"SKCustomDrop1": 50.0,
|
||||
"SKCustomDrop2": 50.0
|
||||
},
|
||||
"requiredPercentage": 50.0
|
||||
},
|
||||
"3": {
|
||||
"items": {
|
||||
"SKCustomDrop1": 100.0,
|
||||
"SKCustomDrop2": 100.0
|
||||
},
|
||||
"requiredPercentage": 0.0
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
"items": {
|
||||
"SKHelmet": 8.0,
|
||||
"SKChestplate": 20.0,
|
||||
"SKLeggings": 20.0,
|
||||
"SKBoots": 20.0,
|
||||
"SKMainHand": 8.0,
|
||||
"SKOffHand": 8.0
|
||||
},
|
||||
"maxDrops": -1,
|
||||
"randomDrops": false
|
||||
},
|
||||
"3": {
|
||||
"items": {
|
||||
"SKHelmet": 5.0,
|
||||
"SKChestplate": 15.0,
|
||||
"SKLeggings": 15.0,
|
||||
"SKBoots": 15.0,
|
||||
"SKMainHand": 5.0,
|
||||
"SKOffHand": 5.0
|
||||
},
|
||||
"maxDrops": -1,
|
||||
"randomDrops": false
|
||||
},
|
||||
"4": {
|
||||
"items": {
|
||||
"SKHelmet": 3.0,
|
||||
"SKChestplate": 10.0,
|
||||
"SKLeggings": 10.0,
|
||||
"SKBoots": 10.0,
|
||||
"SKMainHand": 3.0,
|
||||
"SKOffHand": 3.0
|
||||
},
|
||||
"maxDrops": -1,
|
||||
"randomDrops": false
|
||||
},
|
||||
"5": {
|
||||
"items": {
|
||||
"SKHelmet": 1.0,
|
||||
"SKChestplate": 5.0,
|
||||
"SKLeggings": 5.0,
|
||||
"SKBoots": 5.0,
|
||||
"SKMainHand": 1.0,
|
||||
"SKOffHand": 1.0
|
||||
},
|
||||
"maxDrops": 3,
|
||||
"randomDrops": true
|
||||
}
|
||||
}
|
||||
"sprayRewards": {
|
||||
"SKSpawnItem": 10.0,
|
||||
"SKHelmet": 45.0,
|
||||
"SKChestplate": 45.0,
|
||||
"SKLeggings": 45.0,
|
||||
"SKBoots": 45.0,
|
||||
"SKMainHand": 30.0,
|
||||
"SKOffHand": 30.0
|
||||
},
|
||||
"randomSprayDrops": true,
|
||||
"sprayMaxDistance": 10,
|
||||
"sprayMaxDrops": 5
|
||||
}
|
||||
}
|
||||
}
|
|
@ -73,6 +73,8 @@ public class BossSpawnListener implements Listener {
|
|||
}
|
||||
}
|
||||
|
||||
ServerUtils.get().logDebug("Found bossEntity: " + bossEntity);
|
||||
|
||||
if(bossEntity == null) return;
|
||||
|
||||
if(bossEntity.isEditing()) {
|
||||
|
|
|
@ -316,11 +316,11 @@ public class BossPanelManager implements ILoadable, IReloadable {
|
|||
this.giveRewardMainEditMenu = new GiveRewardMainEditPanel(this, panelBuilder12, this.customBosses);
|
||||
|
||||
this.giveDropNewRewardEditPanel = new GiveDropNewRewardPanel(this, panelBuilder4, this.customBosses);
|
||||
this.giveDropRewardListPanel = new GiveDropRewardListPanel(this, panelBuilder5, this.customBosses);
|
||||
this.giveDropRewardMainEditPanel = new GiveDropRewardMainEditPanel(this, panelBuilder3, this.customBosses);
|
||||
this.giveDropRewardListPanel = new GiveDropRewardListPanel(this, panelBuilder3, this.customBosses);
|
||||
this.giveDropRewardMainEditPanel = new GiveDropRewardMainEditPanel(this, panelBuilder5, this.customBosses);
|
||||
this.giveCommandNewRewardPanel = new GiveCommandNewRewardPanel(this, panelBuilder4, this.customBosses);
|
||||
this.giveCommandRewardListPanel = new GiveCommandRewardListPanel(this, panelBuilder5, this.customBosses);
|
||||
this.giveCommandRewardMainEditMenu = new GiveCommandRewardMainEditPanel(this, panelBuilder3, this.customBosses);
|
||||
this.giveCommandRewardListPanel = new GiveCommandRewardListPanel(this, panelBuilder3, this.customBosses);
|
||||
this.giveCommandRewardMainEditMenu = new GiveCommandRewardMainEditPanel(this, panelBuilder5, this.customBosses);
|
||||
}
|
||||
|
||||
private void reloadDropTableEditMenus() {
|
||||
|
@ -848,7 +848,7 @@ public class BossPanelManager implements ILoadable, IReloadable {
|
|||
}
|
||||
|
||||
private void reloadAutoSpawnsMenu() {
|
||||
this.autoSpawns.initializePanel(getListMenu("AutoSpawns"));
|
||||
this.autoSpawns.initializePanel(getListMenu("AutoSpawns.Main"));
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
|
@ -890,7 +890,7 @@ public class BossPanelManager implements ILoadable, IReloadable {
|
|||
}
|
||||
|
||||
private void reloadDropTable() {
|
||||
this.dropTables.initializePanel(getListMenu("DropTable"));
|
||||
this.dropTables.initializePanel(getListMenu("DropTable.Main"));
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
|
|
|
@ -89,7 +89,6 @@ public class MainBossEditPanel extends VariablePanelHandler<BossEntity> {
|
|||
bossEntity.setEditing(!bossEntity.isEditing());
|
||||
this.bossesFileManager.save();
|
||||
Message.Boss_Edit_Toggled.msg(player, BossAPI.getBossEntityName(bossEntity), bossEntity.getEditingValue());
|
||||
player.closeInventory();
|
||||
|
||||
if(bossEntity.isEditing()) {
|
||||
this.bossEntityManager.killAllHolders(bossEntity);
|
||||
|
|
|
@ -44,6 +44,7 @@ public abstract class DropTableRewardMainEditorPanel<SubVariable> extends SubSub
|
|||
|
||||
replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance));
|
||||
replaceMap.put("{itemStack}", s);
|
||||
replaceMap.put("{name}", BossAPI.getDropTableName(dropTable));
|
||||
panelBuilder.addReplaceData(replaceMap);
|
||||
|
||||
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
|
||||
|
|
|
@ -53,7 +53,7 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler<DropTable,
|
|||
Boolean randomCommands = ObjectUtils.getValue(giveTableSubElement.getRandomCommands(), false);
|
||||
|
||||
replaceMap.put("{name}", BossAPI.getDropTableName(dropTable));
|
||||
replaceMap.put("{position}", giveRewardEditHandler.getDamagePosition());
|
||||
replaceMap.put("{position}", giveRewardEditHandler.getDropSection());
|
||||
replaceMap.put("{randomDrops}", ""+randomDrops);
|
||||
replaceMap.put("{maxDrops}", NumberUtils.get().formatDouble(maxDrops));
|
||||
replaceMap.put("{drops}", NumberUtils.get().formatDouble(itemDrops));
|
||||
|
@ -74,7 +74,7 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler<DropTable,
|
|||
counter.getSlotsWith("RequiredPercentage").forEach(slot -> panel.setOnClick(slot, getRequiredPercentageAction(dropTable, giveRewardEditHandler)));
|
||||
counter.getSlotsWith("CommandDrops").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getGiveCommandRewardListPanel().openFor((Player) event.getWhoClicked(), dropTable, giveRewardEditHandler)));
|
||||
counter.getSlotsWith("MaxCommands").forEach(slot -> panel.setOnClick(slot, getMaxCommandsAction(dropTable, giveRewardEditHandler)));
|
||||
counter.getSlotsWith("RandomDrops").forEach(slot -> panel.setOnClick(slot, getRandomCommandsAction(dropTable, giveRewardEditHandler)));
|
||||
counter.getSlotsWith("RandomCommands").forEach(slot -> panel.setOnClick(slot, getRandomCommandsAction(dropTable, giveRewardEditHandler)));
|
||||
});
|
||||
|
||||
panel.openFor(player);
|
||||
|
|
|
@ -98,7 +98,7 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler<DropT
|
|||
GiveTableSubElement giveTableSubElement = rewards.get(rewardSectionPosition);
|
||||
ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(this.itemsFileManager.getItemStackHolder("DefaultDropTableRewardsListItem"));
|
||||
|
||||
int position = NumberUtils.get().getInteger(key);
|
||||
int position = NumberUtils.get().getInteger(rewardSectionPosition);
|
||||
Integer itemDrops = giveTableSubElement.getItems().size();
|
||||
Integer commandDrops = giveTableSubElement.getCommands().size();
|
||||
Double requiredPercentage = ObjectUtils.getValue(giveTableSubElement.getRequiredPercentage(), 0.0);
|
||||
|
|
|
@ -40,27 +40,26 @@ public class GiveCommandRewardMainEditPanel extends SubSubVariablePanelHandler<D
|
|||
|
||||
@Override
|
||||
public void openFor(Player player, DropTable dropTable, GiveRewardEditHandler giveRewardEditHandler, String s) {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, Double> rewardMap = giveRewardEditHandler.getGiveTableSubElement().getCommands();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
double chance = ObjectUtils.getValue(rewardMap.get(s), 50.0);
|
||||
|
||||
replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance));
|
||||
replaceMap.put("{itemStack}", s);
|
||||
replaceMap.put("{name}", BossAPI.getDropTableName(dropTable));
|
||||
panelBuilder.addReplaceData(replaceMap);
|
||||
|
||||
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
|
||||
Panel panel = panelBuilder.getPanel()
|
||||
.setParentPanelHandler(this.bossPanelManager.getGiveCommandRewardListPanel(), dropTable, giveRewardEditHandler);
|
||||
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
|
||||
Map<String, Double> rewardMap = giveRewardEditHandler.getGiveTableSubElement().getCommands();
|
||||
Map<String, String> replaceMap = new HashMap<>();
|
||||
double chance = ObjectUtils.getValue(rewardMap.get(s), 50.0);
|
||||
|
||||
replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance));
|
||||
replaceMap.put("{itemStack}", s);
|
||||
panelBuilder.addReplaceData(replaceMap);
|
||||
|
||||
PanelBuilderCounter panelBuilderCounter = panelBuilder.getPanelBuilderCounter();
|
||||
Panel panel = panelBuilder.getPanel()
|
||||
.setParentPanelHandler(this.bossPanelManager.getGiveCommandRewardListPanel(), dropTable, giveRewardEditHandler);
|
||||
|
||||
ServerUtils.get().runTaskAsync(() -> {
|
||||
panelBuilderCounter.getSlotsWith("Chance").forEach(slot -> panel.setOnClick(slot, getChanceAction(dropTable, giveRewardEditHandler, s)));
|
||||
panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, getRemoveAction(dropTable, giveRewardEditHandler, s)));
|
||||
});
|
||||
|
||||
panel.openFor(player);
|
||||
panelBuilderCounter.getSlotsWith("Chance").forEach(slot -> panel.setOnClick(slot, getChanceAction(dropTable, giveRewardEditHandler, s)));
|
||||
panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, getRemoveAction(dropTable, giveRewardEditHandler, s)));
|
||||
});
|
||||
|
||||
panel.openFor(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,7 @@ public class PotionSkillElement implements ISkillHandler<PotionSkillElement> {
|
|||
|
||||
@Expose @Getter @Setter private List<PotionEffectHolder> potions;
|
||||
|
||||
private final PotionEffectConverter potionEffectConverter;
|
||||
private PotionEffectConverter potionEffectConverter;
|
||||
|
||||
public PotionSkillElement(List<PotionEffectHolder> potions) {
|
||||
this.potions = potions;
|
||||
|
@ -33,6 +33,9 @@ public class PotionSkillElement implements ISkillHandler<PotionSkillElement> {
|
|||
public void castSkill(Skill skill, PotionSkillElement customSkillElement, ActiveBossHolder activeBossHolder, List<LivingEntity> nearbyEntities) {
|
||||
List<PotionEffectHolder> potionElements = getPotions();
|
||||
|
||||
if(this.potionEffectConverter == null) this.potionEffectConverter = new PotionEffectConverter();
|
||||
|
||||
if(nearbyEntities == null || nearbyEntities.isEmpty()) return;
|
||||
if(potionElements == null) return;
|
||||
if(potionElements.isEmpty()) {
|
||||
Debug.SKILL_POTIONS_ARE_EMPTY.debug();
|
||||
|
|
Loading…
Reference in New Issue