-
-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/feature' into dev/BannerPatterns
- Loading branch information
Showing
4 changed files
with
150 additions
and
30 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
70 changes: 70 additions & 0 deletions
70
src/main/java/ch/njol/skript/test/runner/EffTestPluralClassInfos.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,70 @@ | ||
package ch.njol.skript.test.runner; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.classes.ClassInfo; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Name; | ||
import ch.njol.skript.doc.NoDoc; | ||
import ch.njol.skript.lang.Effect; | ||
import ch.njol.skript.lang.Expression; | ||
import ch.njol.skript.lang.SkriptParser.ParseResult; | ||
import ch.njol.skript.registrations.Classes; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* This class is used to test whether class-info plurals are detected successfully. | ||
* The syntax in it should never be parsed or used (even in test mode) | ||
* and does nothing. | ||
*/ | ||
@Name("Test Plural Class Infos") | ||
@Description("Tests that plural class infos are identified correctly.") | ||
@NoDoc | ||
public class EffTestPluralClassInfos extends Effect { | ||
|
||
static { | ||
class Example1 {} | ||
class Example2 {} | ||
class Example3 {} | ||
class Example4 {} | ||
if (TestMode.ENABLED) { | ||
Classes.registerClass(new ClassInfo<>(Example1.class, "testgui") | ||
.user("example1") | ||
.name("Test -ui")); | ||
Classes.registerClass(new ClassInfo<>(Example2.class, "exemplus") | ||
.user("example2") | ||
.name("Test -i")); | ||
Classes.registerClass(new ClassInfo<>(Example3.class, "aardwolf") | ||
.user("example3") | ||
.name("Test -ves")); | ||
Classes.registerClass(new ClassInfo<>(Example4.class, "hoof") | ||
.user("example3") | ||
.name("Test -ves 2")); | ||
Skript.registerEffect(EffTestPluralClassInfos.class, | ||
"classinfo test for %testgui%", | ||
"classinfo test for %testguis%", | ||
"classinfo test for %exemplus%", | ||
"classinfo test for %exempli%", | ||
"classinfo test for %aardwolf%", | ||
"classinfo test for %aardwolves%", | ||
"classinfo test for %hoof%", | ||
"classinfo test for %hooves%"); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected void execute(Event event) { | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event event, boolean debug) { | ||
return ""; | ||
} | ||
|
||
} |
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