Skip to content

Commit 5f2604f

Browse files
committed
Update SkriptParser.java
1 parent b9af34c commit 5f2604f

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/main/java/ch/njol/skript/lang/SkriptParser.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public boolean hasTag(String tag) {
268268
* @param parseResult The parse result for error information.
269269
* @return True if the element is allowed in the current event, false otherwise.
270270
*/
271-
private boolean checkRestrictedEvents(SyntaxElement element, ParseResult parseResult) {
271+
private static boolean checkRestrictedEvents(SyntaxElement element, ParseResult parseResult) {
272272
if (element instanceof EventRestrictedSyntax eventRestrictedSyntax) {
273273
Class<? extends Event>[] supportedEvents = eventRestrictedSyntax.supportedEvents();
274274
if (!getParser().isCurrentEvent(supportedEvents)) {
@@ -279,7 +279,13 @@ private boolean checkRestrictedEvents(SyntaxElement element, ParseResult parseRe
279279
return true;
280280
}
281281

282-
private static String supportedEventsNames(Class<? extends Event>[] supportedEvents) {
282+
/**
283+
* Returns a string with the names of the supported skript events for the given class array.
284+
* If no events are found, returns an empty string.
285+
* @param supportedEvents The array of supported event classes.
286+
* @return A string with the names of the supported skript events, or an empty string if none are found.
287+
*/
288+
private static @NotNull String supportedEventsNames(Class<? extends Event>[] supportedEvents) {
283289
List<String> names = new ArrayList<>();
284290

285291
for (SkriptEventInfo<?> eventInfo : Skript.getEvents()) {
@@ -297,10 +303,11 @@ private static String supportedEventsNames(Class<? extends Event>[] supportedEve
297303

298304
/**
299305
* Checks whether the given element is experimental and if so, whether the current experiment set satisfies it.
306+
* Prints errors.
300307
* @param element The syntax element to check.
301308
* @return True if the element is allowed in the current experiment set, false otherwise.
302309
*/
303-
private boolean checkExperimentalSyntax(SyntaxElement element) {
310+
private static boolean checkExperimentalSyntax(SyntaxElement element) {
304311
if (element instanceof ExperimentalSyntax experimentalSyntax)
305312
return experimentalSyntax.isSatisfiedBy(getParser().getExperimentSet());
306313
return true;

0 commit comments

Comments
 (0)