public void addSign(Location location, String target, String template, int priority, Player player) {
SignInstance existing = getSignInstanceByLocation(location);
if (existing != null) signInstances.remove(existing);
if (template.equals("")) template = "Default";
SignTemplate signTemplate = getSignTemplate(template);
if (signTemplate == null) {
BukkitMessageManager.sendMessage(player, "&cError while creating sign: Could not find template &e" + template + "&c.");
return;
}
boolean dynamic;
if (TimoCloudAPI.getUniversalAPI().getServerGroup(target) != null) dynamic = true;
else if (TimoCloudAPI.getUniversalAPI().getServer(target) != null) dynamic = false;
else {
BukkitMessageManager.sendMessage(player, "&cError while creating sign: Could not find group or server called &e" + target + "&c.");
return;
}
signInstances.put(location, new SignInstance(location, target, template, signTemplate, dynamic, priority));
BukkitMessageManager.sendMessage(player, "&aSuccessfully added sign. Please check the parsed data is correct: " +
"\n &eTarget&6: &3 " + target +
"\n &eIsGroup&6: &3 " + dynamic +
"\n &eTemplate&6: &3 " + signTemplate.getName() +
"\n &ePriority&6: &3 " + priority
);
saveSignInstances();
}