Skip to content

Commit

Permalink
Requested Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderscoreTud committed Oct 30, 2023
1 parent 1fb2261 commit 8f42246
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ protected boolean checkHasPatterns() {
protected SectionNode[] getParseNode() {
SectionNode parseNode = getEntryContainer().getOptional("parse", SectionNode.class, false);
SectionNode safeParseNode = getEntryContainer().getOptional("safe parse", SectionNode.class, false);
if (parseNode != null && safeParseNode != null) {
Skript.error("A custom syntax element cannot contain both 'parse' and 'safe parse' entries");
return null;
}
if (safeParseNode != null) {
if (parseNode != null) {
Skript.error("A custom syntax element cannot contain both 'parse' and 'safe parse' entries");
return null;
}
Skript.warning("The 'safe parse' entry is deprecated and will act as a regular 'parse' entry."
+ " Please use the 'parse' entry instead");
return new SectionNode[] {safeParseNode};
}
return new SectionNode[] {parseNode};
return new SectionNode[] {parseNode};
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.ArrayList;
import java.util.List;

public class PatternsEntryData extends EntryData<List<String>> {
class PatternsEntryData extends EntryData<List<String>> {

public PatternsEntryData(String key, @Nullable List<String> defaultValue, boolean optional) {
super(key, defaultValue, optional);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public class StructCustomCondition extends CustomSyntaxStructure<ConditionSyntax
};
Skript.registerStructure(StructCustomCondition.class, customSyntaxValidator()
.addSection("check", false)
.build(), syntax);
.build(),
syntax
);
}

private static final DataTracker<ConditionSyntaxInfo> dataTracker = new DataTracker<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public class StructCustomEffect extends CustomSyntaxStructure<EffectSyntaxInfo>
};
Skript.registerStructure(StructCustomEffect.class, customSyntaxValidator()
.addSection("trigger", false)
.build(), syntax);
.build(),
syntax
);
}

private static final DataTracker<EffectSyntaxInfo> dataTracker = new DataTracker<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public boolean canCreateWith(String node) {
}
})
.addSection("check", true)
.build(), syntax);
.build(),
syntax
);
}

private static final DataTracker<EventSyntaxInfo> dataTracker = new DataTracker<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public class StructCustomExpression extends CustomSyntaxStructure<ExpressionSynt
EntryValidator.EntryValidatorBuilder builder = customSyntaxValidator()
.addEntryData(new KeyValueEntryData<Class<?>>("return type", null, true) {
@Override
protected @Nullable Class<?> getValue(String value) {
@Nullable
protected Class<?> getValue(String value) {
Class<?> returnType = Classes.getClassFromUserInput(value);
if (returnType == null)
Skript.error("The given return type doesn't exist");
Expand Down

0 comments on commit 8f42246

Please sign in to comment.