feat: Added a `getTagsFromArgsMap` method in `TagReader`
I also removed some unused files that are no longer used.
This commit is contained in:
parent
11d8d9ce48
commit
38b0e3aa5c
|
@ -16,8 +16,6 @@ import com.sekwah.advancedportals.core.commands.subcommands.portal.*;
|
|||
import com.sekwah.advancedportals.core.config.RepositoryModule;
|
||||
import com.sekwah.advancedportals.core.data.DataStorage;
|
||||
import com.sekwah.advancedportals.ConfigRepository;
|
||||
import com.sekwah.advancedportals.core.registry.RegisterBuilder;
|
||||
import com.sekwah.advancedportals.core.registry.Registrar;
|
||||
import com.sekwah.advancedportals.core.util.InfoLogger;
|
||||
import com.sekwah.advancedportals.core.util.Lang;
|
||||
import com.sekwah.advancedportals.core.connector.command.CommandRegister;
|
||||
|
@ -71,12 +69,6 @@ public class AdvancedPortalsCore {
|
|||
this.onEnable();
|
||||
}
|
||||
|
||||
public void test() {
|
||||
Registrar registrar = RegisterBuilder.newBuilder()
|
||||
.inheritPermissions(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
private int checkMcVer(int[] mcVer) {
|
||||
int maxSupportedVer = 13;
|
||||
int minSupportedVer = 13;
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.sekwah.advancedportals.core.api.warphandler.TagHandler;
|
|||
import com.sekwah.advancedportals.core.data.DataTag;
|
||||
import com.sekwah.advancedportals.core.data.PlayerLocation;
|
||||
import com.sekwah.advancedportals.core.connector.container.PlayerContainer;
|
||||
import com.sekwah.advancedportals.core.util.TagReader;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -59,11 +60,8 @@ public class Destination {
|
|||
|
||||
public boolean portalActivate(PlayerContainer player, ActivationData data) {
|
||||
TagRegistry<Destination> tagRegistry = AdvancedPortalsCore.getDestinationTagRegistry();
|
||||
DataTag[] destiTags = new DataTag[args.size()];
|
||||
int i = 0;
|
||||
for(Map.Entry<String, String> entry : args.entrySet()) {
|
||||
destiTags[i++] = new DataTag(entry.getKey(), entry.getValue());
|
||||
}
|
||||
List<DataTag> destiTags = getArgs();
|
||||
|
||||
for(DataTag destiTag : destiTags) {
|
||||
TagHandler.Activation<Destination> activationHandler = tagRegistry.getActivationHandler(destiTag.NAME);
|
||||
if(activationHandler != null) {
|
||||
|
@ -81,11 +79,8 @@ public class Destination {
|
|||
|
||||
public void postActivate(PlayerContainer player, ActivationData data) {
|
||||
TagRegistry<Destination> tagRegistry = AdvancedPortalsCore.getDestinationTagRegistry();
|
||||
DataTag[] destiTags = new DataTag[args.size()];
|
||||
int i = 0;
|
||||
for(Map.Entry<String, String> entry : args.entrySet()) {
|
||||
destiTags[i++] = new DataTag(entry.getKey(), entry.getValue());
|
||||
}
|
||||
List<DataTag> destiTags = getArgs();
|
||||
|
||||
for(DataTag destiTag : destiTags) {
|
||||
TagHandler.Activation<Destination> activationHandler = tagRegistry.getActivationHandler(destiTag.NAME);
|
||||
if(activationHandler != null) {
|
||||
|
@ -95,10 +90,6 @@ public class Destination {
|
|||
}
|
||||
|
||||
public List<DataTag> getArgs() {
|
||||
List<DataTag> tagList = new ArrayList<>();
|
||||
for(Map.Entry<String, String> entry : this.args.entrySet()){
|
||||
tagList.add(new DataTag(entry.getKey(), entry.getValue()));
|
||||
}
|
||||
return tagList;
|
||||
return TagReader.getTagsFromArgsMap(args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.sekwah.advancedportals.core.api.warphandler.TagHandler;
|
|||
import com.sekwah.advancedportals.core.data.DataTag;
|
||||
import com.sekwah.advancedportals.core.data.PortalLocation;
|
||||
import com.sekwah.advancedportals.core.connector.container.PlayerContainer;
|
||||
import com.sekwah.advancedportals.core.util.TagReader;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -68,12 +69,8 @@ public class AdvancedPortal {
|
|||
public boolean activate(PlayerContainer player) {
|
||||
TagRegistry<AdvancedPortal> tagRegistry = AdvancedPortalsCore.getPortalTagRegistry();
|
||||
ActivationData data = new ActivationData();
|
||||
DataTag[] portalTags = new DataTag[args.size()];
|
||||
int i = 0;
|
||||
for(Map.Entry<String, String> entry : args.entrySet()) {
|
||||
portalTags[i++] = new DataTag(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
List<DataTag> portalTags = getArgs();
|
||||
|
||||
for(DataTag portalTag : portalTags) {
|
||||
TagHandler.Activation<AdvancedPortal> activationHandler = tagRegistry.getActivationHandler(portalTag.NAME);
|
||||
if(activationHandler != null) {
|
||||
|
@ -100,11 +97,7 @@ public class AdvancedPortal {
|
|||
}
|
||||
|
||||
public List<DataTag> getArgs() {
|
||||
List<DataTag> tagList = new ArrayList<>();
|
||||
for(Map.Entry<String, String> entry : this.args.entrySet()){
|
||||
tagList.add(new DataTag(entry.getKey(), entry.getValue()));
|
||||
}
|
||||
return tagList;
|
||||
return TagReader.getTagsFromArgsMap(args);
|
||||
}
|
||||
|
||||
public void setTriggerBlocks(String[] triggerBlocks) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.sekwah.advancedportals.core.connector.container.CommandSenderContaine
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandWithSubCommands implements CommandTemplate {
|
||||
|
@ -27,7 +28,7 @@ public class CommandWithSubCommands implements CommandTemplate {
|
|||
return hasRegistered || this.subCommandRegistry.registerSubCommand(arg,subCommand);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSubCommands(){
|
||||
public List<String> getSubCommands(){
|
||||
return this.subCommandRegistry.getSubCommands();
|
||||
}
|
||||
|
||||
|
@ -147,11 +148,21 @@ public class CommandWithSubCommands implements CommandTemplate {
|
|||
if(tabList == null) {
|
||||
return null;
|
||||
}
|
||||
for(String arg : tabList.toArray(new String[0])) {
|
||||
|
||||
Iterator<String> iter = tabList.iterator();
|
||||
while(iter.hasNext()) {
|
||||
String arg = iter.next();
|
||||
if(!arg.startsWith(lastArg.toLowerCase())) {
|
||||
tabList.remove(arg);
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
|
||||
// for(String arg : tabList.toArray(new String[0])) {
|
||||
// if(!arg.startsWith(lastArg.toLowerCase())) {
|
||||
// tabList.remove(arg);
|
||||
// }
|
||||
// }
|
||||
|
||||
return tabList;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.sekwah.advancedportals.core.commands.subcommands.portal;
|
|||
|
||||
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
|
||||
import com.sekwah.advancedportals.core.api.commands.SubCommand;
|
||||
import com.sekwah.advancedportals.core.registry.SubCmd;
|
||||
import com.sekwah.advancedportals.core.util.Lang;
|
||||
import com.sekwah.advancedportals.core.connector.container.CommandSenderContainer;
|
||||
|
||||
|
|
|
@ -7,6 +7,9 @@ import com.sekwah.advancedportals.core.AdvancedPortalsCore;
|
|||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
|
||||
public class DataStorage {
|
||||
|
||||
|
@ -46,6 +49,7 @@ public class DataStorage {
|
|||
T object = gson.fromJson(bufReader, dataHolder);
|
||||
return object;
|
||||
}
|
||||
|
||||
public <T> T loadJson(Class<T> dataHolder, String location) {
|
||||
InputStream jsonResource = this.loadResource(location);
|
||||
if(jsonResource == null) {
|
||||
|
@ -64,10 +68,8 @@ public class DataStorage {
|
|||
|
||||
public void storeJson(Object dataHolder, String location) {
|
||||
String json = gson.toJson(dataHolder);
|
||||
try {
|
||||
FileWriter fileWriter = new FileWriter(new File(this.dataFolder, location));
|
||||
try(FileWriter fileWriter = new FileWriter(new File(this.dataFolder, location))) {
|
||||
fileWriter.write(json);
|
||||
fileWriter.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -90,16 +92,19 @@ public class DataStorage {
|
|||
if(inputStream == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FileOutputStream outStream = new FileOutputStream(outFile);
|
||||
|
||||
byte[] buf = new byte[1024];
|
||||
int len;
|
||||
while ((len = inputStream.read(buf)) > 0) {
|
||||
outStream.write(buf, 0, len);
|
||||
}
|
||||
|
||||
Files.copy(inputStream, Paths.get(outFile.toURI()), StandardCopyOption.REPLACE_EXISTING);
|
||||
inputStream.close();
|
||||
outStream.close();
|
||||
|
||||
// FileOutputStream outStream = new FileOutputStream(outFile);
|
||||
//
|
||||
// byte[] buf = new byte[1024];
|
||||
// int len;
|
||||
// while ((len = inputStream.read(buf)) > 0) {
|
||||
// outStream.write(buf, 0, len);
|
||||
// }
|
||||
// inputStream.close();
|
||||
// outStream.close();
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
this.portalsCore.getInfoLogger().logWarning("Could not load " + fileLoc + ". The file does" +
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
public class AnnotationScanner {
|
||||
|
||||
public void registerSubCommands() {
|
||||
//AnnotationScanner.class.getClassLoader()
|
||||
}
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Cmd {
|
||||
String name();
|
||||
//TODO Convert to enum
|
||||
String parentCommand() default "";
|
||||
boolean isEnabled() default true;
|
||||
int minArgs() default 0;
|
||||
String description() default "";
|
||||
String[] permissions() default {};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
//TODO
|
||||
public class CommandErrorException extends Exception {
|
||||
private String reason;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
public class CommandException {
|
||||
private ErrorCode errorCode;
|
||||
private String message;
|
||||
|
||||
public CommandException(ErrorCode errorCode, String message) {
|
||||
this.errorCode = errorCode;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ErrorCode getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.sekwah.advancedportals.core.connector.container.CommandSenderContainer;
|
||||
|
||||
public interface CommandHandler {
|
||||
void onExecute(String commandName, String parentCommand, CommandSenderContainer sender, ImmutableList<String> args);
|
||||
|
||||
default void onCommandFailure(String[] command, CommandSenderContainer sender, CommandException exception, ImmutableList<String> args) {
|
||||
sender.sendMessage(exception.getMessage());
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
public enum ErrorCode {
|
||||
INSUFFICIENT_ARGUMENTS(""),
|
||||
NO_PERMISSION("");
|
||||
;
|
||||
|
||||
|
||||
ErrorCode(String message) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.reflect.ClassPath;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class RegisterBuilder<T extends CommandHandler> {
|
||||
public static RegisterBuilder newBuilder() {
|
||||
return new RegisterBuilder();
|
||||
}
|
||||
|
||||
private RegisterBuilder() {
|
||||
}
|
||||
|
||||
private boolean allowPermissionInheritance;
|
||||
private String scanDirectory;
|
||||
private final Class<T> genericType = (Class<T>) ((ParameterizedType) getClass()
|
||||
.getGenericSuperclass()).getActualTypeArguments()[0];
|
||||
|
||||
|
||||
public RegisterBuilder<T> inheritPermissions(boolean allowInheritance) {
|
||||
allowPermissionInheritance = allowInheritance;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RegisterBuilder<T> scanDirectory(String directoryName) {
|
||||
this.scanDirectory = directoryName;
|
||||
return this;
|
||||
}
|
||||
|
||||
//TODO I don't know if we want to use this as it is marked as Unstable.
|
||||
public Registrar<T> build() {
|
||||
// Table<String, String, T> commandMap = HashBasedTable.create();
|
||||
Map<Cmd, T> commandMap = new HashMap<>();
|
||||
ImmutableSet<ClassPath.ClassInfo> classInfo;
|
||||
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
ClassPath classPath = null;
|
||||
try {
|
||||
classPath = ClassPath.from(loader);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (null == scanDirectory || scanDirectory.isEmpty()) {
|
||||
classInfo = classPath.getTopLevelClasses(scanDirectory);
|
||||
} else {
|
||||
classInfo = classPath.getTopLevelClasses();
|
||||
}
|
||||
|
||||
//TODO implement blackout of already registered commands.
|
||||
//TODO If there are duplicates ignore them and throw a warning in console.
|
||||
Map<Cmd, Class<?>> commandClasses = classInfo.stream().map(ClassPath.ClassInfo::load)
|
||||
.filter(t -> t.isAnnotationPresent(Cmd.class))
|
||||
.filter(t -> t.isAssignableFrom(genericType))
|
||||
.collect(Collectors.toMap(k -> k.getAnnotation(Cmd.class), k -> k));
|
||||
|
||||
Stream<Map.Entry<Cmd, Class<?>>> result = commandClasses.entrySet().stream();
|
||||
|
||||
result.filter(c -> c.getKey().parentCommand().equals(""))
|
||||
.forEach(c -> {
|
||||
try {
|
||||
commandMap.put(c.getKey(), (T) c.getValue().newInstance());
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
result.filter(c -> c.getKey().parentCommand() != "")
|
||||
.forEach(c -> {
|
||||
try {
|
||||
commandMap.put(c.getKey(), (T) c.getValue().newInstance());
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
return new Registrar<>(allowPermissionInheritance, commandMap);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.inject.Singleton;
|
||||
import com.sekwah.advancedportals.core.connector.container.CommandSenderContainer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Singleton
|
||||
public class Registrar<T extends CommandHandler> implements CommandExecutor, TabCompleter {
|
||||
//Parent Command, Sub Command, Object
|
||||
private boolean allowPermissionInheritance;
|
||||
private Map<Cmd, T> commandMap = new HashMap<>();
|
||||
|
||||
protected Registrar(boolean allowPermissionInheritance, Map<Cmd, T> commandMap) {
|
||||
this.commandMap = commandMap;
|
||||
}
|
||||
|
||||
public boolean isAllowPermissionInheritance() {
|
||||
return allowPermissionInheritance;
|
||||
}
|
||||
|
||||
public Map<Cmd, T> getCommandMap() {
|
||||
return commandMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Stream<Map.Entry<Cmd, T>> topLevelCommands = commandMap.entrySet().stream()
|
||||
.filter(c->c.getKey().name().equals(args[0]) || c.getKey().parentCommand().equals(args[0]));
|
||||
|
||||
Optional<Map.Entry<Cmd, T>> results = topLevelCommands.filter(c->c.getKey().name().equals(args[1])).findFirst();
|
||||
String[] commands = null;
|
||||
Map.Entry<Cmd, T> key = null;
|
||||
|
||||
|
||||
if (results.isPresent()) {
|
||||
args[0] = null;
|
||||
args[1] = null;
|
||||
commands = new String[]{args[0], args[1]};
|
||||
|
||||
key = results.get();
|
||||
} else {
|
||||
commands = new String[]{args[0]};
|
||||
key = topLevelCommands
|
||||
.filter(c->c.getKey().name().equals(args[0]) && c.getKey().parentCommand().equals(""))
|
||||
.findFirst().get();
|
||||
}
|
||||
|
||||
if (args[0].length() >= key.getKey().minArgs()) {
|
||||
|
||||
} else {
|
||||
commands = new String[]{args[0], args[1]};
|
||||
//TODO ????
|
||||
key.getValue().onCommandFailure(commands, (CommandSenderContainer) sender, new CommandException(ErrorCode.INSUFFICIENT_ARGUMENTS, ""),
|
||||
ImmutableList.copyOf(Arrays.asList(args)));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package com.sekwah.advancedportals.core.registry;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
//There is no reason to run a double class file when we can just make the main command default out.
|
||||
@Deprecated()
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SubCmd {
|
||||
|
||||
TYPE parent();
|
||||
|
||||
String name();
|
||||
|
||||
int minArgs();
|
||||
|
||||
String[] permissions();
|
||||
|
||||
public enum TYPE {
|
||||
PORTAL,
|
||||
DESTI
|
||||
}
|
||||
|
||||
}
|
|
@ -4,10 +4,7 @@ import com.sekwah.advancedportals.core.AdvancedPortalsCore;
|
|||
import com.sekwah.advancedportals.core.api.commands.SubCommand;
|
||||
import com.sekwah.advancedportals.core.util.InfoLogger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Do not register to here. Register to the sprcific subcommand registry classes.
|
||||
|
@ -23,7 +20,7 @@ public class SubCommandRegistry {
|
|||
/**
|
||||
* List of subcommand names which should be in order alphabetically
|
||||
*/
|
||||
protected ArrayList<String> subCommands = new ArrayList<>();
|
||||
protected List<String> subCommands = new ArrayList<>();
|
||||
|
||||
private InfoLogger infoLogger = AdvancedPortalsCore.getInstance().getInfoLogger();
|
||||
|
||||
|
@ -56,7 +53,7 @@ public class SubCommandRegistry {
|
|||
/**
|
||||
* @return a list of arguments of registered subcommands
|
||||
*/
|
||||
public ArrayList<String> getSubCommands(){
|
||||
public List<String> getSubCommands(){
|
||||
return this.subCommands;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,10 +4,7 @@ import com.google.inject.Inject;
|
|||
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
|
||||
import com.sekwah.advancedportals.core.api.warphandler.TagHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Allows a portal to register a tag and add a handler. If a plugin wants to add functionality
|
||||
|
@ -116,8 +113,8 @@ public class TagRegistry<T> {
|
|||
* Returns a non referenced copy of the array list.
|
||||
* @return
|
||||
*/
|
||||
public ArrayList<String> getTags() {
|
||||
ArrayList<String> newArrayList = new ArrayList<>();
|
||||
public List<String> getTags() {
|
||||
List<String> newArrayList = new ArrayList<>();
|
||||
newArrayList.addAll(this.tags);
|
||||
return newArrayList;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.sekwah.advancedportals.core.data.DataTag;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class TagReader {
|
||||
|
||||
|
@ -39,6 +40,14 @@ public class TagReader {
|
|||
}
|
||||
return tags;
|
||||
}
|
||||
|
||||
public static List<DataTag> getTagsFromArgsMap(Map<String, String> args) {
|
||||
List<DataTag> tagList = new ArrayList<>();
|
||||
for(Map.Entry<String, String> entry : args.entrySet()) {
|
||||
tagList.add(new DataTag(entry.getKey(), entry.getValue()));
|
||||
}
|
||||
return tagList;
|
||||
}
|
||||
|
||||
|
||||
public static String getTag(String arg) {
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.io.IOException;
|
|||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Handles logic for all destination, this is a transient layer so it should
|
||||
|
@ -57,7 +58,7 @@ public class DestinationServices {
|
|||
|
||||
|
||||
|
||||
public Destination createDesti(String name, PlayerContainer player, PlayerLocation playerLocation, ArrayList<DataTag> tags) {
|
||||
public Destination createDesti(String name, PlayerContainer player, PlayerLocation playerLocation, List<DataTag> tags) {
|
||||
// TODO change to write messages
|
||||
if(name == null || name.equals("")) {
|
||||
player.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translate("desti.error.noname"));
|
||||
|
|
Loading…
Reference in New Issue