Skip to content

Commit d8f8e78

Browse files
committed
Merge branch 'dev/feature' into feature/modularization
2 parents edd20a1 + 6b7f547 commit d8f8e78

868 files changed

Lines changed: 13884 additions & 7507 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@
7070

7171
# EntityData
7272
/src/main/java/ch/njol/skript/entity @Absolutionism @skriptlang/core-developers
73+
74+
# Particles/Effects
75+
/src/main/java/org/skriptlang/skript/bukkit/particles @sovdeeth @skriptlang/core-developers

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ body:
77
## Guidelines
88
Please make sure you are running the latest version of Skript on a supported server platform and version.
99
Try to make sure there are no issues of this same problem currently open either.
10-
As of the release of Skript 2.13, the oldest supported version has been raised to Paper 1.20.4.
11-
Any issues created for versions older than 1.20.4, or for Spigot, will not be looked into or fixed unless the issue persists on supported versions.
10+
As of the release of Skript 2.14, the oldest supported version has been raised to Paper 1.21.0.
11+
Any issues created for versions older than 1.21.0, or for Spigot, will not be looked into or fixed unless the issue persists on supported versions.
1212
- type: textarea
1313
attributes:
1414
label: Skript/Server Version

.github/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ We welcome contributions from everyone. To get started, please fork the reposito
8080
and clone it to your local machine. If you are unfamiliar with Git, please refer to the
8181
[Git documentation](https://git-scm.com/learn).
8282
```
83-
git clone https://github.com/SkriptLang/Skript
83+
git clone https://github.com/SkriptLang/Skript --recurse-submodules
8484
```
8585

8686
Create a new branch for your changes. Use a descriptive name for the branch,

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ org.gradle.parallel=true
55

66
groupid=ch.njol
77
name=skript
8-
version=2.13.2
8+
version=2.14.0-pre1
99
jarName=Skript.jar
1010
testEnv=java21/paper-1.21.11
1111
testEnvJavaVersion=21

src/main/java/ch/njol/skript/Skript.java

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public void onEnable() {
415415
if (!aliasesFolder.mkdirs())
416416
throw new IOException("Could not create the directory " + aliasesFolder);
417417
}
418-
418+
419419
f = new ZipFile(getFile());
420420
for (ZipEntry e : new EnumerationIterable<ZipEntry>(f.entries())) {
421421
if (e.isDirectory())
@@ -567,7 +567,9 @@ public void onEnable() {
567567
LootTableModule.load();
568568
skript.loadModules(
569569
new CommonModule(),
570-
new BukkitModule());
570+
new BukkitModule(),
571+
new InteractionModule(),
572+
new ParticleModule());
571573
} catch (final Exception e) {
572574
exception(e, "Could not load required .class files: " + e.getLocalizedMessage());
573575
setEnabled(false);
@@ -1395,7 +1397,7 @@ private static void stopAcceptingRegistrations() {
13951397
* @deprecated Use {@link org.skriptlang.skript.Skript#registerAddon(Class, String)}.
13961398
* Obtain a Skript instance with {@link #instance()}.
13971399
*/
1398-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1400+
@Deprecated(since = "2.14", forRemoval = true)
13991401
public static SkriptAddon registerAddon(JavaPlugin plugin) {
14001402
checkAcceptRegistrations();
14011403
SkriptAddon addon = new SkriptAddon(plugin);
@@ -1408,7 +1410,7 @@ public static SkriptAddon registerAddon(JavaPlugin plugin) {
14081410
* Consider using {@link #getAddon(String)} with the name of the plugin ({@link JavaPlugin#getName()}).
14091411
* Obtain a Skript instance with {@link #instance()}.
14101412
*/
1411-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1413+
@Deprecated(since = "2.14", forRemoval = true)
14121414
public static @Nullable SkriptAddon getAddon(JavaPlugin plugin) {
14131415
if (plugin == Skript.getInstance()) {
14141416
return Skript.getAddonInstance();
@@ -1425,7 +1427,7 @@ public static SkriptAddon registerAddon(JavaPlugin plugin) {
14251427
* @deprecated Use {@link org.skriptlang.skript.Skript#addon(String)}.
14261428
* Obtain a Skript instance with {@link #instance()}.
14271429
*/
1428-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1430+
@Deprecated(since = "2.14", forRemoval = true)
14291431
public static @Nullable SkriptAddon getAddon(String name) {
14301432
if (name.equals(Skript.getInstance().getName())) {
14311433
return Skript.getAddonInstance();
@@ -1442,7 +1444,7 @@ public static SkriptAddon registerAddon(JavaPlugin plugin) {
14421444
* @deprecated Use {@link org.skriptlang.skript.Skript#addons()}.
14431445
* Obtain a Skript instance with {@link #instance()}.
14441446
*/
1445-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1447+
@Deprecated(since = "2.14", forRemoval = true)
14461448
public static @Unmodifiable Collection<SkriptAddon> getAddons() {
14471449
Set<SkriptAddon> addons = new HashSet<>(Skript.addons);
14481450
addons.addAll(instance().addons().stream()
@@ -1460,7 +1462,7 @@ public static SkriptAddon registerAddon(JavaPlugin plugin) {
14601462
* @return A {@link SkriptAddon} representing Skript.
14611463
* @deprecated Use {@link #instance()} instead.
14621464
*/
1463-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1465+
@Deprecated(since = "2.14", forRemoval = true)
14641466
public static SkriptAddon getAddonInstance() {
14651467
if (addon == null) {
14661468
addon = SkriptAddon.fromModern(instance());
@@ -1475,7 +1477,7 @@ public static SkriptAddon getAddonInstance() {
14751477
* @deprecated This method exists solely for compatibility reasons.
14761478
*/
14771479
@ApiStatus.Internal
1478-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1480+
@Deprecated(since = "2.14", forRemoval = true)
14791481
public static Origin getSyntaxOrigin(Class<?> source) {
14801482
JavaPlugin plugin;
14811483
try {
@@ -1499,7 +1501,7 @@ public static Origin getSyntaxOrigin(Class<?> source) {
14991501
* Create a {@link SyntaxInfo} with {@link SyntaxInfo#builder(Class)}.
15001502
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
15011503
*/
1502-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1504+
@Deprecated(since = "2.14", forRemoval = true)
15031505
public static <E extends Condition> void registerCondition(Class<E> conditionClass, String... patterns) throws IllegalArgumentException {
15041506
registerCondition(conditionClass, ConditionType.COMBINED, patterns);
15051507
}
@@ -1515,7 +1517,7 @@ public static <E extends Condition> void registerCondition(Class<E> conditionCla
15151517
* Specify a custom priority ({@link SyntaxInfo.Builder#priority(Priority)}) to replace {@code type}.
15161518
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
15171519
*/
1518-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1520+
@Deprecated(since = "2.14", forRemoval = true)
15191521
public static <E extends Condition> void registerCondition(Class<E> conditionClass, ConditionType type, String... patterns) throws IllegalArgumentException {
15201522
checkAcceptRegistrations();
15211523
skript.syntaxRegistry().register(SyntaxRegistry.CONDITION, SyntaxInfo.builder(conditionClass)
@@ -1535,7 +1537,7 @@ public static <E extends Condition> void registerCondition(Class<E> conditionCla
15351537
* Create a {@link SyntaxInfo} with {@link SyntaxInfo#builder(Class)}.
15361538
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
15371539
*/
1538-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1540+
@Deprecated(since = "2.14", forRemoval = true)
15391541
public static <E extends Effect> void registerEffect(Class<E> effectClass, String... patterns) throws IllegalArgumentException {
15401542
checkAcceptRegistrations();
15411543
skript.syntaxRegistry().register(SyntaxRegistry.EFFECT, SyntaxInfo.builder(effectClass)
@@ -1555,7 +1557,7 @@ public static <E extends Effect> void registerEffect(Class<E> effectClass, Strin
15551557
* Create a {@link SyntaxInfo} with {@link SyntaxInfo#builder(Class)}.
15561558
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
15571559
*/
1558-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1560+
@Deprecated(since = "2.14", forRemoval = true)
15591561
public static <E extends Section> void registerSection(Class<E> sectionClass, String... patterns) throws IllegalArgumentException {
15601562
checkAcceptRegistrations();
15611563
skript.syntaxRegistry().register(SyntaxRegistry.SECTION, SyntaxInfo.builder(sectionClass)
@@ -1569,7 +1571,7 @@ public static <E extends Section> void registerSection(Class<E> sectionClass, St
15691571
* @deprecated Use {@link SyntaxRegistry#syntaxes(Key)} with {@link SyntaxRegistry#STATEMENT}.
15701572
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
15711573
*/
1572-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1574+
@Deprecated(since = "2.14", forRemoval = true)
15731575
public static @Unmodifiable Collection<SyntaxElementInfo<? extends Statement>> getStatements() {
15741576
return instance().syntaxRegistry()
15751577
.syntaxes(SyntaxRegistry.STATEMENT).stream()
@@ -1581,7 +1583,7 @@ public static <E extends Section> void registerSection(Class<E> sectionClass, St
15811583
* @deprecated Use {@link SyntaxRegistry#syntaxes(Key)} with {@link SyntaxRegistry#CONDITION}.
15821584
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
15831585
*/
1584-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1586+
@Deprecated(since = "2.14", forRemoval = true)
15851587
public static @Unmodifiable Collection<SyntaxElementInfo<? extends Condition>> getConditions() {
15861588
return instance().syntaxRegistry()
15871589
.syntaxes(SyntaxRegistry.CONDITION).stream()
@@ -1593,7 +1595,7 @@ public static <E extends Section> void registerSection(Class<E> sectionClass, St
15931595
* @deprecated Use {@link SyntaxRegistry#syntaxes(Key)} with {@link SyntaxRegistry#EFFECT}.
15941596
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
15951597
*/
1596-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1598+
@Deprecated(since = "2.14", forRemoval = true)
15971599
public static @Unmodifiable Collection<SyntaxElementInfo<? extends Effect>> getEffects() {
15981600
return instance().syntaxRegistry()
15991601
.syntaxes(SyntaxRegistry.EFFECT).stream()
@@ -1605,7 +1607,7 @@ public static <E extends Section> void registerSection(Class<E> sectionClass, St
16051607
* @deprecated Use {@link SyntaxRegistry#syntaxes(Key)} with {@link SyntaxRegistry#SECTION}.
16061608
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
16071609
*/
1608-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1610+
@Deprecated(since = "2.14", forRemoval = true)
16091611
public static @Unmodifiable Collection<SyntaxElementInfo<? extends Section>> getSections() {
16101612
return instance().syntaxRegistry()
16111613
.syntaxes(SyntaxRegistry.SECTION).stream()
@@ -1628,7 +1630,7 @@ public static <E extends Section> void registerSection(Class<E> sectionClass, St
16281630
* Specify a custom priority ({@link SyntaxInfo.Builder#priority(Priority)}) to replace {@code type}.
16291631
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
16301632
*/
1631-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1633+
@Deprecated(since = "2.14", forRemoval = true)
16321634
public static <E extends Expression<T>, T> void registerExpression(
16331635
Class<E> expressionClass, Class<T> returnType, ExpressionType type, String... patterns
16341636
) throws IllegalArgumentException {
@@ -1645,7 +1647,7 @@ public static <E extends Expression<T>, T> void registerExpression(
16451647
* @deprecated Use {@link SyntaxRegistry#syntaxes(Key)} with {@link SyntaxRegistry#EXPRESSION}.
16461648
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
16471649
*/
1648-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1650+
@Deprecated(since = "2.14", forRemoval = true)
16491651
public static Iterator<ExpressionInfo<?, ?>> getExpressions() {
16501652
List<ExpressionInfo<?, ?>> list = new ArrayList<>();
16511653
for (SyntaxInfo.Expression<?, ?> info : instance().syntaxRegistry().syntaxes(SyntaxRegistry.EXPRESSION))
@@ -1658,7 +1660,7 @@ public static <E extends Expression<T>, T> void registerExpression(
16581660
* Use {@link SyntaxRegistry#syntaxes(Key)} with {@link SyntaxRegistry#SECTION} and filter the results.
16591661
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
16601662
*/
1661-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1663+
@Deprecated(since = "2.14", forRemoval = true)
16621664
public static Iterator<ExpressionInfo<?, ?>> getExpressions(Class<?>... returnTypes) {
16631665
return new CheckedIterator<>(getExpressions(), info -> {
16641666
if (info == null || info.returnType == Object.class)
@@ -1688,7 +1690,7 @@ public static <E extends Expression<T>, T> void registerExpression(
16881690
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
16891691
*/
16901692
@SuppressWarnings("unchecked")
1691-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1693+
@Deprecated(since = "2.14", forRemoval = true)
16921694
public static <E extends SkriptEvent> SkriptEventInfo<E> registerEvent(String name, Class<E> c, Class<? extends Event> event, String... patterns) {
16931695
return registerEvent(name, c, new Class[] {event}, patterns);
16941696
}
@@ -1706,7 +1708,7 @@ public static <E extends SkriptEvent> SkriptEventInfo<E> registerEvent(String na
17061708
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
17071709
*/
17081710
@SuppressWarnings("ConstantConditions") // caused by bad array annotations
1709-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1711+
@Deprecated(since = "2.14", forRemoval = true)
17101712
public static <E extends SkriptEvent> SkriptEventInfo<E> registerEvent(
17111713
String name, Class<E> eventClass, Class<? extends Event>[] events, String... patterns
17121714
) {
@@ -1723,7 +1725,7 @@ public static <E extends SkriptEvent> SkriptEventInfo<E> registerEvent(
17231725
* Create a {@link SyntaxInfo.Structure} with {@link SyntaxInfo.Structure#builder(Class)}.
17241726
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
17251727
*/
1726-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1728+
@Deprecated(since = "2.14", forRemoval = true)
17271729
public static <E extends Structure> void registerStructure(Class<E> structureClass, String... patterns) {
17281730
checkAcceptRegistrations();
17291731
skript.syntaxRegistry().register(SyntaxRegistry.STRUCTURE, SyntaxInfo.Structure.builder(structureClass)
@@ -1738,7 +1740,7 @@ public static <E extends Structure> void registerStructure(Class<E> structureCla
17381740
* Create a {@link SyntaxInfo.Structure} with {@link SyntaxInfo.Structure#builder(Class)}.
17391741
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
17401742
*/
1741-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1743+
@Deprecated(since = "2.14", forRemoval = true)
17421744
public static <E extends Structure> void registerSimpleStructure(Class<E> structureClass, String... patterns) {
17431745
checkAcceptRegistrations();
17441746
skript.syntaxRegistry().register(SyntaxRegistry.STRUCTURE, SyntaxInfo.Structure.builder(structureClass)
@@ -1754,7 +1756,7 @@ public static <E extends Structure> void registerSimpleStructure(Class<E> struct
17541756
* Create a {@link SyntaxInfo.Structure} with {@link SyntaxInfo.Structure#builder(Class)}.
17551757
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
17561758
*/
1757-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1759+
@Deprecated(since = "2.14", forRemoval = true)
17581760
public static <E extends Structure> void registerStructure(
17591761
Class<E> structureClass, EntryValidator entryValidator, String... patterns
17601762
) {
@@ -1766,7 +1768,7 @@ public static <E extends Structure> void registerStructure(
17661768
* Create a {@link SyntaxInfo.Structure} with {@link SyntaxInfo.Structure#builder(Class)}.
17671769
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
17681770
*/
1769-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1771+
@Deprecated(since = "2.14", forRemoval = true)
17701772
public static <E extends Structure> void registerStructure(
17711773
Class<E> structureClass, EntryValidator entryValidator, DefaultSyntaxInfos.Structure.NodeType nodeType, String... patterns
17721774
) {
@@ -1784,7 +1786,7 @@ public static <E extends Structure> void registerStructure(
17841786
* @deprecated Use {@link SyntaxRegistry#syntaxes(Key)} with {@link BukkitSyntaxInfos.Event#KEY}.
17851787
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
17861788
*/
1787-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1789+
@Deprecated(since = "2.14", forRemoval = true)
17881790
public static @Unmodifiable Collection<SkriptEventInfo<?>> getEvents() {
17891791
return instance().syntaxRegistry()
17901792
.syntaxes(BukkitSyntaxInfos.Event.KEY).stream()
@@ -1796,7 +1798,7 @@ public static <E extends Structure> void registerStructure(
17961798
* @deprecated Use {@link SyntaxRegistry#syntaxes(Key)} with {@link SyntaxRegistry#STRUCTURE}.
17971799
* Obtain a {@link SyntaxRegistry} through {@link org.skriptlang.skript.addon.SkriptAddon#syntaxRegistry()}.
17981800
*/
1799-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
1801+
@Deprecated(since = "2.14", forRemoval = true)
18001802
public static @Unmodifiable List<StructureInfo<? extends Structure>> getStructures() {
18011803
return instance().syntaxRegistry()
18021804
.syntaxes(SyntaxRegistry.STRUCTURE).stream()

src/main/java/ch/njol/skript/SkriptAddon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Register using {@link org.skriptlang.skript.Skript#registerAddon(Class, String)}.
2222
* Obtain a Skript instance with {@link Skript#instance()}.
2323
*/
24-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
24+
@Deprecated(since = "2.14", forRemoval = true)
2525
public final class SkriptAddon implements org.skriptlang.skript.addon.SkriptAddon {
2626

2727
public final JavaPlugin plugin;

src/main/java/ch/njol/skript/SkriptConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ public static String formatDate(final long timestamp) {
294294
})
295295
.optional(true);
296296

297-
public static final Option<Boolean> useTypeProperties = new Option<>("use type properties", false)
298-
.optional(true);
297+
public static final Option<Boolean> useTypeProperties = new Option<>("use type properties", true)
298+
.optional(false);
299299

300300
public static final Option<Boolean> allowUnsafePlatforms = new Option<>("allow unsafe platforms", false)
301301
.optional(true);

src/main/java/ch/njol/skript/bukkitutil/BukkitUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static boolean registryExists(String registry) {
4646
* @deprecated Use {@link Registry#MOB_EFFECT} or {@link Registry#EFFECT} depending on your version.
4747
*/
4848
@SuppressWarnings("NullableProblems")
49-
@Deprecated(since = "INSERT VERSION", forRemoval = true)
49+
@Deprecated(since = "2.14", forRemoval = true)
5050
public static @Nullable Registry<PotionEffectType> getPotionEffectTypeRegistry() {
5151
if (registryExists("MOB_EFFECT")) { // Paper (1.21.4)
5252
return Registry.MOB_EFFECT;

src/main/java/ch/njol/skript/classes/ClassInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.skriptlang.skript.addon.SkriptAddon;
1818
import org.skriptlang.skript.lang.properties.Property;
1919
import org.skriptlang.skript.lang.properties.Property.PropertyInfo;
20-
import org.skriptlang.skript.lang.properties.PropertyHandler;
20+
import org.skriptlang.skript.lang.properties.handlers.base.PropertyHandler;
2121

2222
import java.util.*;
2323
import java.util.function.Supplier;

src/main/java/ch/njol/skript/classes/EnumParser.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class EnumParser<E extends Enum<E>> extends PatternedParser<E> implements
2020
private final Class<E> enumClass;
2121
private final String languageNode;
2222
private String[] names;
23-
private final Map<String, E> parseMap = new HashMap<>();
23+
protected final Map<String, E> parseMap = new HashMap<>();
2424
private String[] patterns;
2525

2626
/**
@@ -65,11 +65,17 @@ void refresh() {
6565
String first = strippedOption.getFirst();
6666
Integer second = strippedOption.getSecond();
6767

68+
NonNullPair<String, String> singlePlural = Noun.getPlural(first);
69+
String single = singlePlural.getFirst();
70+
String plural = singlePlural.getSecond();
71+
6872
if (names[ordinal] == null) { // Add to name array if needed
69-
names[ordinal] = first;
73+
names[ordinal] = single;
7074
}
7175

72-
parseMap.put(first, constant);
76+
parseMap.put(single, constant);
77+
if (!plural.isEmpty())
78+
parseMap.put(plural, constant);
7379
if (second != -1) { // There is a gender present
7480
parseMap.put(Noun.getArticleWithSpace(second, Language.F_INDEFINITE_ARTICLE) + first, constant);
7581
}

0 commit comments

Comments
 (0)