1.0.0-SNAPSHOT-U203

+ Added in MasterMessage Panel
+ Fixed up a few things for release of the plugin
This commit is contained in:
Charles 2019-01-20 04:42:17 +08:00
parent 12f6eeef41
commit e73e11308e
8 changed files with 71 additions and 28 deletions

View File

@ -46,7 +46,7 @@
</dependencies>
<build>
<finalName>${parent.artifactId}-${plugin.version}</finalName>
<finalName>${parent.artifactId}-${plugin.version} (1.13.x)</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -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

@ -66,9 +66,11 @@ public class BossShopPriceHandler implements IHandler {
event.setCancelled(true);
if(NumberUtils.get().isDouble(input)) {
getBossEntity().setPrice(NumberUtils.get().getDouble(input));
double amount = NumberUtils.get().getDouble(input);
getBossEntity().setPrice(amount);
getBossesFileManager().save();
setHandled(true);
Message.Boss_Edit_PriceSet.msg(getPlayer(), BossAPI.getBossEntityName(getBossEntity()), NumberUtils.get().formatDouble(amount));
finish();
} else {

View File

@ -102,7 +102,7 @@ public class BossPanelManager implements ILoadable, IReloadable {
@Getter private ISubVariablePanelHandler<BossEntity, EntityStatsElement> statisticMainEditMenu, entityTypeEditMenu;
@Getter private IVariablePanelHandler<BossEntity> mainBossEditMenu, dropsEditMenu, targetingEditMenu, skillsBossEditMenu, skillListBossEditMenu, commandsMainEditMenu, onSpawnCommandEditMenu,
onDeathCommandEditMenu, mainDropsEditMenu, mainTextEditMenu, mainTauntEditMenu, onSpawnTextEditMenu, onSpawnSubTextEditMenu, onDeathTextEditMenu, onDeathSubTextEditMenu, onDeathPositionTextEditMenu,
onTauntTextEditMenu, spawnItemEditMenu, bossShopEditMenu;
onTauntTextEditMenu, spawnItemEditMenu, bossShopEditMenu, bossSkillMasterMessageTextEditMenu;
@Getter private BossListEditorPanel equipmentListEditMenu, weaponListEditMenu, statisticListEditMenu;
@Getter private IVariablePanelHandler<Skill> mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel;
@ -461,6 +461,7 @@ public class BossPanelManager implements ILoadable, IReloadable {
PanelBuilder panelBuilder3 = new PanelBuilder(editor.getConfigurationSection("TauntEditorPanel"));
this.mainTextEditMenu = new TextMainEditorPanel(this, panelBuilder);
this.bossSkillMasterMessageTextEditMenu = new SkillMasterMessageTextEditorPanel(this, getListMenu("Boss.Text"), this.customBosses);
this.onSpawnSubTextEditMenu = new SpawnTextEditorPanel(this, panelBuilder1, this.customBosses);
this.onDeathSubTextEditMenu = new DeathTextEditorPanel(this, panelBuilder2, this.customBosses);
this.mainTauntEditMenu = new TauntTextEditorPanel(this, panelBuilder3, this.customBosses);
@ -566,6 +567,7 @@ public class BossPanelManager implements ILoadable, IReloadable {
PanelBuilder panelBuilder3 = new PanelBuilder(editor.getConfigurationSection("TauntEditorPanel"));
this.mainTextEditMenu.initializePanel(panelBuilder);
this.bossSkillMasterMessageTextEditMenu.initializePanel(getListMenu("Boss.Text"));
this.onSpawnSubTextEditMenu.initializePanel(panelBuilder1);
this.onDeathSubTextEditMenu.initializePanel(panelBuilder2);
this.mainTauntEditMenu.initializePanel(panelBuilder3);

View File

@ -94,6 +94,8 @@ public class MainBossEditPanel extends VariablePanelHandler<BossEntity> {
if(bossEntity.isEditing()) {
this.bossEntityManager.killAllHolders(bossEntity);
}
openFor(player, bossEntity);
} else {
List<String> incompleteThings = bossEntity.getIncompleteSectionsToEnable();

View File

@ -61,7 +61,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler<BossEntity> {
ServerUtils.get().runTaskAsync(() -> {
counter.getSlotsWith("OverallChance").forEach(slot -> panel.setOnClick(slot, getOverallChanceAction(bossEntity)));
counter.getSlotsWith("SkillList").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getSkillListBossEditMenu().openFor((Player) event.getWhoClicked(), bossEntity)));
counter.getSlotsWith("Message").forEach(slot -> panel.setOnClick(slot, getMessageAction()));
counter.getSlotsWith("Message").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getBossSkillMasterMessageTextEditMenu().openFor((Player) event.getWhoClicked(), bossEntity)));
});
panel.openFor(player);
@ -113,9 +113,4 @@ public class SkillMainEditorPanel extends VariablePanelHandler<BossEntity> {
openFor((Player) event.getWhoClicked(), bossEntity);
};
}
//TODO
private ClickAction getMessageAction() {
return event -> {};
}
}

View File

@ -0,0 +1,41 @@
package com.songoda.epicbosses.panel.bosses.text;
import com.songoda.epicbosses.CustomBosses;
import com.songoda.epicbosses.api.BossAPI;
import com.songoda.epicbosses.entity.BossEntity;
import com.songoda.epicbosses.managers.BossPanelManager;
import com.songoda.epicbosses.panel.handlers.SingleMessageListEditor;
import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler;
import com.songoda.epicbosses.utils.panel.builder.PanelBuilder;
/**
* @author Charles Cullen
* @version 1.0.0
* @since 20-Jan-19
*/
public class SkillMasterMessageTextEditorPanel extends SingleMessageListEditor<BossEntity> {
public SkillMasterMessageTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) {
super(bossPanelManager, panelBuilder, plugin);
}
@Override
public String getCurrent(BossEntity object) {
return object.getSkills().getMasterMessage();
}
@Override
public void updateMessage(BossEntity object, String newPath) {
object.getSkills().setMasterMessage(newPath);
}
@Override
public IVariablePanelHandler<BossEntity> getParentHolder() {
return this.bossPanelManager.getSkillsBossEditMenu();
}
@Override
public String getName(BossEntity object) {
return BossAPI.getBossEntityName(object);
}
}

View File

@ -67,6 +67,7 @@ public enum Message {
Boss_Edit_NotCompleteEnough("&c&l(!) &cThe boss is not set up enough to be enabled. Please make sure it has the following things: &f{0}&c Once these things are set try toggling again."),
Boss_Edit_DoesntExist("&c&l(!) &cThe specified boss does not exist. Please try again with the proper name. If you cannot figure it out please check the bosses.json file to find the one you're looking for."),
Boss_Edit_Price("&b&lEpicBosses &8» &7Please input the new price of the &f{0}&7 Boss Entity. Please do not add commas and only use numbers. To cancel this input in to chat &f- &7."),
Boss_Edit_PriceSet("&b&lEpicBosses &8» &7You have set the price of &f{0}&7 to &a$&f{1}&7."),
Boss_GiveEgg_NoPermission("&c&l(!) &cYou do not have access to this command."),
Boss_GiveEgg_InvalidArgs("&c&l(!) &cYou must use &n/boss giveegg [name] [player] (amount)&c to give an egg."),

View File

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