Skip to content

Commit 43dbfb1

Browse files
committed
refactor(docs): finish migrating syntaxes from Examples annotations to Example
this changes the rest of the vanilla Skript syntaxes. the old Examples annotation is left there because addons probably use it still
1 parent 2c14e5d commit 43dbfb1

548 files changed

Lines changed: 2769 additions & 2829 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.

src/main/java/ch/njol/skript/conditions/CondAI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
import ch.njol.skript.conditions.base.PropertyCondition;
66
import ch.njol.skript.doc.Description;
7-
import ch.njol.skript.doc.Examples;
7+
import ch.njol.skript.doc.Example;
88
import ch.njol.skript.doc.Name;
99
import ch.njol.skript.doc.Since;
1010

1111
@Name("Has AI")
1212
@Description("Checks whether an entity has AI.")
13-
@Examples("target entity has ai")
13+
@Example("target entity has ai")
1414
@Since("2.5")
1515
public class CondAI extends PropertyCondition<LivingEntity> {
1616

src/main/java/ch/njol/skript/conditions/CondAnchorWorks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import ch.njol.skript.Skript;
44
import ch.njol.skript.doc.Name;
55
import ch.njol.skript.doc.Description;
6-
import ch.njol.skript.doc.Examples;
6+
import ch.njol.skript.doc.Example;
77
import ch.njol.skript.doc.RequiredPlugins;
88
import ch.njol.skript.doc.Since;
99
import ch.njol.skript.lang.Condition;
@@ -16,7 +16,7 @@
1616

1717
@Name("Do Respawn Anchors Work")
1818
@Description("Checks whether or not respawn anchors work in a world.")
19-
@Examples("respawn anchors work in world \"world_nether\"")
19+
@Example("respawn anchors work in world \"world_nether\"")
2020
@RequiredPlugins("Minecraft 1.16+")
2121
@Since("2.7")
2222
public class CondAnchorWorks extends Condition {

src/main/java/ch/njol/skript/conditions/CondCanFly.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
import ch.njol.skript.conditions.base.PropertyCondition;
66
import ch.njol.skript.doc.Description;
7-
import ch.njol.skript.doc.Examples;
7+
import ch.njol.skript.doc.Example;
88
import ch.njol.skript.doc.Name;
99
import ch.njol.skript.doc.Since;
1010

1111
@Name("Can Fly")
1212
@Description("Whether a player is allowed to fly.")
13-
@Examples("player can fly")
13+
@Example("player can fly")
1414
@Since("2.3")
1515
public class CondCanFly extends PropertyCondition<Player> {
1616

src/main/java/ch/njol/skript/conditions/CondCanHold.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import ch.njol.skript.conditions.base.PropertyCondition;
1111
import ch.njol.skript.conditions.base.PropertyCondition.PropertyType;
1212
import ch.njol.skript.doc.Description;
13-
import ch.njol.skript.doc.Examples;
13+
import ch.njol.skript.doc.Example;
1414
import ch.njol.skript.doc.Name;
1515
import ch.njol.skript.doc.Since;
1616
import ch.njol.skript.lang.Condition;
@@ -25,8 +25,8 @@
2525
*/
2626
@Name("Can Hold")
2727
@Description("Tests whether a player or a chest can hold the given item.")
28-
@Examples({"block can hold 200 cobblestone",
29-
"player has enough space for 64 feathers"})
28+
@Example("block can hold 200 cobblestone")
29+
@Example("player has enough space for 64 feathers")
3030
@Since("1.0")
3131
public class CondCanHold extends Condition {
3232

src/main/java/ch/njol/skript/conditions/CondCanPickUpItems.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22

33
import ch.njol.skript.conditions.base.PropertyCondition;
44
import ch.njol.skript.doc.Description;
5-
import ch.njol.skript.doc.Examples;
5+
import ch.njol.skript.doc.Example;
66
import ch.njol.skript.doc.Name;
77
import ch.njol.skript.doc.Since;
88
import org.bukkit.entity.LivingEntity;
99

1010
@Name("Can Pick Up Items")
1111
@Description("Whether living entities are able to pick up items off the ground or not.")
12-
@Examples({
13-
"if player can pick items up:",
14-
"\tsend \"You can pick up items!\" to player",
15-
"",
16-
"on drop:",
17-
"\tif player can't pick up items:",
18-
"\t\tsend \"Be careful, you won't be able to pick that up!\" to player"
19-
})
12+
@Example("""
13+
if player can pick items up:
14+
send "You can pick up items!" to player
15+
""")
16+
@Example("""
17+
on drop:
18+
if player can't pick up items:
19+
send "Be careful, you won't be able to pick that up!" to player
20+
""")
2021
@Since("2.8.0")
2122
public class CondCanPickUpItems extends PropertyCondition<LivingEntity> {
2223

src/main/java/ch/njol/skript/conditions/CondCanSee.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515

1616
@Name("Can See")
1717
@Description("Checks whether the given players can see the provided entities.")
18-
@Examples({
19-
"if sender can't see the player-argument:",
20-
"\tmessage \"who dat?\"",
21-
"",
22-
"if the player can see the last spawned entity:",
23-
"\tmessage \"hello there!\""
24-
})
18+
@Example("""
19+
if sender can't see the player-argument:
20+
message "who dat?"
21+
""")
22+
@Example("""
23+
if the player can see the last spawned entity:
24+
message "hello there!"
25+
""")
2526
@Since("2.3, 2.10 (entities)")
2627
@RequiredPlugins("Minecraft 1.19+ (entities)")
2728
public class CondCanSee extends Condition {

src/main/java/ch/njol/skript/conditions/CondCancelled.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import ch.njol.skript.Skript;
44
import ch.njol.skript.doc.Description;
5-
import ch.njol.skript.doc.Examples;
5+
import ch.njol.skript.doc.Example;
66
import ch.njol.skript.doc.Name;
77
import ch.njol.skript.doc.Since;
88
import ch.njol.skript.lang.Condition;
@@ -15,10 +15,11 @@
1515

1616
@Name("Event Cancelled")
1717
@Description("Checks whether or not the event is cancelled.")
18-
@Examples({"on click:",
19-
"\tif event is cancelled:",
20-
"\t\tbroadcast \"no clicks allowed!\""
21-
})
18+
@Example("""
19+
on click:
20+
if event is cancelled:
21+
broadcast "no clicks allowed!"
22+
""")
2223
@Since("2.2-dev36")
2324
public class CondCancelled extends Condition {
2425

src/main/java/ch/njol/skript/conditions/CondChance.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import ch.njol.skript.Skript;
77
import ch.njol.skript.doc.Description;
8-
import ch.njol.skript.doc.Examples;
8+
import ch.njol.skript.doc.Example;
99
import ch.njol.skript.doc.Name;
1010
import ch.njol.skript.doc.Since;
1111
import ch.njol.skript.lang.Condition;
@@ -19,10 +19,12 @@
1919
@Name("Chance")
2020
@Description({"A condition that randomly succeeds or fails.",
2121
"Valid values are between 0% and 100%, or if the percent sign is omitted between 0 and 1."})
22-
@Examples({"chance of 50%:",
23-
"\tdrop a diamond",
24-
"chance of {chance}% # {chance} between 0 and 100",
25-
"chance of {chance} # {chance} between 0 and 1"})
22+
@Example("""
23+
chance of 50%:
24+
drop a diamond
25+
""")
26+
@Example("chance of {chance}% # {chance} between 0 and 100")
27+
@Example("chance of {chance} # {chance} between 0 and 1")
2628
@Since("1.0")
2729
public class CondChance extends Condition {
2830

src/main/java/ch/njol/skript/conditions/CondChatColors.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
@Name("Can See Chat Colors")
1010
@Description("Checks whether a player can see chat colors.")
11-
@Examples({
12-
"if player can see chat colors:",
13-
"\tsend \"Find the red word in <red>this<reset> message.\"",
14-
"else:",
15-
"\tsend \"You cannot partake in finding the colored word.\""
16-
})
11+
@Example("""
12+
if player can see chat colors:
13+
send "Find the red word in <red>this<reset> message."
14+
else:
15+
send "You cannot partake in finding the colored word."
16+
""")
1717
@RequiredPlugins("Paper")
1818
@Since("2.10")
1919
public class CondChatColors extends PropertyCondition<Player> {

0 commit comments

Comments
 (0)