mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-03-12 22:49:13 +01:00
1.0.0-SNAPSHOT-U109
+ Fixed issue with removing potion from skill not saving + Started implementing AutoSpawns
This commit is contained in:
parent
68b2cf0c78
commit
9b268cc89e
@ -1,3 +1,14 @@
|
||||
{
|
||||
|
||||
"Section1": {
|
||||
"location": "world,0,150,0",
|
||||
"entities": [
|
||||
"SkeletonKing"
|
||||
],
|
||||
"settings": {
|
||||
"spawnWhenChunkIsntLoaded": false,
|
||||
"maxAliveAtOnce": 1,
|
||||
"amountPerSpawn": 1,
|
||||
"placeholder": "{custombosses_1}"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.songoda.epicbosses.panel.skills.custom;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.songoda.epicbosses.CustomBosses;
|
||||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.managers.BossPanelManager;
|
||||
@ -60,11 +61,11 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> {
|
||||
panel.setOnPageChange(((player, currentPage, requestedPage) -> {
|
||||
if(requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
|
||||
loadPage(panel, requestedPage, potionEffectHolders, potionSkillElement);
|
||||
loadPage(panel, requestedPage, potionEffectHolders, potionSkillElement, skill);
|
||||
return true;
|
||||
}));
|
||||
|
||||
loadPage(panel, 0, potionEffectHolders, potionSkillElement);
|
||||
loadPage(panel, 0, potionEffectHolders, potionSkillElement, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -97,7 +98,7 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> {
|
||||
.addSlotCounter("PotionEffect");
|
||||
}
|
||||
|
||||
private void loadPage(Panel panel, int page, List<PotionEffectHolder> potionEffectHolders, PotionSkillElement potionSkillElement) {
|
||||
private void loadPage(Panel panel, int page, List<PotionEffectHolder> potionEffectHolders, PotionSkillElement potionSkillElement, Skill skill) {
|
||||
panel.loadPage(page, (slot, realisticSlot) -> {
|
||||
if(slot >= potionEffectHolders.size()) {
|
||||
panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {});
|
||||
@ -126,9 +127,14 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> {
|
||||
panel.setItem(realisticSlot, itemStack, e -> {
|
||||
potionEffectHolders.remove(potionEffectHolder);
|
||||
potionSkillElement.setPotions(potionEffectHolders);
|
||||
|
||||
|
||||
JsonObject jsonObject = BossAPI.convertSkillElement(potionSkillElement);
|
||||
|
||||
skill.setCustomData(jsonObject);
|
||||
this.skillsFileManager.save();
|
||||
|
||||
loadPage(panel, page, potionEffectHolders, potionSkillElement);
|
||||
loadPage(panel, page, potionEffectHolders, potionSkillElement, skill);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
2
pom.xml
2
pom.xml
@ -20,7 +20,7 @@
|
||||
|
||||
<properties>
|
||||
<!--<plugin.version>maven-version-number-SNAPSHOT-U90</plugin.version>-->
|
||||
<plugin.version>1.0.0-U108</plugin.version>
|
||||
<plugin.version>1.0.0-U109</plugin.version>
|
||||
<plugin.name>EpicBosses</plugin.name>
|
||||
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
|
||||
<plugin.author>AMinecraftDev</plugin.author>
|
||||
|
Loading…
Reference in New Issue
Block a user