From 5bc7a1c29a3b2249483049685579ddaeced72c10 Mon Sep 17 00:00:00 2001 From: EquipableMC <66171067+EquipableMC@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:39:56 -0500 Subject: [PATCH 1/2] remove unused imports and add import for SkriptParser --- .../info/itsthesky/disky/api/events/DiSkyEvent.java | 3 ++- .../info/itsthesky/disky/api/skript/BaseScope.java | 5 +++-- .../disky/api/skript/EasyPropertyCondition.java | 4 ++-- .../disky/api/skript/MultipleGetterExpression.java | 7 ++----- .../disky/api/skript/MultiplyPropertyExpression.java | 4 ++-- .../itsthesky/disky/api/skript/ReturningSection.java | 5 +++-- .../disky/api/skript/SimpleGetterExpression.java | 6 ++---- .../itsthesky/disky/api/skript/WaiterEffect.java | 5 +++-- .../disky/api/skript/action/AbstractNewAction.java | 4 ++-- .../disky/api/skript/action/ActionProperty.java | 4 ++-- .../api/skript/action/MultipleActionProperty.java | 4 ++-- .../skript/reflects/state/DiSkyStateProperty.java | 4 ++-- .../java/info/itsthesky/disky/core/SkriptUtils.java | 9 ++------- .../info/itsthesky/disky/elements/BaseBotEffect.java | 4 ++-- .../disky/elements/commands/CommandFactory.java | 7 +++---- .../disky/elements/commands/DiSkyCommand.java | 4 ++-- .../disky/elements/commands/values/UsedAlias.java | 4 ++-- .../disky/elements/commands/values/UsedArgument.java | 4 ++-- .../disky/elements/commands/values/UsedPrefix.java | 4 ++-- .../components/commands/EditMessageComponent.java | 4 ++-- .../components/commands/EffEnableDisableCommand.java | 4 ++-- .../components/commands/EffUpdateCommand.java | 4 ++-- .../components/commands/ExprNewMessageCommand.java | 4 ++-- .../components/commands/ExprNewOptionChoice.java | 4 ++-- .../components/commands/ExprNewSlashCommand.java | 4 ++-- .../components/commands/ExprNewSlashOption.java | 4 ++-- .../components/commands/ExprNewUserCommand.java | 5 ++--- .../components/commands/UnregisterCommand.java | 4 ++-- .../elements/components/create/ExprNewButton.java | 7 ++----- .../components/create/ExprNewButtonsRow.java | 4 ++-- .../elements/components/create/ExprNewDropdown.java | 7 ++----- .../components/create/ExprNewDropdownOption.java | 4 ++-- .../elements/components/create/ExprNewInput.java | 4 ++-- .../elements/components/create/ExprNewModal.java | 4 ++-- .../components/properties/ComponentValue.java | 4 ++-- .../components/properties/ExprNewLocaleData.java | 4 ++-- .../components/properties/PropLocalization.java | 4 ++-- .../elements/conditions/BotMemberIsInThread.java | 4 ++-- .../itsthesky/disky/elements/conditions/HasRole.java | 4 ++-- .../elements/effects/ArchiveUnarchiveThread.java | 4 ++-- .../itsthesky/disky/elements/effects/BanMember.java | 8 ++------ .../itsthesky/disky/elements/effects/ConnectBot.java | 4 ++-- .../disky/elements/effects/CreateAction.java | 7 ++----- .../disky/elements/effects/CreateEmote.java | 7 ++----- .../disky/elements/effects/CreateInvite.java | 8 ++------ .../itsthesky/disky/elements/effects/CreatePost.java | 4 ++-- .../disky/elements/effects/CreateScheduledEvent.java | 4 ++-- .../disky/elements/effects/CreateThread.java | 5 ++--- .../disky/elements/effects/DeferInteraction.java | 6 ++---- .../disky/elements/effects/DestroyEntity.java | 4 ++-- .../disky/elements/effects/EditMessage.java | 4 ++-- .../itsthesky/disky/elements/effects/KickMember.java | 6 ++---- .../disky/elements/effects/LoadMembers.java | 4 ++-- .../disky/elements/effects/LockUnlockThread.java | 4 ++-- .../disky/elements/effects/MakeBotLeave.java | 4 ++-- .../itsthesky/disky/elements/effects/MoveMember.java | 4 ++-- .../itsthesky/disky/elements/effects/MoveRole.java | 4 ++-- .../itsthesky/disky/elements/effects/MuteMember.java | 6 ++---- .../disky/elements/effects/OpenPrivateChannel.java | 9 ++------- .../itsthesky/disky/elements/effects/PinMessage.java | 4 ++-- .../disky/elements/effects/PostMessage.java | 4 ++-- .../disky/elements/effects/PublishMessage.java | 4 ++-- .../disky/elements/effects/PurgeMessages.java | 4 ++-- .../itsthesky/disky/elements/effects/ReplyWith.java | 10 ++-------- .../disky/elements/effects/RetrieveEventValue.java | 4 ++-- .../itsthesky/disky/elements/effects/SendTyping.java | 4 ++-- .../itsthesky/disky/elements/effects/StopBot.java | 5 ++--- .../disky/elements/effects/SuppressReaction.java | 4 ++-- .../disky/elements/effects/TimeOutMember.java | 4 ++-- .../disky/elements/effects/UnbanMember.java | 3 ++- .../elements/effects/retrieve/RetrieveEmotes.java | 4 ++-- .../effects/retrieve/RetrieveInterestedMembers.java | 6 ++---- .../elements/effects/retrieve/RetrieveMessages.java | 6 ++---- .../effects/retrieve/RetrieveThreadMessage.java | 4 ++-- .../disky/elements/events/DiSkyErrorEvent.java | 4 ++-- .../interactions/SlashCommandReceiveEvent.java | 6 ++---- .../events/interactions/SlashCompletionEvent.java | 7 +++---- .../disky/elements/getters/BaseGetterExpression.java | 5 ++--- .../disky/elements/getters/ColorFromHex.java | 4 ++-- .../itsthesky/disky/elements/getters/ExprEmoji.java | 4 ++-- .../itsthesky/disky/elements/getters/GetBot.java | 6 ++---- .../itsthesky/disky/elements/getters/GetMember.java | 4 ++-- .../itsthesky/disky/elements/getters/GetSticker.java | 5 ++--- .../disky/elements/getters/GetUserInGuild.java | 4 ++-- .../disky/elements/getters/LastDiSkyException.java | 4 ++-- .../disky/elements/sections/EmbedSection.java | 7 ++----- .../disky/elements/sections/FindMemberSection.java | 7 +++---- .../disky/elements/sections/ReactSection.java | 3 ++- .../elements/sections/automod/AutomodResponse.java | 12 ++---------- .../disky/elements/sections/automod/AutomodType.java | 8 ++------ .../disky/elements/sections/automod/CreateRule.java | 4 ++-- .../sections/message/InlineMessageBuilder.java | 4 ++-- .../sections/message/MessageAttachments.java | 6 +++--- .../elements/sections/message/MessageContent.java | 4 ++-- .../elements/sections/message/MessageEmbeds.java | 10 ++-------- .../sections/once/ExprSubEventExpression.java | 4 ++-- 96 files changed, 199 insertions(+), 277 deletions(-) diff --git a/src/main/java/info/itsthesky/disky/api/events/DiSkyEvent.java b/src/main/java/info/itsthesky/disky/api/events/DiSkyEvent.java index 9727f7bc..6acc7c7f 100644 --- a/src/main/java/info/itsthesky/disky/api/events/DiSkyEvent.java +++ b/src/main/java/info/itsthesky/disky/api/events/DiSkyEvent.java @@ -4,6 +4,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.config.Config; import ch.njol.skript.lang.*; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.log.SkriptLogger; import info.itsthesky.disky.DiSky; import info.itsthesky.disky.core.SkriptUtils; @@ -81,7 +82,7 @@ protected Predicate logChecker() { @Override @SuppressWarnings("unchecked") - public boolean init(Literal @NotNull [] exprs, int matchedPattern, @NotNull SkriptParser.ParseResult parser) { + public boolean init(Literal @NotNull [] exprs, int matchedPattern, @NotNull ParseResult parser) { bot = (String) (exprs[0] == null ? null : exprs[0].getSingle()); bukkitClass = (Class) Arrays.stream(this.getClass().getDeclaredClasses()) diff --git a/src/main/java/info/itsthesky/disky/api/skript/BaseScope.java b/src/main/java/info/itsthesky/disky/api/skript/BaseScope.java index ca78bb4d..58ce0e20 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/BaseScope.java +++ b/src/main/java/info/itsthesky/disky/api/skript/BaseScope.java @@ -5,6 +5,7 @@ import ch.njol.skript.config.Node; import ch.njol.skript.config.SectionNode; import ch.njol.skript.lang.*; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleLiteral; import ch.njol.skript.log.SkriptLogger; import ch.njol.skript.util.StringMode; @@ -31,7 +32,7 @@ public abstract class BaseScope extends SelfRegisteringSkriptEvent { public abstract @Nullable String validate(@Nullable T parsedEntity); - public void init(Literal @NotNull [] args, int matchedPattern, @NotNull SkriptParser.ParseResult parseResult, SectionNode node) {}; + public void init(Literal @NotNull [] args, int matchedPattern, @NotNull ParseResult parseResult, SectionNode node) {}; public String parseEntry(SectionNode node, String key) { return parseEntry(node, key, ""); @@ -91,7 +92,7 @@ public static void nukeSectionNode(SectionNode sectionNode) { } @Override - public boolean init(Literal @NotNull [] args, int matchedPattern, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Literal @NotNull [] args, int matchedPattern, @NotNull ParseResult parseResult) { final Node node = SkriptLogger.getNode(); if (!(node instanceof SectionNode)) return false; diff --git a/src/main/java/info/itsthesky/disky/api/skript/EasyPropertyCondition.java b/src/main/java/info/itsthesky/disky/api/skript/EasyPropertyCondition.java index f0c5800a..debab8a0 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/EasyPropertyCondition.java +++ b/src/main/java/info/itsthesky/disky/api/skript/EasyPropertyCondition.java @@ -4,7 +4,7 @@ import ch.njol.skript.SkriptAPIException; import ch.njol.skript.lang.Condition; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.util.Kleenean; import org.bukkit.event.Event; import org.jetbrains.annotations.NotNull; @@ -61,7 +61,7 @@ public boolean check(@NotNull Event e) { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { expr = (Expression) exprs[0]; this.setNegated(matchedPattern == 1); return true; diff --git a/src/main/java/info/itsthesky/disky/api/skript/MultipleGetterExpression.java b/src/main/java/info/itsthesky/disky/api/skript/MultipleGetterExpression.java index 0aabe7eb..d09dac3e 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/MultipleGetterExpression.java +++ b/src/main/java/info/itsthesky/disky/api/skript/MultipleGetterExpression.java @@ -2,13 +2,10 @@ import ch.njol.skript.Skript; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.parser.ParserInstance; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; -import info.itsthesky.disky.core.SkriptUtils; -import net.dv8tion.jda.api.events.GenericEvent; import org.bukkit.event.Event; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -38,7 +35,7 @@ public boolean isSingle() { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { if (!EasyElement.containsEvent(getEvent())) { Skript.error(getValue() + " cannot be used in a " + ParserInstance.get().getCurrentEventName()); return false; diff --git a/src/main/java/info/itsthesky/disky/api/skript/MultiplyPropertyExpression.java b/src/main/java/info/itsthesky/disky/api/skript/MultiplyPropertyExpression.java index 5d118c5c..211a0430 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/MultiplyPropertyExpression.java +++ b/src/main/java/info/itsthesky/disky/api/skript/MultiplyPropertyExpression.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import org.bukkit.event.Event; @@ -29,7 +29,7 @@ protected static void register(final Class> c, final @Override @SuppressWarnings("unchecked") - public boolean init(final Expression @NotNull [] expr, final int matchedPattern, final @NotNull Kleenean isDelayed, @NotNull final SkriptParser.ParseResult parseResult) { + public boolean init(final Expression @NotNull [] expr, final int matchedPattern, final @NotNull Kleenean isDelayed, @NotNull final ParseResult parseResult) { this.expr = (Expression) expr[0]; return true; } diff --git a/src/main/java/info/itsthesky/disky/api/skript/ReturningSection.java b/src/main/java/info/itsthesky/disky/api/skript/ReturningSection.java index e51b60b8..36c662ae 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/ReturningSection.java +++ b/src/main/java/info/itsthesky/disky/api/skript/ReturningSection.java @@ -4,6 +4,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.config.SectionNode; import ch.njol.skript.lang.*; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import org.bukkit.event.Event; @@ -36,7 +37,7 @@ public static > void register(Class sectionC private Variable variable; @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult, @NotNull SectionNode sectionNode, @NotNull List triggerItems) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult, @NotNull SectionNode sectionNode, @NotNull List triggerItems) { loadOptionalCode(sectionNode); variable = (Variable) exprs[exprs.length - 1]; return true; @@ -61,7 +62,7 @@ public abstract static class LastBuilderExpression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { section = getParser().getCurrentSection(getSectionClass()); return getParser().isCurrentSection(getSectionClass()); } diff --git a/src/main/java/info/itsthesky/disky/api/skript/SimpleGetterExpression.java b/src/main/java/info/itsthesky/disky/api/skript/SimpleGetterExpression.java index 82d785fc..e3afd1bb 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/SimpleGetterExpression.java +++ b/src/main/java/info/itsthesky/disky/api/skript/SimpleGetterExpression.java @@ -1,9 +1,7 @@ package info.itsthesky.disky.api.skript; -import ch.njol.skript.Skript; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; -import ch.njol.skript.lang.parser.ParserInstance; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import org.bukkit.event.Event; @@ -35,7 +33,7 @@ public boolean isSingle() { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { return getEvent() == null || EasyElement.containsEvent(getEvent()); } } diff --git a/src/main/java/info/itsthesky/disky/api/skript/WaiterEffect.java b/src/main/java/info/itsthesky/disky/api/skript/WaiterEffect.java index 44fa87f3..897cafae 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/WaiterEffect.java +++ b/src/main/java/info/itsthesky/disky/api/skript/WaiterEffect.java @@ -3,6 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.classes.Changer; import ch.njol.skript.lang.*; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.parser.ParserInstance; import ch.njol.skript.timings.SkriptTimings; import ch.njol.skript.variables.Variables; @@ -28,9 +29,9 @@ public abstract class WaiterEffect extends EasyElement { @Nullable protected Variable changedVariable = null; private boolean isStopped; - public abstract boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult); + public abstract boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, ParseResult parseResult); - public boolean init(Expression @NotNull [] expressions, int i, @NotNull Kleenean kleenean, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] expressions, int i, @NotNull Kleenean kleenean, @NotNull ParseResult parseResult) { ParserInstance.get().setHasDelayBefore(Kleenean.TRUE); node = new NodeInformation(); return initEffect(expressions, i, kleenean, parseResult); diff --git a/src/main/java/info/itsthesky/disky/api/skript/action/AbstractNewAction.java b/src/main/java/info/itsthesky/disky/api/skript/action/AbstractNewAction.java index 9e56ec1d..79a77257 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/action/AbstractNewAction.java +++ b/src/main/java/info/itsthesky/disky/api/skript/action/AbstractNewAction.java @@ -1,7 +1,7 @@ package info.itsthesky.disky.api.skript.action; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.skript.EasyElement; @@ -45,7 +45,7 @@ public boolean isSingle() { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { exprGuild = (Expression) exprs[0]; exprBot = (Expression) exprs[1]; return true; diff --git a/src/main/java/info/itsthesky/disky/api/skript/action/ActionProperty.java b/src/main/java/info/itsthesky/disky/api/skript/action/ActionProperty.java index 62880464..3e6f8120 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/action/ActionProperty.java +++ b/src/main/java/info/itsthesky/disky/api/skript/action/ActionProperty.java @@ -3,7 +3,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.config.Node; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.changers.ChangeablePropertyExpression; import info.itsthesky.disky.api.skript.EasyElement; @@ -72,7 +72,7 @@ public O[] getAsync(Event e) { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { setExpr(exprs[0]); node = getParser().getNode(); return true; diff --git a/src/main/java/info/itsthesky/disky/api/skript/action/MultipleActionProperty.java b/src/main/java/info/itsthesky/disky/api/skript/action/MultipleActionProperty.java index 6e2d351c..c82cf717 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/action/MultipleActionProperty.java +++ b/src/main/java/info/itsthesky/disky/api/skript/action/MultipleActionProperty.java @@ -2,7 +2,7 @@ import ch.njol.skript.classes.Changer; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.changers.ChangeablePropertyExpression; import info.itsthesky.disky.api.skript.EasyElement; @@ -45,7 +45,7 @@ public void change(Event e, Object[] delta, Bot bot, Changer.ChangeMode mode) { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { setExpr(exprs[0]); return true; } diff --git a/src/main/java/info/itsthesky/disky/api/skript/reflects/state/DiSkyStateProperty.java b/src/main/java/info/itsthesky/disky/api/skript/reflects/state/DiSkyStateProperty.java index 9941ebee..b9100b73 100644 --- a/src/main/java/info/itsthesky/disky/api/skript/reflects/state/DiSkyStateProperty.java +++ b/src/main/java/info/itsthesky/disky/api/skript/reflects/state/DiSkyStateProperty.java @@ -4,7 +4,7 @@ import ch.njol.skript.config.Node; import ch.njol.skript.expressions.base.SimplePropertyExpression; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.skript.INodeHolder; import info.itsthesky.disky.elements.changers.IAsyncChangeableExpression; @@ -18,7 +18,7 @@ public class DiSkyStateProperty extends SimplePropertyExpression[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) { + public boolean init(Expression[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { node = getParser().getNode(); return super.init(expressions, matchedPattern, isDelayed, parseResult); } diff --git a/src/main/java/info/itsthesky/disky/core/SkriptUtils.java b/src/main/java/info/itsthesky/disky/core/SkriptUtils.java index c73dfe59..9b523365 100644 --- a/src/main/java/info/itsthesky/disky/core/SkriptUtils.java +++ b/src/main/java/info/itsthesky/disky/core/SkriptUtils.java @@ -5,12 +5,10 @@ import ch.njol.skript.config.Node; import ch.njol.skript.config.SectionNode; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.TriggerItem; -import ch.njol.skript.lang.VariableString; import ch.njol.skript.lang.parser.ParserInstance; import ch.njol.skript.lang.util.SimpleExpression; -import ch.njol.skript.lang.util.SimpleLiteral; import ch.njol.skript.log.*; import ch.njol.skript.registrations.EventValues; import ch.njol.skript.util.*; @@ -22,14 +20,12 @@ import info.itsthesky.disky.api.events.SimpleDiSkyEvent; import info.itsthesky.disky.api.skript.EasyElement; import info.itsthesky.disky.elements.effects.RetrieveEventValue; -import info.itsthesky.disky.elements.events.member.MemberKickEvent; import info.itsthesky.disky.elements.sections.handler.DiSkyRuntimeHandler; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Icon; import net.dv8tion.jda.api.entities.channel.Channel; import net.dv8tion.jda.api.entities.channel.middleman.GuildChannel; -import net.dv8tion.jda.api.events.guild.GenericGuildEvent; import net.dv8tion.jda.api.events.message.GenericMessageEvent; import net.dv8tion.jda.api.requests.RestAction; import org.bukkit.Bukkit; @@ -40,7 +36,6 @@ import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.lang.reflect.Array; import java.lang.reflect.Field; @@ -133,7 +128,7 @@ public boolean isDefault() { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { return true; } }; diff --git a/src/main/java/info/itsthesky/disky/elements/BaseBotEffect.java b/src/main/java/info/itsthesky/disky/elements/BaseBotEffect.java index 03f9d9d2..bbaec735 100644 --- a/src/main/java/info/itsthesky/disky/elements/BaseBotEffect.java +++ b/src/main/java/info/itsthesky/disky/elements/BaseBotEffect.java @@ -5,7 +5,7 @@ import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Effect; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.util.Kleenean; import info.itsthesky.disky.DiSky; import info.itsthesky.disky.api.skript.SpecificBotEffect; @@ -31,7 +31,7 @@ public class BaseBotEffect extends WaiterEffect { private SpecificBotEffect effect; @Override - public boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { + public boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, ParseResult parseResult) { exprBot = (Expression) expressions[0]; final String rawEffect = parseResult.regexes.get(0).group(); final Effect unparsedEffect = Effect.parse(rawEffect, "Can't understand this effect: " + rawEffect); diff --git a/src/main/java/info/itsthesky/disky/elements/commands/CommandFactory.java b/src/main/java/info/itsthesky/disky/elements/commands/CommandFactory.java index 3c6a1cf4..fae46522 100644 --- a/src/main/java/info/itsthesky/disky/elements/commands/CommandFactory.java +++ b/src/main/java/info/itsthesky/disky/elements/commands/CommandFactory.java @@ -6,6 +6,7 @@ import ch.njol.skript.classes.Parser; import ch.njol.skript.config.SectionNode; import ch.njol.skript.lang.*; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleLiteral; import ch.njol.skript.registrations.Classes; import ch.njol.skript.util.StringMode; @@ -13,10 +14,8 @@ import ch.njol.skript.util.Utils; import ch.njol.util.NonNullPair; import ch.njol.util.StringUtils; -import info.itsthesky.disky.api.DiSkyType; import info.itsthesky.disky.core.SkriptUtils; import net.dv8tion.jda.api.entities.channel.ChannelType; -import net.dv8tion.jda.api.requests.RestAction; import org.bukkit.event.Event; import java.lang.reflect.InvocationTargetException; @@ -61,9 +60,9 @@ private String escape(final String s) { public boolean parseArguments(String args, CommandObject command, Event event) { SkriptParser parser = new SkriptParser(args, SkriptParser.PARSE_LITERALS, ParseContext.COMMAND); - SkriptParser.ParseResult res = null; + ParseResult res = null; try { - res = (SkriptParser.ParseResult) PARSE_I.invoke(parser, command.getPattern()); + res = (ParseResult) PARSE_I.invoke(parser, command.getPattern()); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } diff --git a/src/main/java/info/itsthesky/disky/elements/commands/DiSkyCommand.java b/src/main/java/info/itsthesky/disky/elements/commands/DiSkyCommand.java index 6d7cecf1..2badfaa3 100644 --- a/src/main/java/info/itsthesky/disky/elements/commands/DiSkyCommand.java +++ b/src/main/java/info/itsthesky/disky/elements/commands/DiSkyCommand.java @@ -2,7 +2,7 @@ import ch.njol.skript.lang.Literal; import ch.njol.skript.lang.SkriptEvent; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.registrations.EventValues; import ch.njol.skript.util.Getter; import info.itsthesky.disky.DiSky; @@ -76,7 +76,7 @@ public Bot get(@NotNull EvtDiSkyCommand event) { } @Override - public boolean init(Literal @NotNull [] exprs, int i, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Literal @NotNull [] exprs, int i, @NotNull ParseResult parseResult) { return true; } diff --git a/src/main/java/info/itsthesky/disky/elements/commands/values/UsedAlias.java b/src/main/java/info/itsthesky/disky/elements/commands/values/UsedAlias.java index 770083ba..e3e0d67b 100644 --- a/src/main/java/info/itsthesky/disky/elements/commands/values/UsedAlias.java +++ b/src/main/java/info/itsthesky/disky/elements/commands/values/UsedAlias.java @@ -7,7 +7,7 @@ import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.elements.commands.CommandEvent; @@ -51,7 +51,7 @@ public boolean isSingle() { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { if (!ScriptLoader.isCurrentEvent(CommandEvent.class)) { Skript.error("The used alias can only used in a discord command trigger section."); return false; diff --git a/src/main/java/info/itsthesky/disky/elements/commands/values/UsedArgument.java b/src/main/java/info/itsthesky/disky/elements/commands/values/UsedArgument.java index fe6cf07f..7298e97b 100644 --- a/src/main/java/info/itsthesky/disky/elements/commands/values/UsedArgument.java +++ b/src/main/java/info/itsthesky/disky/elements/commands/values/UsedArgument.java @@ -6,7 +6,7 @@ import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.elements.commands.CommandEvent; @@ -50,7 +50,7 @@ public boolean isSingle() { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { if (!ScriptLoader.isCurrentEvent(CommandEvent.class)) { Skript.error("The used arguments can only used in a discord command trigger section."); return false; diff --git a/src/main/java/info/itsthesky/disky/elements/commands/values/UsedPrefix.java b/src/main/java/info/itsthesky/disky/elements/commands/values/UsedPrefix.java index f81d093a..535de36b 100644 --- a/src/main/java/info/itsthesky/disky/elements/commands/values/UsedPrefix.java +++ b/src/main/java/info/itsthesky/disky/elements/commands/values/UsedPrefix.java @@ -7,7 +7,7 @@ import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.elements.commands.CommandEvent; @@ -50,7 +50,7 @@ public boolean isSingle() { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { if (!ScriptLoader.isCurrentEvent(CommandEvent.class)) { Skript.error("The used prefix can only used in a discord command trigger section."); return false; diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/EditMessageComponent.java b/src/main/java/info/itsthesky/disky/elements/components/commands/EditMessageComponent.java index 7cde60da..c4e8b7c9 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/EditMessageComponent.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/EditMessageComponent.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.config.Node; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.util.AsyncEffect; import ch.njol.util.Kleenean; import info.itsthesky.disky.DiSky; @@ -36,7 +36,7 @@ public class EditMessageComponent extends AsyncEffect { private Expression exprComponent; @Override - public boolean init(Expression[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) { + public boolean init(Expression[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { node = getParser().getNode(); exprID = (Expression) expressions[0]; exprMessage = (Expression) expressions[1]; diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/EffEnableDisableCommand.java b/src/main/java/info/itsthesky/disky/elements/components/commands/EffEnableDisableCommand.java index b833f30f..f115e9ac 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/EffEnableDisableCommand.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/EffEnableDisableCommand.java @@ -5,7 +5,7 @@ import ch.njol.skript.doc.Examples; import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.skript.SpecificBotEffect; import info.itsthesky.disky.core.Bot; @@ -56,7 +56,7 @@ public void runEffect(@NotNull Event e, @NotNull Bot bot) { } @Override - public boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { + public boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, ParseResult parseResult) { isDisable = i == 0; exprCommand = (Expression) expressions[0]; if (!isDisable) diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/EffUpdateCommand.java b/src/main/java/info/itsthesky/disky/elements/components/commands/EffUpdateCommand.java index 3e5a5437..18d113ee 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/EffUpdateCommand.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/EffUpdateCommand.java @@ -2,7 +2,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.util.Kleenean; import info.itsthesky.disky.DiSky; import info.itsthesky.disky.api.skript.WaiterEffect; @@ -29,7 +29,7 @@ public class EffUpdateCommand extends WaiterEffect { private Expression exprEntity; @Override - public boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { + public boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, ParseResult parseResult) { exprCommands = (Expression) expressions[0]; exprEntity = (Expression) expressions[1]; isGlobal = (parseResult.mark & 1) != 0; diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewMessageCommand.java b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewMessageCommand.java index cb59b82a..7c95cdec 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewMessageCommand.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewMessageCommand.java @@ -6,7 +6,7 @@ import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.skript.EasyElement; @@ -35,7 +35,7 @@ public class ExprNewMessageCommand extends SimpleExpression { private Expression exprName; @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { exprName = (Expression) exprs[0]; return true; } diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewOptionChoice.java b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewOptionChoice.java index 71fcf703..47ec6a0f 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewOptionChoice.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewOptionChoice.java @@ -6,7 +6,7 @@ import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.skript.EasyElement; @@ -31,7 +31,7 @@ public class ExprNewOptionChoice extends SimpleExpression { } @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { exprName = (Expression) exprs[0]; exprValue = (Expression) exprs[1]; return true; diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewSlashCommand.java b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewSlashCommand.java index c92a5e60..c0892d73 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewSlashCommand.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewSlashCommand.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.skript.EasyElement; @@ -68,7 +68,7 @@ public String toString() { private boolean isNSFW; @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { exprName = (Expression) exprs[0]; exprDesc = (Expression) exprs[1]; type = Type.fromPattern(matchedPattern); diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewSlashOption.java b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewSlashOption.java index 84ee66f8..ead6d704 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewSlashOption.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewSlashOption.java @@ -3,7 +3,7 @@ import ch.njol.skript.Skript; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.skript.EasyElement; @@ -30,7 +30,7 @@ public class ExprNewSlashOption extends SimpleExpression { private boolean required, autoComplete, member; @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { exprType = (Expression) exprs[0]; exprName = (Expression) exprs[1]; exprDesc = (Expression) exprs[2]; diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewUserCommand.java b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewUserCommand.java index 59f85513..0db45c83 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewUserCommand.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/ExprNewUserCommand.java @@ -6,13 +6,12 @@ import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.skript.EasyElement; import net.dv8tion.jda.api.interactions.commands.build.CommandData; import net.dv8tion.jda.api.interactions.commands.build.Commands; -import net.dv8tion.jda.api.interactions.commands.build.SlashCommandData; import org.bukkit.event.Event; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -36,7 +35,7 @@ public class ExprNewUserCommand extends SimpleExpression { private Expression exprName; @Override - public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull SkriptParser.ParseResult parseResult) { + public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parseResult) { exprName = (Expression) exprs[0]; return true; } diff --git a/src/main/java/info/itsthesky/disky/elements/components/commands/UnregisterCommand.java b/src/main/java/info/itsthesky/disky/elements/components/commands/UnregisterCommand.java index 833ce72e..2cfddde2 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/commands/UnregisterCommand.java +++ b/src/main/java/info/itsthesky/disky/elements/components/commands/UnregisterCommand.java @@ -5,7 +5,7 @@ import ch.njol.skript.doc.Examples; import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.util.Kleenean; import info.itsthesky.disky.DiSky; import info.itsthesky.disky.api.skript.SpecificBotEffect; @@ -39,7 +39,7 @@ public class UnregisterCommand extends SpecificBotEffect { private Expression exprEntity; @Override - public boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { + public boolean initEffect(Expression[] expressions, int i, Kleenean kleenean, ParseResult parseResult) { exprNames = (Expression) expressions[0]; exprEntity = (Expression) expressions[1]; isGlobal = (parseResult.mark & 1) != 0; diff --git a/src/main/java/info/itsthesky/disky/elements/components/create/ExprNewButton.java b/src/main/java/info/itsthesky/disky/elements/components/create/ExprNewButton.java index b237ba33..bb44582b 100644 --- a/src/main/java/info/itsthesky/disky/elements/components/create/ExprNewButton.java +++ b/src/main/java/info/itsthesky/disky/elements/components/create/ExprNewButton.java @@ -7,13 +7,10 @@ import ch.njol.skript.doc.Name; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.ExpressionType; -import ch.njol.skript.lang.SkriptParser; +import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.util.Kleenean; import info.itsthesky.disky.api.emojis.Emote; -import info.itsthesky.disky.api.skript.EasyElement; -import info.itsthesky.disky.core.Debug; -import info.itsthesky.disky.core.JDAUtils; import info.itsthesky.disky.elements.sections.handler.DiSkyRuntimeHandler; import net.dv8tion.jda.api.entities.SkuSnowflake; import net.dv8tion.jda.api.interactions.components.buttons.Button; @@ -46,7 +43,7 @@ public class ExprNewButton extends SimpleExpression