Merge branch 'master' into spigot

This commit is contained in:
sekwah 2018-02-22 03:45:05 +00:00
commit dd4c525942
5 changed files with 17 additions and 3 deletions

View File

@ -64,6 +64,8 @@ portal.error.invalidselection=You must have both pos1 and pos2 selected to creat
portal.error.takenname=The name given for the portal is already taken.
portal.error.selection.differentworlds=Both the selected points need to be in the same world.
desti.info.noargs=\u00A7cNo tags were given
command.error.noname= No name has been given.
desti.error.takenname=The name given for the portal is already taken.

View File

@ -113,4 +113,8 @@ public class AdvancedPortal {
public void setTriggerBlocks(String[] triggerBlocks) {
this.triggerBlocks = triggerBlocks;
}
public String[] getTriggerBlocks() {
return triggerBlocks;
}
}

View File

@ -12,7 +12,7 @@ public abstract class CreateSubCommand {
boolean partingValueWithSpaces = false;
String argBeingParsed = "";
String currentParsedValue = "";
for (int i = 2; i < args.length; i++) {
for (int i = 1; i < args.length; i++) {
if(partingValueWithSpaces) {
if(args[i].charAt(args[i].length() - 1) == '"') {
args[i] = args[i].substring(0, args[i].length() - 1);

View File

@ -29,8 +29,14 @@ public class CreateDestiSubCommand extends CreateSubCommand implements SubComman
if(desti != null) {
sender.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translateColor("command.createdesti.complete"));
sender.sendMessage(Lang.translateColor("command.create.tags"));
for (DataTag tag : desti.getArgs()) {
sender.sendMessage(tag.NAME + ":" + tag.VALUE);
ArrayList<DataTag> destiArgs = desti.getArgs();
if(destiArgs.size() == 0) {
sender.sendMessage(Lang.translateColor("desti.info.noargs"));
}
else {
for (DataTag tag : destiArgs) {
sender.sendMessage(tag.NAME + ":" + tag.VALUE);
}
}
}
} catch (PortalException portalTagExeption) {

View File

@ -11,6 +11,7 @@ import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer
import com.sekwah.advancedportals.coreconnector.container.PlayerContainer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CreatePortalSubCommand extends CreateSubCommand implements SubCommand {
@ -29,6 +30,7 @@ public class CreatePortalSubCommand extends CreateSubCommand implements SubComma
if(portal != null) {
sender.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translateColor("command.create.complete"));
sender.sendMessage(Lang.translateColor("command.create.tags"));
sender.sendMessage("triggerBlock:" + Arrays.toString(portal.getTriggerBlocks()));
for (DataTag tag: portal.getArgs()) {
sender.sendMessage(tag.NAME + ":" + tag.VALUE);
}