mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-03-12 22:49:13 +01:00
1.0.0-SNAPSHOT-U120
+ Added the boss new message command
This commit is contained in:
parent
ebbfad3339
commit
0d31b2b008
1
TODO
1
TODO
@ -1,5 +1,4 @@
|
||||
-> Add the Custom Skill Editing GUIs
|
||||
-> Add the new Message aspect (via command)
|
||||
-> Add the new Skill aspect (via command)
|
||||
-> Add the DropTable Main Editing GUI (Will have buttons for DropType and Rewards)
|
||||
-> Add the DropTable Rewards Editing GUI
|
||||
|
@ -48,6 +48,9 @@ public class BossNewCmd extends SubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
//-------------------
|
||||
// C O M M A N D
|
||||
//-------------------
|
||||
if(args.length >= 4 && args[1].equalsIgnoreCase("command")) {
|
||||
String nameInput = args[2];
|
||||
|
||||
@ -56,32 +59,8 @@ public class BossNewCmd extends SubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
int length = args.length;
|
||||
List<String> commands = new ArrayList<>();
|
||||
StringBuilder current = new StringBuilder();
|
||||
List<String> commands = appendList(args);
|
||||
|
||||
for(int i = 4; i < length; i++) {
|
||||
String arg = args[i];
|
||||
|
||||
if(arg.contains("||")) {
|
||||
String[] split = arg.split("||");
|
||||
|
||||
current.append(split[0]);
|
||||
commands.add(current.toString());
|
||||
|
||||
if(split.length >= 2) {
|
||||
current = new StringBuilder(split[1]);
|
||||
} else {
|
||||
current = new StringBuilder();
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
current.append(arg);
|
||||
}
|
||||
|
||||
commands.add(current.toString());
|
||||
this.commandsFileManager.addNewCommand(nameInput, commands);
|
||||
this.commandsFileManager.save();
|
||||
|
||||
@ -89,6 +68,9 @@ public class BossNewCmd extends SubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
//-------------------
|
||||
// M E S S A G E
|
||||
//-------------------
|
||||
if(args.length >= 4 && args[1].equalsIgnoreCase("message")) {
|
||||
String nameInput = args[2];
|
||||
|
||||
@ -96,8 +78,19 @@ public class BossNewCmd extends SubCommand {
|
||||
Message.Boss_New_AlreadyExists.msg(sender, "Message");
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> messages = appendList(args);
|
||||
|
||||
this.messagesFileManager.addNewMessage(nameInput, messages);
|
||||
this.messagesFileManager.save();
|
||||
|
||||
Message.Boss_New_Message.msg(sender, nameInput);
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------
|
||||
// D R O P T A B L E
|
||||
//----------------------
|
||||
if(args.length == 4 && args[1].equalsIgnoreCase("droptable")) {
|
||||
String nameInput = args[2];
|
||||
String typeInput = args[3];
|
||||
@ -131,6 +124,9 @@ public class BossNewCmd extends SubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
//-------------------
|
||||
// S K I L L
|
||||
//-------------------
|
||||
if(args.length == 3 && args[1].equalsIgnoreCase("skill")) {
|
||||
//TODO: Complete new skill command
|
||||
|
||||
@ -140,4 +136,34 @@ public class BossNewCmd extends SubCommand {
|
||||
Message.Boss_New_InvalidArgs.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
private List<String> appendList(String[] args) {
|
||||
int length = args.length;
|
||||
List<String> listOfElement = new ArrayList<>();
|
||||
StringBuilder current = new StringBuilder();
|
||||
|
||||
for(int i = 4; i < length; i++) {
|
||||
String arg = args[i];
|
||||
|
||||
if(arg.contains("||")) {
|
||||
String[] split = arg.split("||");
|
||||
|
||||
current.append(split[0]);
|
||||
listOfElement.add(current.toString());
|
||||
|
||||
if(split.length >= 2) {
|
||||
current = new StringBuilder(split[1]);
|
||||
} else {
|
||||
current = new StringBuilder();
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
current.append(arg);
|
||||
}
|
||||
|
||||
listOfElement.add(current.toString());
|
||||
return listOfElement;
|
||||
}
|
||||
}
|
||||
|
@ -144,6 +144,7 @@ public enum Message {
|
||||
Boss_New_InvalidDropTableType("&c&l(!) &cThe specified DropTable type is invalid. Please use &fGive, Drop, Spray&c."),
|
||||
Boss_New_DropTable("&b&lEpicBosses &8» &7You have created a new drop table with the name &f{0}&7 and type &f{1}&7."),
|
||||
Boss_New_Command("&b&lEpicBosses &8» &7You have created a new command with the name &f{0}&7."),
|
||||
Boss_New_Message("&b&lEpicBosses &8» &7You have created a new message with the name &f{0}&7."),
|
||||
Boss_New_SomethingWentWrong("&c&l(!) &cSomething went wrong while trying to create a new &f{0}&c."),
|
||||
|
||||
Boss_Reload_NoPermission("&c&l(!) &cYou do not have access to this command."),
|
||||
|
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-U119</plugin.version>
|
||||
<plugin.version>1.0.0-U120</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