-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50438af
commit 8e413b4
Showing
13 changed files
with
243 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/apickledwalrus/skriptgui/SkriptUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.github.apickledwalrus.skriptgui; | ||
|
||
import ch.njol.skript.lang.Section; | ||
import ch.njol.skript.lang.SectionSkriptEvent; | ||
import ch.njol.skript.lang.parser.ParserInstance; | ||
import org.skriptlang.skript.lang.structure.Structure; | ||
|
||
public final class SkriptUtils { | ||
|
||
@SafeVarargs | ||
public static boolean isSection(Class<? extends Section>... sections) { | ||
ParserInstance parser = ParserInstance.get(); | ||
Structure current = parser.getCurrentStructure(); | ||
return parser.isCurrentSection(sections) | ||
|| (current instanceof SectionSkriptEvent && ((SectionSkriptEvent) current).isSection(sections)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.