1.0.0-SNAPSHOT-U104

+ Added the CustomData button to MainSkillEditorPanel
+ Fixed issue with item type from editor.yml
This commit is contained in:
Charles 2018-12-02 19:33:26 +08:00
parent 5bb87ab6b9
commit b56dc45cf1
6 changed files with 63 additions and 26 deletions

View File

@ -82,24 +82,24 @@
</execution>
</executions>
</plugin>
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-antrun-plugin</artifactId>-->
<!--<version>1.8</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<phase>install</phase>-->
<!--<configuration>-->
<!--<target>-->
<!--<copy file="target/${build.finalName}.jar" tofile="D:/Servers/1.13.2/plugins/${build.finalName}.jar"/>-->
<!--</target>-->
<!--</configuration>-->
<!--<goals>-->
<!--<goal>run</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>install</phase>
<configuration>
<target>
<copy file="target/${build.finalName}.jar" tofile="D:/Servers/1.13.2/plugins/${build.finalName}.jar"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -259,7 +259,7 @@ DropsMainEditorPanel:
- '&7Here you can configure the drop systems'
- '&7the boss has when he dies.'
'4':
type: GUN_POWDER
type: GUNPOWDER
name: '&e&lNatural Drops'
lore:
- '&bCurrently: &f{naturalDrops}'
@ -1485,4 +1485,13 @@ PotionSkillEditorPanel:
type: PAPER
name: '&e&lGo Back'
lore:
- '&7Click here to go back.'
- '&7Click here to go back.'
CreatePotionEffectEditorPanel:
name: '&b&lCreate Potion Effect'
slots: 27
Settings:
emptySpaceFiller: true
EmptySpaceFiller:
type: WHITE_STAINED_GLASS_PANE
name: '&7'
Items:

View File

@ -68,12 +68,21 @@ public class CustomSkillsPanel extends MainListPanelHandler {
ItemStack itemStack = this.itemStackConverter.from(itemStackHolder);
Map<String, String> replaceMap = new HashMap<>();
String displayName = skill.getDisplayName();
String customMessage = skill.getCustomMessage();
Double radius = skill.getRadius();
String type = skill.getType();
if(customMessage == null || customMessage.equals("")) customMessage = "N/A";
if(radius == null) radius = 100.0;
if(displayName == null || displayName.equals("")) displayName = "N/A";
if(type == null || type.equals("")) type = "N/A";
replaceMap.put("{name}", name);
replaceMap.put("{type}", skill.getType());
replaceMap.put("{displayName}", skill.getDisplayName());
replaceMap.put("{customMessage}", skill.getCustomMessage());
replaceMap.put("{radius}", NumberUtils.get().formatDouble(skill.getRadius()));
replaceMap.put("{type}", type);
replaceMap.put("{displayName}", displayName);
replaceMap.put("{customMessage}", customMessage);
replaceMap.put("{radius}", NumberUtils.get().formatDouble(radius));
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Main.name"), replaceMap);
ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Skills.Main.lore"), replaceMap);

View File

@ -70,7 +70,7 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> {
PanelBuilderCounter counter = panel.getPanelBuilderCounter();
counter.getSlotsWith("Radius").forEach(slot -> panel.setOnClick(slot, getRadiusAction(skill)));
counter.getSlotsWith("CustomData").forEach(slot -> {});
counter.getSlotsWith("CustomData").forEach(slot -> panel.setOnClick(slot, getCustomDataAction(skill)));
counter.getSlotsWith("Mode").forEach(slot -> panel.setOnClick(slot, getModeAction(skill)));
counter.getSlotsWith("DisplayName").forEach(slot -> panel.setOnClick(slot, getDisplayNameAction(skill)));
counter.getSlotsWith("CustomMessage").forEach(slot -> panel.setOnClick(slot, getCustomMessageAction(skill)));
@ -92,6 +92,23 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> {
.addSlotCounter("Type");
}
private ClickAction getCustomDataAction(Skill skill) {
return event -> {
String type = skill.getType();
Player player = (Player) event.getWhoClicked();
if(type.equalsIgnoreCase("POTION")) {
this.bossPanelManager.getPotionSkillEditorPanel().openFor(player, skill);
} else if(type.equalsIgnoreCase("GROUP")) {
} else if(type.equalsIgnoreCase("CUSTOM")) {
} else if(type.equalsIgnoreCase("COMMAND")) {
}
};
}
private ClickAction getDisplayNameAction(Skill skill) {
return event -> {
Player player = (Player) event.getWhoClicked();

View File

@ -148,6 +148,8 @@ public class ItemStackUtils {
}
}
if(mat == null) return null;
ItemStack itemStack = new ItemStack(mat, amount, meta);
ItemMeta itemMeta = itemStack.getItemMeta();

View File

@ -20,7 +20,7 @@
<properties>
<!--<plugin.version>maven-version-number-SNAPSHOT-U90</plugin.version>-->
<plugin.version>1.0.0-U103</plugin.version>
<plugin.version>1.0.0-U104</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author>