Feature/1.19.4 #11
14 changed files with 91 additions and 81 deletions
|
@ -3,7 +3,7 @@ package nl.sbdeveloper.showcontrol;
|
|||
import co.aikar.commands.PaperCommandManager;
|
||||
import nl.sbdeveloper.showcontrol.api.ShowAPI;
|
||||
import nl.sbdeveloper.showcontrol.commands.ShowCMD;
|
||||
import nl.sbdeveloper.showcontrol.data.DataSaving;
|
||||
import nl.sbdeveloper.showcontrol.data.DataStorage;
|
||||
import nl.sbdeveloper.showcontrol.data.Shows;
|
||||
import nl.sbdeveloper.showcontrol.utils.Inventory;
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -16,26 +16,41 @@ public final class ShowControlPlugin extends JavaPlugin {
|
|||
public void onEnable() {
|
||||
instance = this;
|
||||
|
||||
getLogger().info("-------------------------------");
|
||||
getLogger().info("ShowControl v" + getDescription().getVersion());
|
||||
getLogger().info("Made by SBDeveloper");
|
||||
getLogger().info(" ");
|
||||
|
||||
getLogger().info("Loading commands...");
|
||||
final PaperCommandManager commandManager = new PaperCommandManager(this);
|
||||
commandManager.enableUnstableAPI("help");
|
||||
|
||||
commandManager.registerCommand(new ShowCMD());
|
||||
|
||||
commandManager.getCommandCompletions().registerCompletion("showname", c -> Shows.getShowsMap().keySet());
|
||||
commandManager.getCommandCompletions().registerCompletion("showtype", c -> ShowAPI.getTriggers().keySet());
|
||||
|
||||
getLogger().info("Loading GUI manageer...");
|
||||
Inventory.init();
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(this, DataSaving::load, 1L); //Load 1 tick later, because of multi world
|
||||
getLogger().info("Loading default triggers...");
|
||||
ShowAPI.index(ShowControlPlugin.class, "nl.sbdeveloper.showcontrol.api.triggers.impl");
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(this, () -> {
|
||||
getLogger().info("Loading data...");
|
||||
DataStorage.load();
|
||||
}, 1L); //Load 1 tick later, because of multi world
|
||||
|
||||
getLogger().info("Plugin enabled!");
|
||||
getLogger().info("-------------------------------");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
instance = null;
|
||||
|
||||
DataSaving.save();
|
||||
|
||||
getLogger().info("Saving data...");
|
||||
DataStorage.save();
|
||||
Shows.getShowsMap().values().forEach(show -> show.forEach(showCue -> showCue.getTask().remove()));
|
||||
|
||||
getLogger().info("Plugin disabled!");
|
||||
instance = null;
|
||||
}
|
||||
|
||||
public static ShowControlPlugin getInstance() {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package nl.sbdeveloper.showcontrol.api;
|
||||
|
||||
import lombok.experimental.StandardException;
|
||||
|
||||
@StandardException
|
||||
public class InvalidArgumentException extends Exception {
|
||||
}
|
|
@ -5,16 +5,16 @@ import nl.sbdeveloper.showcontrol.api.triggers.Trigger;
|
|||
import nl.sbdeveloper.showcontrol.api.triggers.TriggerIdentifier;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.reflections.Reflections;
|
||||
import org.reflections.scanners.MethodAnnotationsScanner;
|
||||
import org.reflections.scanners.Scanners;
|
||||
import org.reflections.scanners.SubTypesScanner;
|
||||
import org.reflections.util.ClasspathHelper;
|
||||
import org.reflections.util.ConfigurationBuilder;
|
||||
import org.reflections.util.FilterBuilder;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class ShowAPI {
|
||||
@Getter
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package nl.sbdeveloper.showcontrol.api.triggers;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
@ -11,4 +13,5 @@ public @interface TriggerIdentifier {
|
|||
String value();
|
||||
int minArgs() default 0;
|
||||
String argDesc() default "";
|
||||
Material item() default Material.NOTE_BLOCK;
|
||||
}
|
||||
|
|
|
@ -3,8 +3,9 @@ package nl.sbdeveloper.showcontrol.api.triggers.impl;
|
|||
import nl.sbdeveloper.showcontrol.api.triggers.Trigger;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.TriggerIdentifier;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
|
||||
@TriggerIdentifier(value = "animatronic", minArgs = 1, argDesc = "<name>")
|
||||
@TriggerIdentifier(value = "animatronic", minArgs = 1, argDesc = "<name>", item = Material.ARMOR_STAND)
|
||||
public class AnimaTrigger extends Trigger {
|
||||
public AnimaTrigger(String[] data) {
|
||||
super(data);
|
||||
|
|
|
@ -3,8 +3,9 @@ package nl.sbdeveloper.showcontrol.api.triggers.impl;
|
|||
import nl.sbdeveloper.showcontrol.api.triggers.Trigger;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.TriggerIdentifier;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
|
||||
@TriggerIdentifier(value = "command", minArgs = 1, argDesc = "<command ...>")
|
||||
@TriggerIdentifier(value = "command", minArgs = 1, argDesc = "<command ...>", item = Material.COMMAND_BLOCK)
|
||||
public class CommandTrigger extends Trigger {
|
||||
public CommandTrigger(String[] data) {
|
||||
super(data);
|
||||
|
|
|
@ -1,26 +1,23 @@
|
|||
package nl.sbdeveloper.showcontrol.api.triggers.impl;
|
||||
|
||||
import nl.sbdeveloper.showcontrol.api.InvalidArgumentException;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.Trigger;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.TriggerIdentifier;
|
||||
import nl.sbdeveloper.showcontrol.elements.Fireworks;
|
||||
import nl.sbdeveloper.showcontrol.utils.Color;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.*;
|
||||
|
||||
@TriggerIdentifier(value = "firework", minArgs = 5, argDesc = "<world> <x> <y> <z> <configuration ...>")
|
||||
@TriggerIdentifier(value = "firework", minArgs = 5, argDesc = "<world> <x> <y> <z> <configuration ...>", item = Material.FIREWORK_ROCKET)
|
||||
public class FireworkTrigger extends Trigger {
|
||||
private Fireworks.Firework fw;
|
||||
private Location spawnLoc;
|
||||
private final Fireworks.Firework fw;
|
||||
private final Location spawnLoc;
|
||||
|
||||
public FireworkTrigger(String[] data) {
|
||||
public FireworkTrigger(String[] data) throws InvalidArgumentException {
|
||||
super(data);
|
||||
|
||||
World w = Bukkit.getWorld(data[0]);
|
||||
if (w == null) {
|
||||
Bukkit.getLogger().info("De wereld is null!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided World in FireworkTrigger is null!");
|
||||
}
|
||||
|
||||
int x;
|
||||
|
@ -31,8 +28,7 @@ public class FireworkTrigger extends Trigger {
|
|||
y = Integer.parseInt(data[2]);
|
||||
z = Integer.parseInt(data[3]);
|
||||
} catch (NumberFormatException ex) {
|
||||
Bukkit.getLogger().info("De positie is incorrect!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided position in FireworkTrigger is invalid!");
|
||||
}
|
||||
|
||||
this.spawnLoc = new Location(w, x, y, z);
|
||||
|
|
|
@ -2,8 +2,9 @@ package nl.sbdeveloper.showcontrol.api.triggers.impl;
|
|||
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.Trigger;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.TriggerIdentifier;
|
||||
import org.bukkit.Material;
|
||||
|
||||
@TriggerIdentifier(value = "flamethrower", minArgs = 5, argDesc = "<world> <x> <y> <z> <delay>")
|
||||
@TriggerIdentifier(value = "flamethrower", minArgs = 5, argDesc = "<world> <x> <y> <z> <delay>", item = Material.FIRE)
|
||||
public class FlameThrowerTrigger extends Trigger {
|
||||
public FlameThrowerTrigger(String[] dataString) {
|
||||
super(dataString);
|
||||
|
@ -11,6 +12,6 @@ public class FlameThrowerTrigger extends Trigger {
|
|||
|
||||
@Override
|
||||
public void trigger() {
|
||||
|
||||
//TODO Implement
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package nl.sbdeveloper.showcontrol.api.triggers.impl;
|
||||
|
||||
import nl.sbdeveloper.showcontrol.api.InvalidArgumentException;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.Trigger;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.TriggerIdentifier;
|
||||
import nl.sbdeveloper.showcontrol.elements.Lasers;
|
||||
|
@ -10,17 +11,16 @@ import org.bukkit.World;
|
|||
@TriggerIdentifier(value = "laser", minArgs = 5, argDesc = "<name> <world> <x> <y> <z>")
|
||||
public class LaserTrigger extends Trigger {
|
||||
private final String name;
|
||||
private Location newLocation;
|
||||
private final Location newLocation;
|
||||
|
||||
public LaserTrigger(String[] data) {
|
||||
public LaserTrigger(String[] data) throws InvalidArgumentException {
|
||||
super(data);
|
||||
|
||||
this.name = data[0];
|
||||
|
||||
World w = Bukkit.getWorld(data[1]);
|
||||
if (w == null) {
|
||||
Bukkit.getLogger().info("De wereld is null!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided World in LaserTrigger is null!");
|
||||
}
|
||||
|
||||
int x;
|
||||
|
@ -31,8 +31,7 @@ public class LaserTrigger extends Trigger {
|
|||
y = Integer.parseInt(data[3]);
|
||||
z = Integer.parseInt(data[4]);
|
||||
} catch (NumberFormatException ex) {
|
||||
Bukkit.getLogger().info("De positie is null!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided position in LaserTrigger is invalid!");
|
||||
}
|
||||
|
||||
this.newLocation = new Location(w, x, y, z);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package nl.sbdeveloper.showcontrol.api.triggers.impl;
|
||||
|
||||
import nl.sbdeveloper.showcontrol.api.InvalidArgumentException;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.Trigger;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.TriggerIdentifier;
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -9,17 +10,16 @@ import org.bukkit.World;
|
|||
|
||||
@TriggerIdentifier(value = "particle", minArgs = 6, argDesc = "<world> <x> <y> <z> <type> <count>")
|
||||
public class ParticleTrigger extends Trigger {
|
||||
private Particle type;
|
||||
private Location spawnLoc;
|
||||
private int count;
|
||||
private final Particle type;
|
||||
private final Location spawnLoc;
|
||||
private final int count;
|
||||
|
||||
public ParticleTrigger(String[] data) {
|
||||
public ParticleTrigger(String[] data) throws InvalidArgumentException {
|
||||
super(data);
|
||||
|
||||
World w = Bukkit.getWorld(data[0]);
|
||||
if (w == null) {
|
||||
Bukkit.getLogger().info("De wereld is null!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided World in ParticleTrigger is null!");
|
||||
}
|
||||
|
||||
int x;
|
||||
|
@ -30,8 +30,7 @@ public class ParticleTrigger extends Trigger {
|
|||
y = Integer.parseInt(data[2]);
|
||||
z = Integer.parseInt(data[3]);
|
||||
} catch (NumberFormatException ex) {
|
||||
Bukkit.getLogger().info("De positie is incorrect!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided position in ParticleTrigger is invalid!");
|
||||
}
|
||||
|
||||
this.spawnLoc = new Location(w, x, y, z);
|
||||
|
@ -39,14 +38,13 @@ public class ParticleTrigger extends Trigger {
|
|||
try {
|
||||
this.type = Particle.valueOf(data[4]);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
Bukkit.getLogger().info("De particle " + data[4] + " bestaat niet!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided particle " + data[4] + " in ParticleTrigger does not exists!");
|
||||
}
|
||||
|
||||
try {
|
||||
this.count = Integer.parseInt(data[5]);
|
||||
} catch (NumberFormatException ex) {
|
||||
Bukkit.getLogger().info("Het aantal " + data[4] + " is incorrect!");
|
||||
throw new InvalidArgumentException("Provided count " + data[5] + " in ParticleTrigger is invalid!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package nl.sbdeveloper.showcontrol.api.triggers.impl;
|
||||
|
||||
import nl.sbdeveloper.showcontrol.api.InvalidArgumentException;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.Trigger;
|
||||
import nl.sbdeveloper.showcontrol.api.triggers.TriggerIdentifier;
|
||||
import nl.sbdeveloper.showcontrol.elements.Spots;
|
||||
|
@ -10,17 +11,16 @@ import org.bukkit.World;
|
|||
@TriggerIdentifier(value = "spot", minArgs = 5, argDesc = "<name> <world> <x> <y> <z>")
|
||||
public class SpotTrigger extends Trigger {
|
||||
private final String name;
|
||||
private Location newLocation;
|
||||
private final Location newLocation;
|
||||
|
||||
public SpotTrigger(String[] data) {
|
||||
public SpotTrigger(String[] data) throws InvalidArgumentException {
|
||||
super(data);
|
||||
|
||||
this.name = data[0];
|
||||
|
||||
World w = Bukkit.getWorld(data[1]);
|
||||
if (w == null) {
|
||||
Bukkit.getLogger().info("De wereld is null!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided World in SpotTrigger is null!");
|
||||
}
|
||||
|
||||
int x;
|
||||
|
@ -31,8 +31,7 @@ public class SpotTrigger extends Trigger {
|
|||
y = Integer.parseInt(data[3]);
|
||||
z = Integer.parseInt(data[4]);
|
||||
} catch (NumberFormatException ex) {
|
||||
Bukkit.getLogger().info("De positie is null!");
|
||||
return;
|
||||
throw new InvalidArgumentException("Provided position in SpotTrigger is invalid!");
|
||||
}
|
||||
|
||||
this.newLocation = new Location(w, x, y, z);
|
||||
|
|
|
@ -13,29 +13,20 @@ import org.bukkit.ChatColor;
|
|||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandAlias("mctpshow|show")
|
||||
@CommandAlias("showcontrol|sc")
|
||||
@CommandPermission("mctp.show")
|
||||
public class ShowCMD extends BaseCommand {
|
||||
/*
|
||||
/mctpshow create <Naam>
|
||||
/mctpshow delete <Naam>
|
||||
/mctpshow add <Naam> <Tijd> <Type> <Data ...>
|
||||
/mctpshow start <Naam>
|
||||
/mctpshow cancel <Naam>
|
||||
/mctpshow gui <Naam>
|
||||
*/
|
||||
|
||||
@Subcommand("create")
|
||||
@Description("")
|
||||
public void onCreate(CommandSender sender, @Single String name) {
|
||||
if (Shows.exists(name)) {
|
||||
sender.sendMessage(ChatColor.RED + "Die show bestaat al.");
|
||||
sender.sendMessage(ChatColor.RED + "That show already exists.");
|
||||
return;
|
||||
}
|
||||
|
||||
Shows.create(name);
|
||||
|
||||
sender.sendMessage(ChatColor.GREEN + "De show " + ChatColor.WHITE + name + ChatColor.GREEN + " is aangemaakt!");
|
||||
sender.sendMessage(ChatColor.GREEN + "The show " + ChatColor.WHITE + name + ChatColor.GREEN + " has been created!");
|
||||
}
|
||||
|
||||
@Subcommand("delete")
|
||||
|
@ -43,13 +34,13 @@ public class ShowCMD extends BaseCommand {
|
|||
@CommandCompletion("@showname")
|
||||
public void onDelete(CommandSender sender, @Single String name) {
|
||||
if (!Shows.exists(name)) {
|
||||
sender.sendMessage(ChatColor.RED + "Die show bestaat niet.");
|
||||
sender.sendMessage(ChatColor.RED + "That show doesn't exists.");
|
||||
return;
|
||||
}
|
||||
|
||||
Shows.delete(name);
|
||||
|
||||
sender.sendMessage(ChatColor.GREEN + "De show " + ChatColor.WHITE + name + ChatColor.GREEN + " is verwijderd!");
|
||||
sender.sendMessage(ChatColor.GREEN + "The show " + ChatColor.WHITE + name + ChatColor.GREEN + " has been removed!");
|
||||
}
|
||||
|
||||
@Subcommand("add")
|
||||
|
@ -57,7 +48,7 @@ public class ShowCMD extends BaseCommand {
|
|||
@CommandCompletion("@showname @empty @showtype")
|
||||
public void onAdd(CommandSender sender, String name, String time, String args) {
|
||||
if (!Shows.exists(name)) {
|
||||
sender.sendMessage(ChatColor.RED + "Die show bestaat niet.");
|
||||
sender.sendMessage(ChatColor.RED + "That show doesn't exists.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -65,7 +56,7 @@ public class ShowCMD extends BaseCommand {
|
|||
try {
|
||||
timeMilli = TimeUtil.toMilis(time);
|
||||
} catch (Exception e) {
|
||||
sender.sendMessage(ChatColor.RED + "Geef een correcte tijd mee.");
|
||||
sender.sendMessage(ChatColor.RED + "Provide a valid time, for example 5s (5 seconds) or 10m (10 minutes).");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -74,18 +65,18 @@ public class ShowCMD extends BaseCommand {
|
|||
data = ShowAPI.getTrigger(args);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
e.printStackTrace();
|
||||
sender.sendMessage(ChatColor.RED + "Er is iets fout gegaan! Vraag de server eigenaar voor meer informatie.");
|
||||
sender.sendMessage(ChatColor.RED + "Something went wrong! Please ask a server admin.");
|
||||
return;
|
||||
} catch (InvalidTriggerException e) {
|
||||
sender.sendMessage(ChatColor.RED + "De meegegeven trigger bestaat niet.");
|
||||
sender.sendMessage(ChatColor.RED + "The provided trigger does not exists.");
|
||||
return;
|
||||
} catch (TooFewArgumentsException e) {
|
||||
sender.sendMessage(ChatColor.RED + "Je hebt niet genoeg informatie meegeven voor de trigger.");
|
||||
sender.sendMessage(ChatColor.RED + "You did not provide enough information for the chosen trigger.");
|
||||
return;
|
||||
}
|
||||
|
||||
Shows.addPoint(name, timeMilli, data);
|
||||
sender.sendMessage(ChatColor.GREEN + "De show " + ChatColor.WHITE + name + ChatColor.GREEN + " bevat nu een extra punt!");
|
||||
sender.sendMessage(ChatColor.GREEN + "The show " + ChatColor.WHITE + name + ChatColor.GREEN + " now contains an extra point!");
|
||||
}
|
||||
|
||||
@Subcommand("start")
|
||||
|
@ -93,13 +84,13 @@ public class ShowCMD extends BaseCommand {
|
|||
@CommandCompletion("@showname")
|
||||
public void onStart(CommandSender sender, @Single String name) {
|
||||
if (!Shows.exists(name)) {
|
||||
sender.sendMessage(ChatColor.RED + "Die show bestaat niet.");
|
||||
sender.sendMessage(ChatColor.RED + "That show doesn't exists.");
|
||||
return;
|
||||
}
|
||||
|
||||
Shows.startShow(name);
|
||||
|
||||
sender.sendMessage(ChatColor.GREEN + "De show " + ChatColor.WHITE + name + ChatColor.GREEN + " is gestart!");
|
||||
sender.sendMessage(ChatColor.GREEN + "The show " + ChatColor.WHITE + name + ChatColor.GREEN + " has been started!");
|
||||
}
|
||||
|
||||
@Subcommand("cancel")
|
||||
|
@ -107,13 +98,13 @@ public class ShowCMD extends BaseCommand {
|
|||
@CommandCompletion("@showname")
|
||||
public void onCancel(CommandSender sender, @Single String name) {
|
||||
if (!Shows.exists(name)) {
|
||||
sender.sendMessage(ChatColor.RED + "Die show bestaat niet.");
|
||||
sender.sendMessage(ChatColor.RED + "That show doesn't exists.");
|
||||
return;
|
||||
}
|
||||
|
||||
Shows.cancelShow(name);
|
||||
|
||||
sender.sendMessage(ChatColor.GREEN + "De show " + ChatColor.WHITE + name + ChatColor.GREEN + " is gestopt!");
|
||||
sender.sendMessage(ChatColor.GREEN + "The show " + ChatColor.WHITE + name + ChatColor.GREEN + " has been stopped!");
|
||||
}
|
||||
|
||||
@Subcommand("gui")
|
||||
|
@ -121,7 +112,7 @@ public class ShowCMD extends BaseCommand {
|
|||
@CommandCompletion("@showname")
|
||||
public void onGUI(Player sender, @Single String name) {
|
||||
if (!Shows.exists(name)) {
|
||||
sender.sendMessage(ChatColor.RED + "Die show bestaat niet.");
|
||||
sender.sendMessage(ChatColor.RED + "That show doesn't exists.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import nl.sbdeveloper.showcontrol.utils.YamlFile;
|
|||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
public class DataSaving {
|
||||
public class DataStorage {
|
||||
private static final Map<String, YamlFile> files = new HashMap<>();
|
||||
|
||||
public static Map<String, YamlFile> getFiles() {
|
|
@ -11,7 +11,6 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -23,7 +22,7 @@ public class Shows {
|
|||
|
||||
public static void create(String name) {
|
||||
showsMap.put(name, new ArrayList<>());
|
||||
DataSaving.save();
|
||||
DataStorage.save();
|
||||
}
|
||||
|
||||
public static void delete(String name) {
|
||||
|
@ -45,7 +44,7 @@ public class Shows {
|
|||
public static void addPoint(String name, Long time, Trigger data) {
|
||||
if (!exists(name)) return;
|
||||
getPoints(name).add(new ShowCuePoint(time, data));
|
||||
DataSaving.save();
|
||||
DataStorage.save();
|
||||
}
|
||||
|
||||
public static void removePoint(String name, ShowCuePoint point) {
|
||||
|
@ -54,7 +53,7 @@ public class Shows {
|
|||
point.getTask().remove();
|
||||
showsMap.get(name).remove(point);
|
||||
|
||||
YamlFile data = DataSaving.getFiles().get(name);
|
||||
YamlFile data = DataStorage.getFiles().get(name);
|
||||
|
||||
data.getFile().set(point.getCueID().toString(), null);
|
||||
data.saveFile();
|
||||
|
|
Loading…
Add table
Reference in a new issue