1.0.0-SNAPSHOT-U175

+ Updated TODO
+ Fixed issue with plugin not compiling
+ Fixed bugs with the skill panels
+ Fixed material panel to list all correct materials and not list air or materials which couldn't also be an item
This commit is contained in:
Charles 2019-01-07 01:47:09 +08:00
parent 32265bd9b7
commit 412ed322c7
20 changed files with 64 additions and 36 deletions

1
TODO
View File

@ -2,6 +2,7 @@
01:00 -> Interval - Button to change coords, list of possible spawns, spawnIfChunkIsntLoaded, maxActiveBosses, bossesPerInterval, spawnRate, spawnType (Interval or Random), placeholder, message
00:30 -> Add HolographicDisplay/PlaceholderAPI support for custom placeholders on AutoSpawnInterval times
01:00 -> Add a new branch for the plugin and add support for Legacy version
-----------
4:30 hrs

View File

@ -46,7 +46,7 @@ public class BossCommandManager implements ILoadable {
this.commandService.registerSubCommand(new BossShopCmd(this.customBosses));
this.commandService.registerSubCommand(new BossSkillsCmd(this.customBosses.getBossPanelManager()));
this.commandService.registerSubCommand(new BossSpawnCmd(this.customBosses.getBossesFileManager()));
this.commandService.registerSubCommand(new BossTimeCmd());
this.commandService.registerSubCommand(new BossTimeCmd(this.customBosses));
this.hasBeenLoaded = true;
}

View File

@ -7,6 +7,7 @@ import com.songoda.epicbosses.managers.BossPanelManager;
import com.songoda.epicbosses.managers.BossSkillManager;
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.itemstack.ItemStackConverter;
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
@ -46,6 +47,7 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler<Skill, C
PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder();
replaceMap.put("{name}", BossAPI.getSkillName(skill));
replaceMap.put("{selected}", customSkillElement.getCustom().getType());
panelBuilder.addReplaceData(replaceMap);
Panel panel = panelBuilder.getPanel()
@ -86,7 +88,7 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler<Skill, C
CustomSkillHandler customSkillHandler = customSkillHandlers.get(slot);
String name = customSkillHandler.getSkillName();
Map<String, String> replaceMap = new HashMap<>();
String hasCustomData = customSkillHandler.getOtherSkillData() == null? "false" : customSkillHandler.getOtherSkillData().isEmpty()? "false" : "true";
String hasCustomData = customSkillHandler.getOtherSkillData() == null? "false" : "true";
replaceMap.put("{name}", name);
replaceMap.put("{multiplier}", ""+customSkillHandler.doesUseMultiplier());
@ -107,14 +109,18 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler<Skill, C
ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Skills.CustomType.lore"), replaceMap);
panel.setItem(realisticSlot, itemStack, event -> {
IOtherSkillDataElement otherSkillDataElement = customSkillHandler.getOtherSkillData();
JsonObject otherData = otherSkillDataElement == null? null : BossAPI.convertObjectToJsonObject(otherSkillDataElement);
customSkillElement.getCustom().setType(name);
customSkillElement.getCustom().setOtherSkillData(otherData);
JsonObject jsonObject = BossAPI.convertObjectToJsonObject(customSkillElement);
skill.setCustomData(jsonObject);
this.plugin.getSkillsFileManager().save();
loadPage(panel, page, skill, customSkillElement, customSkillHandlers);
openFor((Player) event.getWhoClicked(), skill, customSkillElement);
});
}
}));

View File

@ -76,7 +76,11 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler<Sk
panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{});
} else {
Material material = filteredList.get(slot);
ItemStack itemStack = new ItemStack(material);
ItemStack itemStack;
if(material == Material.AIR) itemStack = new ItemStack(Material.GLASS);
else itemStack = new ItemStack(material);
Map<String, String> replaceMap = new HashMap<>();
if(itemStack.getType() == Material.AIR) return;
@ -103,7 +107,7 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler<Sk
List<Material> materials = new ArrayList<>();
masterList.forEach(material -> {
if(material.isBlock() && material.isSolid() && material.isOccluding()) {
if((material.isBlock() && material.isSolid() && material.isItem()) || (material == Material.AIR)) {
materials.add(material);
}
});

View File

@ -91,7 +91,7 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler<Skill, Cust
ItemStack itemStack = this.itemStackConverter.from(itemStackHolder);
Map<String, String> replaceMap = new HashMap<>();
replaceMap.put("{name}", StringUtils.get().formatString(name));
replaceMap.put("{name}", name);
replaceMap.put("{editing}", ""+minionEntity.isEditing());
replaceMap.put("{targeting}", minionEntity.getTargeting());

View File

@ -12,8 +12,10 @@ import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.custom.cage.CageLocationData;
import com.songoda.epicbosses.skills.custom.cage.CagePlayerData;
import com.songoda.epicbosses.skills.elements.CustomCageSkillElement;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.Debug;
import com.songoda.epicbosses.utils.ObjectUtils;
import com.songoda.epicbosses.utils.ServerUtils;
import com.songoda.epicbosses.utils.itemstack.converters.MaterialConverter;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
@ -59,14 +61,8 @@ public class Cage extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
Map<String, Object> map = new HashMap<>();
map.put("flatType", "IRON_BLOCK");
map.put("wallType", "IRON_BARS");
map.put("insideType", "AIR");
return map;
public IOtherSkillDataElement getOtherSkillData() {
return new CustomCageSkillElement("IRON_BLOCK", "IRON_BARS", "AIR");
}
@Override
@ -179,7 +175,7 @@ public class Cage extends CustomSkillHandler {
private String getFlatTypeCurrent(CustomSkillElement customSkillElement) {
CustomCageSkillElement customCageSkillElement = customSkillElement.getCustom().getCustomCageSkillData();
return customCageSkillElement.getFlatType();
return ObjectUtils.getValue(customCageSkillElement.getFlatType(), "");
}
private MaterialTypeEditorPanel getFlatTypeEditor() {
@ -209,7 +205,7 @@ public class Cage extends CustomSkillHandler {
private String getWallTypeCurrent(CustomSkillElement customSkillElement) {
CustomCageSkillElement customCageSkillElement = customSkillElement.getCustom().getCustomCageSkillData();
return customCageSkillElement.getWallType();
return ObjectUtils.getValue(customCageSkillElement.getWallType(), "");
}
private MaterialTypeEditorPanel getWallTypeEditor() {
@ -239,7 +235,7 @@ public class Cage extends CustomSkillHandler {
private String getInsideTypeCurrent(CustomSkillElement customSkillElement) {
CustomCageSkillElement customCageSkillElement = customSkillElement.getCustom().getCustomCageSkillData();
return customCageSkillElement.getInsideType();
return ObjectUtils.getValue(customCageSkillElement.getInsideType(), "");
}
private MaterialTypeEditorPanel getInsideTypeEditor() {

View File

@ -5,6 +5,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.Message;
import com.songoda.epicbosses.utils.RandomUtils;
@ -31,7 +32,7 @@ public class Disarm extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
public IOtherSkillDataElement getOtherSkillData() {
return null;
}

View File

@ -4,6 +4,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import org.bukkit.entity.LivingEntity;
@ -25,7 +26,7 @@ public class Fireball extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
public IOtherSkillDataElement getOtherSkillData() {
return null;
}

View File

@ -4,6 +4,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import org.bukkit.Location;
@ -26,7 +27,7 @@ public class Grapple extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
public IOtherSkillDataElement getOtherSkillData() {
return null;
}

View File

@ -4,6 +4,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import org.bukkit.entity.LivingEntity;
@ -24,7 +25,7 @@ public class Insidious extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
public IOtherSkillDataElement getOtherSkillData() {
return null;
}

View File

@ -4,6 +4,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import org.bukkit.Location;
@ -26,7 +27,7 @@ public class Knockback extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
public IOtherSkillDataElement getOtherSkillData() {
return null;
}

View File

@ -4,6 +4,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import org.bukkit.Location;
@ -25,7 +26,7 @@ public class Launch extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
public IOtherSkillDataElement getOtherSkillData() {
return null;
}

View File

@ -4,6 +4,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import org.bukkit.entity.LivingEntity;
@ -24,7 +25,7 @@ public class Lightning extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
public IOtherSkillDataElement getOtherSkillData() {
return null;
}

View File

@ -9,6 +9,7 @@ import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.elements.CustomMinionSkillElement;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.Message;
import com.songoda.epicbosses.utils.NumberUtils;
@ -43,13 +44,8 @@ public class Minions extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
Map<String, Object> map = new HashMap<>();
map.put("amount", 1);
map.put("minionToSpawn", "");
return map;
public IOtherSkillDataElement getOtherSkillData() {
return new CustomMinionSkillElement(1, "");
}
@Override

View File

@ -4,6 +4,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.skills.CustomSkillHandler;
import com.songoda.epicbosses.skills.Skill;
import com.songoda.epicbosses.skills.interfaces.ICustomSkillAction;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import com.songoda.epicbosses.skills.types.CustomSkillElement;
import com.songoda.epicbosses.utils.panel.base.ClickAction;
import org.bukkit.entity.LivingEntity;
@ -24,7 +25,7 @@ public class Warp extends CustomSkillHandler {
}
@Override
public Map<String, Object> getOtherSkillData() {
public IOtherSkillDataElement getOtherSkillData() {
return null;
}

View File

@ -1,6 +1,7 @@
package com.songoda.epicbosses.skills.elements;
import com.google.gson.annotations.Expose;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import lombok.Getter;
import lombok.Setter;
@ -9,8 +10,14 @@ import lombok.Setter;
* @version 1.0.0
* @since 10-Nov-18
*/
public class CustomCageSkillElement {
public class CustomCageSkillElement implements IOtherSkillDataElement {
@Expose @Getter @Setter private String flatType, wallType, insideType;
public CustomCageSkillElement(String flatType, String wallType, String insideType) {
this.flatType = flatType;
this.wallType = wallType;
this.insideType = insideType;
}
}

View File

@ -1,6 +1,7 @@
package com.songoda.epicbosses.skills.elements;
import com.google.gson.annotations.Expose;
import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement;
import lombok.Getter;
import lombok.Setter;
@ -11,7 +12,7 @@ import java.util.List;
* @version 1.0.0
* @since 13-Nov-18
*/
public class CustomMinionSkillElement {
public class CustomMinionSkillElement implements IOtherSkillDataElement {
@Expose @Getter @Setter private String minionToSpawn;
@Expose @Getter @Setter private Integer amount;

View File

@ -15,7 +15,7 @@ public interface ICustomSkillHandler extends ISkillHandler<CustomSkillElement> {
boolean doesUseMultiplier();
Map<String, Object> getOtherSkillData();
IOtherSkillDataElement getOtherSkillData();
List<ICustomSkillAction> getOtherSkillDataActions(Skill skill, CustomSkillElement customSkillElement);

View File

@ -0,0 +1,9 @@
package com.songoda.epicbosses.skills.interfaces;
/**
* @author Charles Cullen
* @version 1.0.0
* @since 07-Jan-19
*/
public interface IOtherSkillDataElement {
}

View File

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