Skip to content

Commit b1dba01

Browse files
committed
\n for newline instead of array
Only 3 actions use this so its really just annoying (also makes it easier to add actions to dfscript online 😁😁😁)
1 parent 3fc09e0 commit b1dba01

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/main/java/io/github/techstreet/dfscript/script/action/ScriptActionType.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ public enum ScriptActionType {
16241624
})),
16251625

16261626
REPEAT_FOREVER(builder -> builder.name("RepeatForever")
1627-
.description(new String[]{"Repeats for eternity.", "Make sure to have a Stop Repetition, Stop Codeline or Wait somewhere in the code!", "There's a lagslayer for the repetition actions.", "It activates after 100000 iterations with no Wait."})
1627+
.description("Repeats for eternity.\nMake sure to have a Stop Repetition, Stop Codeline or Wait somewhere in the code!\nThere's a lagslayer for the repetition actions.\nIt activates after 100000 iterations with no Wait.")
16281628
.icon(Items.GOLD_INGOT)
16291629
.category(ScriptActionCategory.MISC)
16301630
.hasChildren(true)
@@ -1633,7 +1633,7 @@ public enum ScriptActionType {
16331633
ctx.scheduleInner(null, context -> context.setLastIfResult(true));
16341634
})),
16351635
ELSE(builder -> builder.name("Else")
1636-
.description(new String[]{"Executes if the last IF condition failed.","And ELSE also works as a valid IF condition for ELSE."})
1636+
.description("Executes if the last IF condition failed.\nAnd ELSE also works as a valid IF condition for ELSE.")
16371637
.icon(Items.END_STONE)
16381638
.category(ScriptActionCategory.MISC)
16391639
.group(ScriptGroup.CONDITION)
@@ -1682,7 +1682,7 @@ public enum ScriptActionType {
16821682
})),
16831683

16841684
REGEX_REPLACE_TEXT(builder -> builder.name("Replace Text using Regex")
1685-
.description(new String[]{"Searches for part of a text", "using a regex and replaces it."})
1685+
.description("Searches for part of a text\nusing a regex and replaces it.")
16861686
.icon(Items.LEAD, true)
16871687
.arg("Result", ScriptActionArgumentType.VARIABLE)
16881688
.arg("Text to change", ScriptActionArgumentType.TEXT)
@@ -1869,17 +1869,11 @@ private ScriptActionType category(ScriptActionCategory category) {
18691869

18701870
private ScriptActionType description(String description) {
18711871
this.description.clear();
1872-
this.description.add(description);
1872+
this.description.addAll(Arrays.asList(description.split("\n", -1)));
1873+
18731874
return this;
18741875
}
18751876

1876-
private ScriptActionType description(String[] description) {
1877-
this.description.clear();
1878-
1879-
this.description.addAll(Arrays.asList(description));
1880-
1881-
return this;
1882-
}
18831877
private ScriptActionType group(ScriptGroup group) {
18841878
this.group = group;
18851879
return this;

0 commit comments

Comments
 (0)