Skip to content

Commit 9888d1d

Browse files
committed
refactor(docs): continue work on Examples->Example migration
1 parent f396ae4 commit 9888d1d

40 files changed

Lines changed: 318 additions & 298 deletions

src/main/java/ch/njol/skript/expressions/ExprActiveItem.java

Lines changed: 6 additions & 6 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.RequiredPlugins;
88
import ch.njol.skript.doc.Since;
@@ -18,11 +18,11 @@
1818
"the bow they're drawing back, etc.). This cannot be changed. " +
1919
"If an entity is not using any item, this will return null."
2020
)
21-
@Examples({
22-
"on damage of player:",
23-
"\tif victim's active tool is a bow:",
24-
"\t\tinterrupt player's active item use"
25-
})
21+
@Example("""
22+
on damage of player:
23+
if victim's active tool is a bow:
24+
interrupt player's active item use
25+
""")
2626
@Since("2.8.0")
2727
@RequiredPlugins("Paper")
2828
public class ExprActiveItem extends SimplePropertyExpression<LivingEntity, ItemStack> {

src/main/java/ch/njol/skript/expressions/ExprAttacker.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import ch.njol.skript.Skript;
1616
import ch.njol.skript.doc.Description;
1717
import ch.njol.skript.doc.Events;
18-
import ch.njol.skript.doc.Examples;
18+
import ch.njol.skript.doc.Example;
1919
import ch.njol.skript.doc.Name;
2020
import ch.njol.skript.doc.Since;
2121
import ch.njol.skript.lang.Expression;
@@ -32,10 +32,12 @@
3232
@Name("Attacker")
3333
@Description({"The attacker of a damage event, e.g. when a player attacks a zombie this expression represents the player.",
3434
"Please note that the attacker can also be a block, e.g. a cactus or lava, but this expression will not be set in these cases."})
35-
@Examples({"on damage:",
36-
" attacker is a player",
37-
" health of attacker is less than or equal to 2",
38-
" damage victim by 1 heart"})
35+
@Example("""
36+
on damage:
37+
attacker is a player
38+
health of attacker is less than or equal to 2
39+
damage victim by 1 heart
40+
""")
3941
@Since("1.3")
4042
@Events({"damage", "death", "destroy"})
4143
public class ExprAttacker extends SimpleExpression<Entity> implements EventRestrictedSyntax {

src/main/java/ch/njol/skript/expressions/ExprBlock.java

Lines changed: 13 additions & 9 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.expressions.base.EventValueExpression;
@@ -25,14 +25,18 @@
2525
@Name("Block")
2626
@Description({"The block involved in the event, e.g. the clicked block or the placed block.",
2727
"Can optionally include a direction as well, e.g. 'block above' or 'block in front of the player'."})
28-
@Examples({"block is iron ore",
29-
"set block below to air",
30-
"spawn a creeper above the block",
31-
"loop blocks in radius 4:",
32-
" loop-block is obsidian",
33-
" set loop-block to water",
34-
"block is a chest:",
35-
" clear the inventory of the block"})
28+
@Example("block is iron ore")
29+
@Example("set block below to air")
30+
@Example("spawn a creeper above the block")
31+
@Example("""
32+
loop blocks in radius 4:
33+
loop-block is obsidian
34+
set loop-block to water
35+
""")
36+
@Example("""
37+
block is a chest:
38+
clear the inventory of the block
39+
""")
3640
@Since("1.0")
3741
public class ExprBlock extends WrapperExpression<Block> {
3842
static {

src/main/java/ch/njol/skript/expressions/ExprEnchantmentBonus.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import ch.njol.skript.Skript;
88
import ch.njol.skript.doc.Description;
99
import ch.njol.skript.doc.Events;
10-
import ch.njol.skript.doc.Examples;
10+
import ch.njol.skript.doc.Example;
1111
import ch.njol.skript.doc.Name;
1212
import ch.njol.skript.doc.Since;
1313
import ch.njol.skript.lang.Expression;
@@ -19,8 +19,10 @@
1919

2020
@Name("Enchantment Bonus")
2121
@Description("The enchantment bonus in an enchant prepare event. This represents the number of bookshelves affecting/surrounding the enchantment table.")
22-
@Examples({"on enchant:",
23-
"\tsend \"There are %enchantment bonus% bookshelves surrounding this enchantment table!\" to player"})
22+
@Example("""
23+
on enchant:
24+
send "There are %enchantment bonus% bookshelves surrounding this enchantment table!" to player
25+
""")
2426
@Events("enchant prepare")
2527
@Since("2.5")
2628
public class ExprEnchantmentBonus extends SimpleExpression<Long> {

src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import ch.njol.skript.Skript;
44
import ch.njol.skript.classes.Changer.ChangeMode;
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.Name;
88
import ch.njol.skript.doc.Since;
99
import ch.njol.skript.expressions.base.PropertyExpression;
@@ -28,11 +28,11 @@
2828
"Note that the movement speed attribute cannot be reliably used for players. For that purpose, use the speed expression instead.",
2929
"Resetting an entity's attribute is only available in Minecraft 1.11 and above."
3030
})
31-
@Examples({
32-
"on damage of player:",
33-
"\tsend \"You are wounded!\" to victim",
34-
"\tset victim's attack speed attribute to 2"
35-
})
31+
@Example("""
32+
on damage of player:
33+
send "You are wounded!" to victim
34+
set victim's attack speed attribute to 2
35+
""")
3636
@Since("2.5, 2.6.1 (final attribute value)")
3737
public class ExprEntityAttribute extends PropertyExpression<Entity, Number> {
3838

src/main/java/ch/njol/skript/expressions/ExprEvtInitiator.java

Lines changed: 6 additions & 6 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.Description;
55
import ch.njol.skript.doc.Events;
6-
import ch.njol.skript.doc.Examples;
6+
import ch.njol.skript.doc.Example;
77
import ch.njol.skript.doc.Name;
88
import ch.njol.skript.doc.Since;
99
import ch.njol.skript.lang.Expression;
@@ -19,11 +19,11 @@
1919

2020
@Name("Initiator Inventory")
2121
@Description("Returns the initiator inventory in an on <a href=\"?search=#inventory_item_move\">inventory item move</a> event.")
22-
@Examples({
23-
"on inventory item move:",
24-
"\tholder of event-initiator-inventory is a chest",
25-
"\tbroadcast \"Item transport happening at %location at holder of event-initiator-inventory%!\""
26-
})
22+
@Example("""
23+
on inventory item move:
24+
holder of event-initiator-inventory is a chest
25+
broadcast "Item transport happening at %location at holder of event-initiator-inventory%!"
26+
""")
2727
@Events("Inventory Item Move")
2828
@Since("2.8.0")
2929
public class ExprEvtInitiator extends SimpleExpression<Inventory> {

src/main/java/ch/njol/skript/expressions/ExprExperienceCooldown.java

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

33
import ch.njol.skript.classes.Changer.ChangeMode;
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.expressions.base.SimplePropertyExpression;
@@ -19,12 +19,12 @@
1919
"Experience cooldown is how long until a player can pick up another orb of experience.",
2020
"The cooldown of a player must be 0 to pick up another orb of experience."
2121
})
22-
@Examples({
23-
"send experience cooldown of player",
24-
"set the xp pickup cooldown of player to 1 hour",
25-
"if exp collection cooldown of player >= 10 minutes:",
26-
"\tclear the experience pickup cooldown of player"
27-
})
22+
@Example("send experience cooldown of player")
23+
@Example("set the xp pickup cooldown of player to 1 hour")
24+
@Example("""
25+
if exp collection cooldown of player >= 10 minutes:
26+
clear the experience pickup cooldown of player
27+
""")
2828
@Since("2.10")
2929
public class ExprExperienceCooldown extends SimplePropertyExpression<Player, Timespan> {
3030

src/main/java/ch/njol/skript/expressions/ExprExperienceCooldownChangeReason.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package ch.njol.skript.expressions;
22

33
import ch.njol.skript.doc.Description;
4-
import ch.njol.skript.doc.Examples;
4+
import ch.njol.skript.doc.Example;
55
import ch.njol.skript.doc.Name;
66
import ch.njol.skript.doc.Since;
77
import ch.njol.skript.expressions.base.EventValueExpression;
@@ -14,13 +14,13 @@
1414
"The <a href='#experiencechangereason'>experience change reason</a> within an " +
1515
"<a href='#experience%20cooldown%20change%20event'>experience cooldown change event</a>."
1616
})
17-
@Examples({
18-
"on player experience cooldown change:",
19-
"\tif xp cooldown change reason is plugin:",
20-
"\t\t#Changed by a plugin",
21-
"\telse if xp cooldown change reason is orb pickup:",
22-
"\t\t#Changed by picking up xp orb"
23-
})
17+
@Example("""
18+
on player experience cooldown change:
19+
if xp cooldown change reason is plugin:
20+
#Changed by a plugin
21+
else if xp cooldown change reason is orb pickup:
22+
#Changed by picking up xp orb
23+
""")
2424
@Since("2.10")
2525
public class ExprExperienceCooldownChangeReason extends EventValueExpression<ChangeReason> {
2626

src/main/java/ch/njol/skript/expressions/ExprExplosionBlockYield.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import ch.njol.skript.classes.Changer.ChangeMode;
99
import ch.njol.skript.doc.Description;
1010
import ch.njol.skript.doc.Events;
11-
import ch.njol.skript.doc.Examples;
11+
import ch.njol.skript.doc.Example;
1212
import ch.njol.skript.doc.Name;
1313
import ch.njol.skript.doc.Since;
1414
import ch.njol.skript.lang.Expression;
@@ -23,8 +23,10 @@
2323
@Description({"The percentage of exploded blocks dropped in an explosion event.",
2424
"When changing the yield, a value greater than 1 will function the same as using 1.",
2525
"Attempting to change the yield to a value less than 0 will have no effect."})
26-
@Examples({"on explode:",
27-
"set the explosion's block yield to 10%"})
26+
@Example("""
27+
on explode:
28+
set the explosion's block yield to 10%
29+
""")
2830
@Events("explosion")
2931
@Since("2.5")
3032
public class ExprExplosionBlockYield extends SimpleExpression<Number> {

src/main/java/ch/njol/skript/expressions/ExprFallDistance.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66

77
import ch.njol.skript.classes.Changer.ChangeMode;
88
import ch.njol.skript.doc.Description;
9-
import ch.njol.skript.doc.Examples;
9+
import ch.njol.skript.doc.Example;
1010
import ch.njol.skript.doc.Name;
1111
import ch.njol.skript.doc.Since;
1212
import ch.njol.skript.expressions.base.SimplePropertyExpression;
1313
import ch.njol.util.coll.CollectionUtils;
1414

1515
@Name("Fall Distance")
1616
@Description({"The distance an entity has fallen for."})
17-
@Examples({"set all entities' fall distance to 10",
18-
"on damage:",
19-
"\tsend \"%victim's fall distance%\" to victim"})
17+
@Example("""
18+
set all entities' fall distance to 10
19+
on damage:
20+
send "%victim's fall distance%" to victim
21+
""")
2022
@Since("2.5")
2123
public class ExprFallDistance extends SimplePropertyExpression<Entity, Number> {
2224

0 commit comments

Comments
 (0)