-
Notifications
You must be signed in to change notification settings - Fork 15
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
5177be5
commit 25458b5
Showing
5 changed files
with
57 additions
and
3 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
46 changes: 46 additions & 0 deletions
46
...main/java/io/github/apickledwalrus/skriptgui/elements/expressions/ExprGUIIdentifiers.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,46 @@ | ||
package io.github.apickledwalrus.skriptgui.elements.expressions; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.lang.Expression; | ||
import ch.njol.skript.lang.ExpressionType; | ||
import ch.njol.skript.lang.SkriptParser.ParseResult; | ||
import ch.njol.skript.lang.util.SimpleExpression; | ||
import ch.njol.util.Kleenean; | ||
import io.github.apickledwalrus.skriptgui.SkriptGUI; | ||
import org.bukkit.event.Event; | ||
import org.eclipse.jdt.annotation.Nullable; | ||
|
||
public class ExprGUIIdentifiers extends SimpleExpression<String> { | ||
|
||
static { | ||
Skript.registerExpression(ExprGUIIdentifiers.class, String.class, ExpressionType.SIMPLE, | ||
"[(all [[of] the]|the)] (global|registered) gui identifiers" | ||
); | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, ParseResult parseResult) { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected String[] get(Event e) { | ||
return SkriptGUI.getGUIManager().getGlobalIdentifiers(); | ||
} | ||
|
||
@Override | ||
public boolean isSingle() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public Class<? extends String> getReturnType() { | ||
return String.class; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean b) { | ||
return "all of the registered gui identifiers"; | ||
} | ||
|
||
} |
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