Search in sources :

Example 1 with RepeatingTrigger

use of io.github.wysohn.triggerreactor.core.manager.trigger.repeating.RepeatingTrigger in project TriggerReactor by wysohn.

the class TriggerReactorCore method onCommand.

public boolean onCommand(ICommandSender sender, String command, String[] args) {
    if (command.equalsIgnoreCase("triggerreactor")) {
        if (!sender.hasPermission(PERMISSION))
            return true;
        if (!isEnabled()) {
            sender.sendMessage("&cTriggerReactor is disabled. Check your latest.log to see why the plugin is not" + " loaded properly. If there was an error while loading, please report it through github issue" + " or our discord channel.");
            return true;
        }
        if (args.length > 0) {
            if (args[0].equalsIgnoreCase("debug")) {
                debugging = !debugging;
                String color;
                if (debugging) {
                    color = "a";
                } else {
                    color = "c";
                }
                sender.sendMessage("Debugging is set to &" + color + debugging);
                getLogger().info("Debugging state: " + debugging);
                return true;
            } else if (args[0].equalsIgnoreCase("version")) {
                sender.sendMessage("Current version: " + getVersion());
                return true;
            } else if (args[0].equalsIgnoreCase("click") || args[0].equalsIgnoreCase("c")) {
                if (args.length == 1) {
                    getScriptEditManager().startEdit(sender, "Click Trigger", "", new SaveHandler() {

                        @Override
                        public void onSave(String script) {
                            if (getClickManager().startLocationSet((IPlayer) sender, script)) {
                                sender.sendMessage("&7Now click the block to set click trigger.");
                            } else {
                                sender.sendMessage("&7Already on progress.");
                            }
                        }
                    });
                } else {
                    StringBuilder builder = new StringBuilder();
                    for (int i = 1; i < args.length; i++) builder.append(args[i]).append(" ");
                    if (getClickManager().startLocationSet((IPlayer) sender, builder.toString())) {
                        sender.sendMessage("&7Now click the block to set click trigger.");
                    } else {
                        sender.sendMessage("&7Already on progress.");
                    }
                }
                return true;
            } else if (args[0].equalsIgnoreCase("walk") || args[0].equalsIgnoreCase("w")) {
                if (args.length == 1) {
                    getScriptEditManager().startEdit(sender, "Walk Trigger", "", new SaveHandler() {

                        @Override
                        public void onSave(String script) {
                            if (getWalkManager().startLocationSet((IPlayer) sender, script)) {
                                sender.sendMessage("&7Now click the block to set walk trigger.");
                            } else {
                                sender.sendMessage("&7Already on progress.");
                            }
                        }
                    });
                } else {
                    StringBuilder builder = new StringBuilder();
                    for (int i = 1; i < args.length; i++) builder.append(args[i]).append(" ");
                    if (getWalkManager().startLocationSet((IPlayer) sender, builder.toString())) {
                        sender.sendMessage("&7Now click the block to set walk trigger.");
                    } else {
                        sender.sendMessage("&7Already on progress.");
                    }
                }
                return true;
            } else if (args.length > 1 && (args[0].equalsIgnoreCase("command") || args[0].equalsIgnoreCase("cmd"))) {
                if (args.length == 3 && getCmdManager().has(args[1]) && args[2].equals("sync")) {
                    Trigger trigger = getCmdManager().get(args[1]);
                    trigger.setSync(!trigger.isSync());
                    sender.sendMessage("&7Sync mode: " + (trigger.isSync() ? "&a" : "&c") + trigger.isSync());
                    saveAsynchronously(getCmdManager());
                } else if (args.length > 2 && getCmdManager().has(args[1]) && (args[2].equals("p") || args[2].equals("permission"))) {
                    CommandTrigger trigger = getCmdManager().get(args[1]);
                    // if no permission is given, delete all permission required
                    String[] permissions = null;
                    if (args.length == 3) {
                        trigger.setPermissions(null);
                    } else {
                        permissions = new String[args.length - 3];
                        for (int i = 3; i < args.length; i++) {
                            permissions[i - 3] = args[i];
                        }
                        trigger.setPermissions(permissions);
                    }
                    if (permissions == null) {
                        sender.sendMessage("&7Cleared permissions");
                    } else {
                        sender.sendMessage("&7Set permissions.");
                    }
                    saveAsynchronously(getCmdManager());
                } else if (args.length > 2 && getCmdManager().has(args[1]) && (args[2].equals("a") || args[2].equals("aliases"))) {
                    CommandTrigger trigger = getCmdManager().get(args[1]);
                    // if no aliases are given, delete all aliases
                    String[] aliases = null;
                    if (args.length == 3) {
                        trigger.setAliases(null);
                    } else {
                        aliases = new String[args.length - 3];
                        for (int i = 3; i < args.length; i++) {
                            aliases[i - 3] = args[i];
                        }
                        trigger.setAliases(aliases);
                    }
                    if (aliases == null) {
                        sender.sendMessage("&7Cleared aliases");
                    } else {
                        sender.sendMessage("&7Set Aliases");
                    }
                    saveAsynchronously(getCmdManager());
                    getCmdManager().reregisterCommand(args[1]);
                } else if (args.length > 2 && getCmdManager().has(args[1]) && (args[2].equals("tab") || args[2].equals("settab"))) {
                    TriggerInfo info = Optional.of(getCmdManager()).map(man -> man.get(args[1])).map(Trigger::getInfo).orElseThrow(() -> new RuntimeException("Missing TriggerInfo"));
                    // trg cmd <name> settab a b c
                    List<Map<String, Object>> tabs = new ArrayList<>();
                    for (int i = 3; i < args.length; i++) {
                        String[] split = args[i].split(":", 2);
                        String hint = split.length == 2 ? split[0] : null;
                        String values = split.length == 2 ? split[1] : split[0];
                        Map<String, Object> tab = new LinkedHashMap<>();
                        if (hint != null)
                            tab.put(AbstractCommandTriggerManager.HINT, hint);
                        tab.put(AbstractCommandTriggerManager.CANDIDATES, values);
                        tabs.add(tab);
                    }
                    info.getConfig().put(AbstractCommandTriggerManager.TABS, tabs);
                    getCmdManager().reload(args[1]);
                    sender.sendMessage("&7Set tab-completer");
                } else if (getCmdManager().has(args[1])) {
                    Trigger trigger = getCmdManager().get(args[1]);
                    getScriptEditManager().startEdit(sender, trigger.getInfo().getTriggerName(), trigger.getScript(), new SaveHandler() {

                        @Override
                        public void onSave(String script) {
                            try {
                                trigger.setScript(script);
                            } catch (Exception e) {
                                handleException(sender, e);
                            }
                            sender.sendMessage("&aScript is updated!");
                            saveAsynchronously(getCmdManager());
                        }
                    });
                } else {
                    if (args.length == 2) {
                        getScriptEditManager().startEdit(sender, "Command Trigger", "", new SaveHandler() {

                            @Override
                            public void onSave(String script) {
                                getCmdManager().addCommandTrigger(sender, args[1], script);
                                sender.sendMessage("&aCommand trigger is binded!");
                                saveAsynchronously(getCmdManager());
                            }
                        });
                    } else {
                        StringBuilder builder = new StringBuilder();
                        for (int i = 2; i < args.length; i++) builder.append(args[i] + " ");
                        getCmdManager().addCommandTrigger(sender, args[1], builder.toString());
                        sender.sendMessage("&aCommand trigger is binded!");
                        saveAsynchronously(getCmdManager());
                    }
                }
                return true;
            } else if ((args[0].equalsIgnoreCase("variables") || args[0].equalsIgnoreCase("vars"))) {
                if (args.length == 3) {
                    if (args[1].equalsIgnoreCase("Item")) {
                        String name = args[2];
                        if (!GlobalVariableManager.isValidName(name)) {
                            sender.sendMessage("&c" + name + " is not a valid key!");
                            return true;
                        }
                        IItemStack IS = ((IPlayer) sender).getItemInMainHand();
                        if (IS == null) {
                            sender.sendMessage("&c" + "You are holding nothing on your main hand!");
                            return true;
                        }
                        try {
                            getVariableManager().put(name, IS.get());
                        } catch (Exception e) {
                            this.handleException(sender, e);
                        }
                        sender.sendMessage("&aItem saved!");
                    } else if (args[1].equalsIgnoreCase("Location")) {
                        String name = args[2];
                        if (!GlobalVariableManager.isValidName(name)) {
                            sender.sendMessage("&c" + name + " is not a valid key!");
                            return true;
                        }
                        ILocation loc = ((IPlayer) sender).getLocation();
                        try {
                            getVariableManager().put(name, loc.get());
                        } catch (Exception e) {
                            this.handleException(sender, e);
                        }
                        sender.sendMessage("&aLocation saved!");
                    } else {
                        String name = args[1];
                        String value = args[2];
                        if (!GlobalVariableManager.isValidName(name)) {
                            sender.sendMessage("&c" + name + " is not a valid key!");
                            return true;
                        }
                        if (INTEGER_PATTERN.matcher(value).matches()) {
                            try {
                                getVariableManager().put(name, Integer.parseInt(value));
                            } catch (Exception e) {
                                this.handleException(sender, e);
                            }
                        } else if (DECIMAL_PATTERN.matcher(value).matches()) {
                            try {
                                getVariableManager().put(name, Double.parseDouble(value));
                            } catch (Exception e) {
                                this.handleException(sender, e);
                            }
                        } else if (value.equals("true") || value.equals("false")) {
                            try {
                                getVariableManager().put(name, Boolean.parseBoolean(value));
                            } catch (Exception e) {
                                this.handleException(sender, e);
                            }
                        } else {
                            try {
                                getVariableManager().put(name, value);
                            } catch (Exception e) {
                                this.handleException(sender, e);
                            }
                        }
                        sender.sendMessage("&aVariable saved!");
                    }
                    return true;
                } else if (args.length == 2) {
                    String name = args[1];
                    sender.sendMessage("&7Value of " + name + ": " + getVariableManager().get(name));
                    return true;
                }
            } else if (args.length > 1 && args[0].equalsIgnoreCase("run")) {
                String script = mergeArguments(args, 1, args.length - 1);
                try {
                    Trigger trigger = getCmdManager().createTempCommandTrigger(script);
                    trigger.activate(createEmptyPlayerEvent(sender), new HashMap<>());
                } catch (Exception e) {
                    handleException(sender, e);
                }
                return true;
            } else if (args.length > 2 && args[0].equalsIgnoreCase("sudo")) {
                String playerName = args[1];
                String script = mergeArguments(args, 2, args.length - 1);
                IPlayer targetPlayer = getPlayer(playerName);
                if (targetPlayer == null) {
                    sender.sendMessage("&cNo such player named &6" + playerName + "&c!");
                    return true;
                }
                try {
                    Trigger trigger = getCmdManager().createTempCommandTrigger(script);
                    trigger.activate(createEmptyPlayerEvent(targetPlayer), new HashMap<>());
                } catch (Exception e) {
                    handleException(sender, e);
                }
                return true;
            } else if (args.length > 1 && args[0].equalsIgnoreCase("call")) {
                String namedTriggerName = args[1];
                String script = args.length > 2 ? mergeArguments(args, 2, args.length - 1) : "";
                try {
                    Trigger trigger = getCmdManager().createTempCommandTrigger(script);
                    Trigger targetTrigger = getNamedTriggerManager().get(namedTriggerName);
                    if (targetTrigger == null) {
                        sender.sendMessage("&cCannot find &6" + namedTriggerName + "&c! &7Remember that the folder" + " hierarchy is represented with ':' sign. (ex. FolderA:FolderB:Trigger)");
                        return true;
                    }
                    // shares same variable space
                    Map<String, Object> variables = new HashMap<>();
                    trigger.activate(createEmptyPlayerEvent(sender), variables);
                    targetTrigger.activate(createEmptyPlayerEvent(sender), variables);
                } catch (Exception e) {
                    handleException(sender, e);
                }
                return true;
            } else if (args[0].equalsIgnoreCase("inventory") || args[0].equalsIgnoreCase("i")) {
                if (args.length > 3 && args[2].equalsIgnoreCase("create")) {
                    String name = args[1];
                    int size = -1;
                    try {
                        size = Integer.parseInt(args[3]);
                    } catch (NumberFormatException e) {
                        sender.sendMessage("&c" + "" + size + " is not a valid number");
                        return true;
                    }
                    if (size > 54 || size < 9) {
                        sender.sendMessage("&csize must be between 9 and 54");
                        return true;
                    }
                    if (size % 9 != 0) {
                        sender.sendMessage("&csize must be a multiple of 9");
                        return true;
                    }
                    if (args.length == 4) {
                        final int sizeCopy = size;
                        getScriptEditManager().startEdit(sender, "Inventory Trigger", "", new SaveHandler() {

                            @Override
                            public void onSave(String script) {
                                try {
                                    if (getInvManager().createTrigger(sizeCopy, name, script)) {
                                        sender.sendMessage("&aInventory Trigger created!");
                                        saveAsynchronously(getInvManager());
                                    } else {
                                        sender.sendMessage("&7Another Inventory Trigger with that name already exists");
                                    }
                                } catch (Exception e) {
                                    handleException(sender, e);
                                }
                            }
                        });
                    } else {
                        String script = mergeArguments(args, 4, args.length - 1);
                        try {
                            if (getInvManager().createTrigger(size, name, script)) {
                                sender.sendMessage("&aInventory Trigger created!");
                                saveAsynchronously(getInvManager());
                            } else {
                                sender.sendMessage("&7Another Inventory Trigger with that name already exists");
                            }
                        } catch (Exception e) {
                            handleException(sender, e);
                        }
                    }
                } else if (args.length == 3 && args[2].equalsIgnoreCase("delete")) {
                    String name = args[1];
                    if (getInvManager().remove(name) != null) {
                        sender.sendMessage("&aDeleted!");
                        saveAsynchronously(getInvManager());
                    } else {
                        sender.sendMessage("&7No such inventory trigger found.");
                    }
                } else if (args.length == 4 && args[2].equals("item")) {
                    IItemStack IS = ((IPlayer) sender).getItemInMainHand();
                    IS = IS == null ? null : IS.clone();
                    String name = args[1];
                    int index;
                    try {
                        index = Integer.parseInt(args[3]);
                    } catch (NumberFormatException e) {
                        sender.sendMessage("&c" + "" + args[3] + " is not a valid number.");
                        return true;
                    }
                    InventoryTrigger trigger = getInvManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No such Inventory Trigger named " + name);
                        return true;
                    }
                    if (index > trigger.getItems().length || index < 1) {
                        sender.sendMessage("&c" + "" + index + " is out of bounds. (Size: " + (trigger.getItems().length) + ")");
                        return true;
                    }
                    trigger.getItems()[index - 1] = IS;
                    saveAsynchronously(getInvManager());
                    sender.sendMessage("Successfully set item " + index);
                } else if (args.length > 2 && args[2].equalsIgnoreCase("open")) {
                    String name = args[1];
                    IPlayer forWhom = null;
                    if (args.length == 3) {
                        forWhom = (IPlayer) sender;
                    } else {
                        IPlayer p = getPlayer(args[3]);
                        if (p != null)
                            forWhom = p;
                    }
                    if (forWhom == null) {
                        sender.sendMessage("&7Can't find that player.");
                        return true;
                    }
                    IInventory opened = getInvManager().openGUI(forWhom, name);
                    if (opened == null) {
                        sender.sendMessage("&7No such Inventory Trigger named " + name);
                        return true;
                    }
                } else if (args.length == 3 && args[2].equalsIgnoreCase("edit")) {
                    String name = args[1];
                    InventoryTrigger trigger = getInvManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No such Inventory Trigger named " + name);
                        return true;
                    }
                    getScriptEditManager().startEdit(sender, trigger.getInfo().getTriggerName(), trigger.getScript(), new SaveHandler() {

                        @Override
                        public void onSave(String script) {
                            try {
                                trigger.setScript(script);
                            } catch (Exception e) {
                                handleException(sender, e);
                            }
                            sender.sendMessage("&aScript is updated!");
                            saveAsynchronously(getInvManager());
                        }
                    });
                } else if (args.length == 4 && args[2].equals("row")) {
                    IItemStack IS = ((IPlayer) sender).getItemInMainHand();
                    IS = IS == null ? null : IS.clone();
                    String name = args[1];
                    int index;
                    try {
                        index = Integer.parseInt(args[3]);
                    } catch (NumberFormatException e) {
                        sender.sendMessage("&c" + "" + args[3] + " is not a valid number.");
                        return true;
                    }
                    InventoryTrigger trigger = getInvManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No such Inventory Trigger named " + name);
                        return true;
                    }
                    int rows = trigger.getItems().length / 9;
                    if (index > rows || index < 1) {
                        sender.sendMessage("&c" + "" + index + " is out of bounds. (Maximum: " + rows + ")");
                        return true;
                    }
                    for (int i = 0; i < 9; i++) {
                        trigger.getItems()[(index - 1) * 9 + i] = IS;
                    }
                    saveAsynchronously(getInvManager());
                    sender.sendMessage("Successfully filled row " + index);
                } else if (args.length == 4 && args[2].equals("column")) {
                    IItemStack IS = ((IPlayer) sender).getItemInMainHand();
                    IS = IS == null ? null : IS.clone();
                    String name = args[1];
                    int index;
                    try {
                        index = Integer.parseInt(args[3]);
                    } catch (NumberFormatException e) {
                        sender.sendMessage("&c" + "" + args[3] + " is not a valid number.");
                        return true;
                    }
                    InventoryTrigger trigger = getInvManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No such Inventory Trigger named " + name);
                        return true;
                    }
                    int rows = trigger.getItems().length / 9;
                    if (index > 9 || index < 1) {
                        sender.sendMessage("&c" + "" + index + " is out of bounds. (Maximum: 9)");
                        return true;
                    }
                    for (int i = 0; i < rows; i++) {
                        trigger.getItems()[index - 1 + i * 9] = IS;
                    }
                    saveAsynchronously(getInvManager());
                    sender.sendMessage("Successfully filled column " + index);
                } else if (args.length == 3 && args[2].equalsIgnoreCase("edititems")) {
                    String name = args[1];
                    InventoryTrigger trigger = getInvManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No such Inventory Trigger named " + name);
                        return true;
                    }
                    getInvEditManager().startEdit((IPlayer) sender, trigger);
                    return true;
                } else {
                    sendCommandDesc(sender, "/triggerreactor[trg] inventory[i] <inventory name> create <size> [...]", "create a new inventory. <size> must be multiple of 9." + " The <size> cannot be larger than 54");
                    sendDetails(sender, "/trg i MyInventory create 54");
                    sendCommandDesc(sender, "/triggerreactor[trg] inventory[i] <inventory name> delete", "delete this inventory");
                    sendDetails(sender, "/trg i MyInventory delete");
                    sendCommandDesc(sender, "/triggerreactor[trg] inventory[i] <inventory name> item <index>", "sets item of inventory to the held item. " + "Clears the slot if you are holding nothing.");
                    sendDetails(sender, "/trg i MyInventory item 0");
                    sendCommandDesc(sender, "/triggerreactor[trg] inventory[i] <inventory name> column <index>", "same as the item subcommand, but applied to an entire column." + "Clears the slot if you are holding nothing.");
                    sendCommandDesc(sender, "/triggerreactor[trg] inventory[i] <inventory name> row <index>", "same as the item subcommand, but applied to an entire row.");
                    sendCommandDesc(sender, "/triggerreactor[trg] inventory[i] <inventory name> open", "Preview the inventory");
                    sendCommandDesc(sender, "/triggerreactor[trg] inventory[i] <inventory name> open <player name>", "Send <player name> a preview of the inventory");
                    sendCommandDesc(sender, "/triggerreactor[trg] inventory[i] <inventory name> edit", "Edit the inventory trigger.");
                }
                return true;
            } else if (args[0].equalsIgnoreCase("item")) {
                if (args.length > 2 && args[1].equalsIgnoreCase("title")) {
                    IItemStack IS = ((IPlayer) sender).getItemInMainHand();
                    if (IS == null) {
                        sender.sendMessage("&c" + "You are holding nothing.");
                        return true;
                    }
                    String title = mergeArguments(args, 2, args.length - 1);
                    setItemTitle(IS, title);
                    ((IPlayer) sender).setItemInMainHand(IS);
                    return true;
                } else if (args.length > 3 && args[1].equalsIgnoreCase("lore") && args[2].equalsIgnoreCase("add")) {
                    IItemStack IS = ((IPlayer) sender).getItemInMainHand();
                    if (IS == null) {
                        sender.sendMessage("&c" + "You are holding nothing.");
                        return true;
                    }
                    String lore = mergeArguments(args, 3, args.length - 1);
                    addItemLore(IS, lore);
                    ((IPlayer) sender).setItemInMainHand(IS);
                    return true;
                } else if (args.length > 4 && args[1].equalsIgnoreCase("lore") && args[2].equalsIgnoreCase("set")) {
                    IItemStack IS = ((IPlayer) sender).getItemInMainHand();
                    if (IS == null) {
                        sender.sendMessage("&c" + "You are holding nothing.");
                        return true;
                    }
                    int index = -1;
                    try {
                        index = Integer.parseInt(args[3]);
                    } catch (NumberFormatException e) {
                        sender.sendMessage("&c" + "" + index + " is not a valid number");
                        return true;
                    }
                    String lore = mergeArguments(args, 4, args.length - 1);
                    if (!setLore(IS, index - 1, lore)) {
                        sender.sendMessage("&c" + "" + index + " is out of bounds.");
                        return true;
                    }
                    ((IPlayer) sender).setItemInMainHand(IS);
                    return true;
                } else if (args.length == 4 && args[1].equalsIgnoreCase("lore") && args[2].equalsIgnoreCase("remove")) {
                    IItemStack IS = ((IPlayer) sender).getItemInMainHand();
                    if (IS == null) {
                        sender.sendMessage("&c" + "You are holding nothing.");
                        return true;
                    }
                    int index = -1;
                    try {
                        index = Integer.parseInt(args[3]);
                    } catch (NumberFormatException e) {
                        sender.sendMessage("&c" + "" + index + " is not a valid number");
                        return true;
                    }
                    if (!removeLore(IS, index - 1)) {
                        sender.sendMessage("&7No lore at index " + index);
                        return true;
                    }
                    ((IPlayer) sender).setItemInMainHand(IS);
                    return true;
                } else {
                    sendCommandDesc(sender, "/triggerreactor[trg] item title <item title>", "Change the title of holding item");
                    sendCommandDesc(sender, "/triggerreactor[trg] item lore add <line>", "Append lore to the holding item");
                    sendCommandDesc(sender, "/triggerreactor[trg] item lore set <index> <line>", "Replace lore at the specified index." + "(Index start from 0)");
                    sendCommandDesc(sender, "/triggerreactor[trg] item lore remove <index>", "Delete lore at the specified index.");
                }
                return true;
            } else if (args.length > 0 && (args[0].equalsIgnoreCase("area") || args[0].equalsIgnoreCase("a"))) {
                if (args.length == 2 && args[1].equalsIgnoreCase("toggle")) {
                    boolean result = getSelectionManager().toggleSelection(((IPlayer) sender).getUniqueId());
                    sender.sendMessage("&7Area selection mode enabled: &6" + result);
                } else if (args.length == 3 && args[2].equals("create")) {
                    String name = args[1];
                    // validate the name
                    if (!NAME_PATTERN.matcher(name).matches()) {
                        sender.sendMessage("&cThe name " + name + " has not allowed character!");
                        sender.sendMessage("&7Use only character, number, and underscore(_).");
                        return true;
                    }
                    AreaTrigger trigger = getAreaManager().get(name);
                    if (trigger != null) {
                        sender.sendMessage("&c" + "Area Trigger " + name + " is already exists!");
                        return true;
                    }
                    Area selected = getSelectionManager().getSelection(((IPlayer) sender).getUniqueId());
                    if (selected == null) {
                        sender.sendMessage("&7Invalid or incomplete area selection.");
                        return true;
                    }
                    Set<Area> conflicts = getAreaManager().getConflictingAreas(selected, selected::equals);
                    if (!conflicts.isEmpty()) {
                        sender.sendMessage("&7Found [" + conflicts.size() + "] conflicting areas:");
                        for (Area conflict : conflicts) {
                            sender.sendMessage("&d  " + conflict);
                        }
                        return true;
                    }
                    if (getAreaManager().createArea(name, selected.getSmallest(), selected.getLargest())) {
                        sender.sendMessage("&aCreated area trigger: " + name);
                        saveAsynchronously(getAreaManager());
                        getSelectionManager().resetSelections(((IPlayer) sender).getUniqueId());
                    } else {
                        sender.sendMessage("&7Area Trigger " + name + " already exists.");
                    }
                } else if (args.length == 3 && args[2].equals("delete")) {
                    String name = args[1];
                    if (getAreaManager().remove(name) != null) {
                        sender.sendMessage("&aArea Trigger deleted");
                        saveAsynchronously(getAreaManager());
                        getSelectionManager().resetSelections(((IPlayer) sender).getUniqueId());
                    } else {
                        sender.sendMessage("&7Area Trigger " + name + " does not exist.");
                    }
                } else if (args.length > 2 && args[2].equals("enter")) {
                    String name = args[1];
                    AreaTrigger trigger = getAreaManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Area Trigger found with that name.");
                        return true;
                    }
                    if (trigger.getEnterTrigger() != null) {
                        getScriptEditManager().startEdit(sender, trigger.getInfo().getTriggerName(), trigger.getEnterTrigger().getScript(), new SaveHandler() {

                            @Override
                            public void onSave(String script) {
                                try {
                                    trigger.setEnterTrigger(script);
                                    saveAsynchronously(getAreaManager());
                                    sender.sendMessage("&aScript is updated!");
                                } catch (Exception e) {
                                    handleException(sender, e);
                                }
                            }
                        });
                    } else {
                        if (args.length == 3) {
                            getScriptEditManager().startEdit(sender, "Area Trigger [Enter]", "", new SaveHandler() {

                                @Override
                                public void onSave(String script) {
                                    try {
                                        trigger.setEnterTrigger(script);
                                        saveAsynchronously(getAreaManager());
                                    } catch (Exception e) {
                                        handleException(sender, e);
                                    }
                                }
                            });
                        } else {
                            try {
                                trigger.setEnterTrigger(mergeArguments(args, 3, args.length - 1));
                                saveAsynchronously(getAreaManager());
                            } catch (Exception e) {
                                handleException(sender, e);
                            }
                        }
                    }
                } else if (args.length > 2 && args[2].equals("exit")) {
                    String name = args[1];
                    AreaTrigger trigger = getAreaManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Area Trigger found with that name.");
                        return true;
                    }
                    if (trigger.getExitTrigger() != null) {
                        getScriptEditManager().startEdit(sender, trigger.getInfo().getTriggerName(), trigger.getExitTrigger().getScript(), new SaveHandler() {

                            @Override
                            public void onSave(String script) {
                                try {
                                    trigger.setExitTrigger(script);
                                    saveAsynchronously(getAreaManager());
                                    sender.sendMessage("&aScript is updated!");
                                } catch (Exception e) {
                                    handleException(sender, e);
                                }
                            }
                        });
                    } else {
                        if (args.length == 3) {
                            getScriptEditManager().startEdit(sender, "Area Trigger [Exit]", "", new SaveHandler() {

                                @Override
                                public void onSave(String script) {
                                    try {
                                        trigger.setExitTrigger(script);
                                        saveAsynchronously(getAreaManager());
                                    } catch (Exception e) {
                                        handleException(sender, e);
                                    }
                                }
                            });
                        } else {
                            try {
                                trigger.setExitTrigger(mergeArguments(args, 3, args.length - 1));
                                saveAsynchronously(getAreaManager());
                            } catch (Exception e) {
                                handleException(sender, e);
                            }
                        }
                    }
                } else if (args.length == 3 && args[2].equals("sync")) {
                    String name = args[1];
                    AreaTrigger trigger = getAreaManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Area Trigger found with that name.");
                        return true;
                    }
                    trigger.setSync(!trigger.isSync());
                    saveAsynchronously(getAreaManager());
                    sender.sendMessage("&7Sync mode: " + (trigger.isSync() ? "&a" : "&c") + trigger.isSync());
                } else {
                    sendCommandDesc(sender, "/triggerreactor[trg] area[a] toggle", "Enable/Disable area selection mode.");
                    sendCommandDesc(sender, "/triggerreactor[trg] area[a] <name> create", "Create area trigger out of selected region.");
                    sendCommandDesc(sender, "/triggerreactor[trg] area[a] <name> delete", "Delete area trigger. BE CAREFUL!");
                    sendCommandDesc(sender, "/triggerreactor[trg] area[a] <name> enter [...]", "Enable/Disable area selection mode.");
                    sendDetails(sender, "/trg a TestingArea enter #MESSAGE \"Welcome\"");
                    sendCommandDesc(sender, "/triggerreactor[trg] area[a] <name> exit [...]", "Enable/Disable area selection mode.");
                    sendDetails(sender, "/trg a TestingArea exit #MESSAGE \"Bye\"");
                    sendCommandDesc(sender, "/triggerreactor[trg] area[a] <name> sync", "Enable/Disable sync mode.");
                    sendDetails(sender, "Setting it to true when you want to cancel event (with #CANCELEVENT)." + " However, setting sync mode will make the trigger run on server thread; keep in mind that" + " it can lag the server if you have too much things going on within the code." + " Set it to false always if you are not sure.");
                }
                return true;
            } else if (args.length > 2 && args[0].equalsIgnoreCase("custom")) {
                String eventName = args[1];
                String name = args[2];
                CustomTrigger trigger = getCustomManager().get(name);
                if (trigger != null) {
                    getScriptEditManager().startEdit(sender, trigger.getInfo().getTriggerName(), trigger.getScript(), new SaveHandler() {

                        @Override
                        public void onSave(String script) {
                            try {
                                trigger.setScript(script);
                            } catch (Exception e) {
                                handleException(sender, e);
                            }
                            sender.sendMessage("&aScript is updated!");
                            saveAsynchronously(getCustomManager());
                        }
                    });
                } else {
                    if (args.length == 3) {
                        getScriptEditManager().startEdit(sender, "Custom Trigger[" + eventName.substring(Math.max(0, eventName.length() - 10)) + "]", "", new SaveHandler() {

                            @Override
                            public void onSave(String script) {
                                try {
                                    getCustomManager().createCustomTrigger(eventName, name, script);
                                    saveAsynchronously(getCustomManager());
                                    sender.sendMessage("&aCustom Trigger created!");
                                } catch (Exception e) {
                                    e.printStackTrace();
                                    sender.sendMessage("&c" + "Could not save! " + e.getMessage());
                                    sender.sendMessage("&c" + "See console for detailed messages.");
                                }
                            }
                        });
                    } else {
                        String script = mergeArguments(args, 3, args.length - 1);
                        try {
                            getCustomManager().createCustomTrigger(eventName, name, script);
                            saveAsynchronously(getCustomManager());
                            sender.sendMessage("&aCustom Trigger created!");
                        } catch (ClassNotFoundException e2) {
                            sender.sendMessage("&c" + "Could not save! " + e2.getMessage());
                            sender.sendMessage("&c" + "Provided event name is not valid.");
                        } catch (Exception e) {
                            handleException(sender, e);
                        }
                    }
                }
                return true;
            } else if (args.length > 0 && (args[0].equalsIgnoreCase("repeat") || args[0].equalsIgnoreCase("r"))) {
                if (args.length == 2) {
                    String name = args[1];
                    Trigger trigger = getRepeatManager().get(name);
                    if (trigger != null) {
                        getScriptEditManager().startEdit(sender, trigger.getInfo().getTriggerName(), trigger.getScript(), new SaveHandler() {

                            @Override
                            public void onSave(String script) {
                                try {
                                    trigger.setScript(script);
                                } catch (Exception e) {
                                    handleException(sender, e);
                                }
                                sender.sendMessage("&aScript is updated!");
                                saveAsynchronously(getRepeatManager());
                            }
                        });
                    } else {
                        this.getScriptEditManager().startEdit(sender, "Repeating Trigger", "", new SaveHandler() {

                            @Override
                            public void onSave(String script) {
                                try {
                                    getRepeatManager().createTrigger(name, script);
                                } catch (Exception e) {
                                    handleException(sender, e);
                                }
                                saveAsynchronously(getRepeatManager());
                            }
                        });
                    }
                } else if (args.length == 4 && args[2].equalsIgnoreCase("interval")) {
                    String name = args[1];
                    RepeatingTrigger trigger = getRepeatManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Repeating Trigger with name " + name);
                        return true;
                    }
                    String intervalValue = args[3];
                    long interval = TimeUtil.parseTime(intervalValue);
                    trigger.setInterval(interval);
                    saveAsynchronously(getRepeatManager());
                    sender.sendMessage("&aNow " + "&6[" + name + "]" + "&a will run every " + "&6[" + TimeUtil.milliSecondsToString(interval) + "]");
                } else if (args.length == 3 && args[2].equalsIgnoreCase("autostart")) {
                    String name = args[1];
                    RepeatingTrigger trigger = getRepeatManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Repeating Trigger with name " + name);
                        return true;
                    }
                    trigger.setAutoStart(!trigger.isAutoStart());
                    saveAsynchronously(getRepeatManager());
                    sender.sendMessage("Auto start: " + (trigger.isAutoStart() ? "&a" : "&c") + trigger.isAutoStart());
                } else if (args.length == 3 && args[2].equalsIgnoreCase("toggle")) {
                    String name = args[1];
                    RepeatingTrigger trigger = getRepeatManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Repeating Trigger with name " + name);
                        return true;
                    }
                    if (getRepeatManager().isRunning(name)) {
                        getRepeatManager().stopTrigger(name);
                        sender.sendMessage("&aScheduled stop. It may take some time depends on CPU usage.");
                    } else {
                        getRepeatManager().startTrigger(name);
                        sender.sendMessage("&aScheduled start up. It may take some time depends on CPU usage.");
                    }
                } else if (args.length == 3 && args[2].equalsIgnoreCase("pause")) {
                    String name = args[1];
                    RepeatingTrigger trigger = getRepeatManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Repeating Trigger with name " + name);
                        return true;
                    }
                    trigger.setPaused(!trigger.isPaused());
                    sender.sendMessage("Paused: " + (trigger.isPaused() ? "&a" : "&c") + trigger.isPaused());
                } else if (args.length == 3 && args[2].equalsIgnoreCase("status")) {
                    String name = args[1];
                    RepeatingTrigger trigger = getRepeatManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Repeating Trigger with name " + name);
                        return true;
                    }
                    getRepeatManager().showTriggerInfo(sender, trigger);
                } else if (args.length == 3 && args[2].equalsIgnoreCase("delete")) {
                    String name = args[1];
                    RepeatingTrigger trigger = getRepeatManager().get(name);
                    if (trigger == null) {
                        sender.sendMessage("&7No Repeating Trigger with name " + name);
                        return true;
                    }
                    getRepeatManager().remove(name);
                } else {
                    sendCommandDesc(sender, "/triggerreactor[trg] repeat[r] <name>", "Create Repeating Trigger.");
                    sendDetails(sender, "&4Quick create is not supported.");
                    sendDetails(sender, "This creates a Repeating Trigger with default settings. You probably will want to change default values" + " using other commands below. Also, creating Repeating Trigger doesn't start it automatically.");
                    sendCommandDesc(sender, "/triggerreactor[trg] repeat[r] <name> interval <time format>", "Change the interval of this trigger.");
                    sendDetails(sender, "Notice the <time format> is not just a number but has specific format for it. For example, you first" + " type what number you want to set and also define the unit of it. If you want it to repeat it every 1 hour, 20 minutes," + " 50seconds, and 10ticks, then it will be &6" + "/trg r BlahBlah interval 1h20m50s10t." + "&7 Currently only h, m," + " s, and t are supported for this format. Also notice that if you have two numbers with same format, they will add up as well. For example," + "&6 /trg r BlahBlah interval 30s40s" + "&7 will be added up to 70seconds total. All units other than" + " h, m, s, or t will be ignored.");
                    sendCommandDesc(sender, "/triggerreactor[trg] repeat[r] <name> autostart", "Enable/Disable automatic start for this trigger.");
                    sendDetails(sender, "By setting this to " + "&atrue" + "&7, this trigger will start on plugin enables itself. " + "Otherwise, you have to start it yourself every time.");
                    sendCommandDesc(sender, "/triggerreactor[trg] repeat[r] <name> toggle", "Start or stop the Repeating Trigger.");
                    sendCommandDesc(sender, "/triggerreactor[trg] repeat[r] <name> pause", "Pause or unpause the Repeating Trigger.");
                    sendCommandDesc(sender, "/triggerreactor[trg] repeat[r] <name> status", "See brief information about this trigger.");
                    sendCommandDesc(sender, "/triggerreactor[trg] repeat[r] <name> delete", "Delete repeating trigger.");
                }
                return true;
            } else if (args.length == 2 && (args[0].equalsIgnoreCase("synccustom") || args[0].equalsIgnoreCase("sync"))) {
                String name = args[1];
                CustomTrigger trigger = getCustomManager().get(name);
                if (trigger == null) {
                    sender.sendMessage("&7No Custom Trigger found with that name.");
                    return true;
                }
                trigger.setSync(!trigger.isSync());
                saveAsynchronously(getCustomManager());
                sender.sendMessage("&7Sync mode: " + (trigger.isSync() ? "&a" : "&c") + trigger.isSync());
                return true;
            } else if (args.length == 3 && (args[0].equalsIgnoreCase("delete") || args[0].equalsIgnoreCase("del"))) {
                String key = args[2];
                switch(args[1]) {
                    case "vars":
                    case "variables":
                        getVariableManager().remove(key);
                        sender.sendMessage("&aRemoved the variable &6" + key);
                        break;
                    case "cmd":
                    case "command":
                        if (getCmdManager().remove(key) != null) {
                            sender.sendMessage("&aRemoved the command trigger &6" + key);
                            saveAsynchronously(getCmdManager());
                        } else {
                            sender.sendMessage("&7Command trigger &6" + key + "&7 does not exist");
                        }
                        break;
                    case "custom":
                        if (getCustomManager().remove(key) != null) {
                            sender.sendMessage("&aRemoved the custom trigger &6" + key);
                            saveAsynchronously(getCustomManager());
                        } else {
                            sender.sendMessage("&7Custom Trigger &6" + key + "&7 does not exist");
                        }
                        break;
                    default:
                        sender.sendMessage("Ex) /trg del vars player.count");
                        sender.sendMessage("List: variables[vars], command[cmd], custom");
                        break;
                }
                return true;
            } else if (args[0].equalsIgnoreCase("search")) {
                SimpleChunkLocation scloc = ((IPlayer) sender).getChunk();
                showGlowStones(sender, getClickManager().getTriggersInChunk(scloc));
                showGlowStones(sender, getWalkManager().getTriggersInChunk(scloc));
                sender.sendMessage("&7Now trigger blocks will be shown as &6" + "glowstone");
                return true;
            } else if (args[0].equalsIgnoreCase("list")) {
                sender.sendMessage("- - - - - Result - - - - ");
                for (Manager manager : Manager.getManagers()) {
                    if (!(manager instanceof AbstractTriggerManager<?>))
                        continue;
                    for (String val : ((AbstractTriggerManager<? extends Trigger>) manager).getTriggerList((name) -> {
                        for (int i = 1; i < args.length; i++) {
                            if (!name.contains(args[i]))
                                return false;
                        }
                        return true;
                    })) {
                        sender.sendMessage("&d" + val);
                    }
                }
                sender.sendMessage(" ");
                return true;
            } else if (args[0].equalsIgnoreCase("timings")) {
                if (args.length == 2 && args[1].equalsIgnoreCase("toggle")) {
                    Timings.on = !Timings.on;
                    if (Timings.on) {
                        sender.sendMessage("&aEnabled");
                    } else {
                        sender.sendMessage("&cDisabled");
                    }
                } else if (args.length == 2 && args[1].equalsIgnoreCase("reset")) {
                    Timings.reset();
                    sender.sendMessage("&aReset Complete.");
                } else if (args.length > 1 && args[1].equalsIgnoreCase("print")) {
                    OutputStream os;
                    if (args.length > 2) {
                        String fileName = args[2];
                        File folder = new File(getDataFolder(), "timings");
                        if (!folder.exists())
                            folder.mkdirs();
                        File file = new File(folder, fileName + ".timings");
                        if (file.exists())
                            file.delete();
                        try {
                            file.createNewFile();
                            os = new FileOutputStream(file);
                        } catch (IOException ex) {
                            ex.printStackTrace();
                            sender.sendMessage("&cCould not create log file. Check console for details.");
                            return true;
                        }
                    } else {
                        os = new SenderOutputStream(sender);
                    }
                    try {
                        Timings.printAll(os);
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    }
                } else {
                    sendCommandDesc(sender, "/triggerreactor[trg] timings toggle", "turn on/off timings analysis. Also analysis will be reset.");
                    sendCommandDesc(sender, "/triggerreactor[trg] timings reset", "turn on/off timings analysis. Also analysis will be reset.");
                    sendCommandDesc(sender, "/triggerreactor[trg] timings print", "Show analysis result.");
                    sendCommandDesc(sender, "/triggerreactor[trg] timings print xx", "Save analysis to file named xx.timings");
                }
                return true;
            } else if (args[0].equalsIgnoreCase("saveall")) {
                for (Manager manager : Manager.getManagers()) manager.saveAll();
                sender.sendMessage("Save complete!");
                return true;
            } else if (args[0].equalsIgnoreCase("reload")) {
                for (Manager manager : Manager.getManagers()) manager.reload();
                getExecutorManager().reload();
                getPlaceholderManager().reload();
                sender.sendMessage("Reload Complete!");
                return true;
            } else if (args[0].equalsIgnoreCase("help")) {
                int page = 0;
                if (args.length > 1) {
                    if (!args[1].matches("[0-9]+")) {
                        sender.sendMessage("&c" + args[1] + " is not a valid page number.");
                        return true;
                    }
                    page = Integer.parseInt(args[1]);
                }
                showHelp(sender, page);
                return true;
            } else if (args[0].equalsIgnoreCase("links")) {
                if (args.length < 2) {
                    return true;
                }
                AbstractInventoryEditManager manager = getInvEditManager();
                IPlayer player = (IPlayer) sender;
                switch(args[1]) {
                    case "inveditsave":
                        manager.saveEdit(player);
                        return true;
                    case "inveditcontinue":
                        manager.continueEdit(player);
                        return true;
                    case "inveditdiscard":
                        manager.discardEdit(player);
                        return true;
                }
            }
        }
        showHelp(sender);
    }
    return true;
}
Also used : IPlayer(io.github.wysohn.triggerreactor.core.bridge.entity.IPlayer) CustomTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.custom.CustomTrigger) AbstractRepeatingTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.repeating.AbstractRepeatingTriggerManager) AbstractAPISupport(io.github.wysohn.triggerreactor.core.manager.trigger.share.api.AbstractAPISupport) java.util(java.util) io.github.wysohn.triggerreactor.core.manager(io.github.wysohn.triggerreactor.core.manager) AbstractLocationBasedTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.location.AbstractLocationBasedTriggerManager) SaveHandler(io.github.wysohn.triggerreactor.tools.ScriptEditor.SaveHandler) ICommandSender(io.github.wysohn.triggerreactor.core.bridge.ICommandSender) AbstractInventoryTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.inventory.AbstractInventoryTriggerManager) AreaTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.area.AreaTrigger) IItemStack(io.github.wysohn.triggerreactor.core.bridge.IItemStack) Trigger(io.github.wysohn.triggerreactor.core.manager.trigger.Trigger) TriggerInfo(io.github.wysohn.triggerreactor.core.manager.trigger.TriggerInfo) AbstractAreaTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.area.AbstractAreaTriggerManager) CommandTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.command.CommandTrigger) Timings(io.github.wysohn.triggerreactor.tools.timings.Timings) AbstractCustomTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.custom.AbstractCustomTriggerManager) ProcessInterrupter(io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.ProcessInterrupter) OutputStream(java.io.OutputStream) AbstractCommandTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.command.AbstractCommandTriggerManager) Area(io.github.wysohn.triggerreactor.core.manager.location.Area) AbstractTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager) IInventory(io.github.wysohn.triggerreactor.core.bridge.IInventory) java.util.concurrent(java.util.concurrent) SenderOutputStream(io.github.wysohn.triggerreactor.tools.stream.SenderOutputStream) FileOutputStream(java.io.FileOutputStream) InventoryTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.inventory.InventoryTrigger) IOException(java.io.IOException) IEvent(io.github.wysohn.triggerreactor.core.bridge.event.IEvent) Interpreter(io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter) Logger(java.util.logging.Logger) AbstractNamedTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.named.AbstractNamedTriggerManager) IPlayer(io.github.wysohn.triggerreactor.core.bridge.entity.IPlayer) File(java.io.File) TimeUtil(io.github.wysohn.triggerreactor.tools.TimeUtil) SimpleLocation(io.github.wysohn.triggerreactor.core.manager.location.SimpleLocation) TaskSupervisor(io.github.wysohn.triggerreactor.core.script.interpreter.TaskSupervisor) SimpleChunkLocation(io.github.wysohn.triggerreactor.core.manager.location.SimpleChunkLocation) RepeatingTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.repeating.RepeatingTrigger) Entry(java.util.Map.Entry) ILocation(io.github.wysohn.triggerreactor.core.bridge.ILocation) SelfReference(io.github.wysohn.triggerreactor.core.script.wrapper.SelfReference) Pattern(java.util.regex.Pattern) SenderOutputStream(io.github.wysohn.triggerreactor.tools.stream.SenderOutputStream) OutputStream(java.io.OutputStream) SenderOutputStream(io.github.wysohn.triggerreactor.tools.stream.SenderOutputStream) FileOutputStream(java.io.FileOutputStream) SimpleChunkLocation(io.github.wysohn.triggerreactor.core.manager.location.SimpleChunkLocation) AbstractRepeatingTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.repeating.AbstractRepeatingTriggerManager) AbstractLocationBasedTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.location.AbstractLocationBasedTriggerManager) AbstractInventoryTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.inventory.AbstractInventoryTriggerManager) AbstractAreaTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.area.AbstractAreaTriggerManager) AbstractCustomTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.custom.AbstractCustomTriggerManager) AbstractCommandTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.command.AbstractCommandTriggerManager) AbstractTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager) AbstractNamedTriggerManager(io.github.wysohn.triggerreactor.core.manager.trigger.named.AbstractNamedTriggerManager) CommandTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.command.CommandTrigger) RepeatingTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.repeating.RepeatingTrigger) InventoryTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.inventory.InventoryTrigger) CustomTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.custom.CustomTrigger) AreaTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.area.AreaTrigger) Trigger(io.github.wysohn.triggerreactor.core.manager.trigger.Trigger) CommandTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.command.CommandTrigger) InventoryTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.inventory.InventoryTrigger) RepeatingTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.repeating.RepeatingTrigger) IInventory(io.github.wysohn.triggerreactor.core.bridge.IInventory) TriggerInfo(io.github.wysohn.triggerreactor.core.manager.trigger.TriggerInfo) AreaTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.area.AreaTrigger) IOException(java.io.IOException) IOException(java.io.IOException) CustomTrigger(io.github.wysohn.triggerreactor.core.manager.trigger.custom.CustomTrigger) SaveHandler(io.github.wysohn.triggerreactor.tools.ScriptEditor.SaveHandler) Area(io.github.wysohn.triggerreactor.core.manager.location.Area) ILocation(io.github.wysohn.triggerreactor.core.bridge.ILocation) IItemStack(io.github.wysohn.triggerreactor.core.bridge.IItemStack) FileOutputStream(java.io.FileOutputStream) File(java.io.File)

Aggregations

ICommandSender (io.github.wysohn.triggerreactor.core.bridge.ICommandSender)1 IInventory (io.github.wysohn.triggerreactor.core.bridge.IInventory)1 IItemStack (io.github.wysohn.triggerreactor.core.bridge.IItemStack)1 ILocation (io.github.wysohn.triggerreactor.core.bridge.ILocation)1 IPlayer (io.github.wysohn.triggerreactor.core.bridge.entity.IPlayer)1 IEvent (io.github.wysohn.triggerreactor.core.bridge.event.IEvent)1 io.github.wysohn.triggerreactor.core.manager (io.github.wysohn.triggerreactor.core.manager)1 Area (io.github.wysohn.triggerreactor.core.manager.location.Area)1 SimpleChunkLocation (io.github.wysohn.triggerreactor.core.manager.location.SimpleChunkLocation)1 SimpleLocation (io.github.wysohn.triggerreactor.core.manager.location.SimpleLocation)1 AbstractTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager)1 Trigger (io.github.wysohn.triggerreactor.core.manager.trigger.Trigger)1 TriggerInfo (io.github.wysohn.triggerreactor.core.manager.trigger.TriggerInfo)1 AbstractAreaTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.area.AbstractAreaTriggerManager)1 AreaTrigger (io.github.wysohn.triggerreactor.core.manager.trigger.area.AreaTrigger)1 AbstractCommandTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.command.AbstractCommandTriggerManager)1 CommandTrigger (io.github.wysohn.triggerreactor.core.manager.trigger.command.CommandTrigger)1 AbstractCustomTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.custom.AbstractCustomTriggerManager)1 CustomTrigger (io.github.wysohn.triggerreactor.core.manager.trigger.custom.CustomTrigger)1 AbstractInventoryTriggerManager (io.github.wysohn.triggerreactor.core.manager.trigger.inventory.AbstractInventoryTriggerManager)1