Skip to content

Commit 62a4308

Browse files
committed
refactor: use @example annotations instead of @examples
1 parent 88aa019 commit 62a4308

97 files changed

Lines changed: 640 additions & 598 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/CondAllayCanDuplicate.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
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.Allay;
99
import org.bukkit.entity.LivingEntity;
1010

1111
@Name("Allay Can Duplicate")
1212
@Description("Checks to see if an allay is able to duplicate naturally.")
13-
@Examples({
14-
"if last spawned allay can duplicate:",
15-
"\tdisallow last spawned to duplicate"
16-
})
13+
@Example("""
14+
if last spawned allay can duplicate:
15+
disallow last spawned to duplicate
16+
""")
1717
@Since("2.11")
1818
public class CondAllayCanDuplicate extends PropertyCondition<LivingEntity> {
1919

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616

1717
@Name("Alphanumeric")
1818
@Description({"Checks if the given string is alphanumeric."})
19-
@Examples({"if the argument is not alphanumeric:",
20-
" send \"Invalid name!\""})
19+
@Examples("""
20+
if the argument is not alphanumeric:
21+
send "Invalid name!"
22+
""")
2123
@Since("2.4")
2224
public class CondAlphanumeric extends Condition {
2325

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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.Creeper;
@@ -12,10 +12,10 @@
1212

1313
@Name("Is Charged")
1414
@Description("Checks if a creeper, wither, or wither skull is charged (powered).")
15-
@Examples({
16-
"if the last spawned creeper is charged:",
17-
"\tbroadcast \"A charged creeper is at %location of last spawned creeper%\""
18-
})
15+
@Example("""
16+
if the last spawned creeper is charged:
17+
broadcast "A charged creeper is at %location of last spawned creeper%"
18+
""")
1919
@Since("2.5, 2.10 (withers, wither skulls)")
2020
public class CondIsCharged extends PropertyCondition<Entity> {
2121

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
import ch.njol.skript.conditions.base.PropertyCondition;
44
import ch.njol.skript.doc.*;
5+
import ch.njol.skript.doc.Example;
56
import org.bukkit.entity.LivingEntity;
67

78
@Name("Is Swimming")
89
@Description("Checks whether a living entity is swimming.")
9-
@Examples("player is swimming")
10+
@Example("player is swimming")
1011
@Since("2.3")
1112
public class CondIsSwimming extends PropertyCondition<LivingEntity> {
1213

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import ch.njol.skript.Skript;
55
import ch.njol.skript.SkriptCommand;
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
import ch.njol.skript.lang.Condition;
@@ -20,10 +20,8 @@
2020

2121
@Name("Is Script Loaded")
2222
@Description("Check if the current script, or another script, is currently loaded.")
23-
@Examples({
24-
"script is loaded",
25-
"script \"example.sk\" is loaded"
26-
})
23+
@Example("script is loaded")
24+
@Example("script \"example.sk\" is loaded")
2725
@Since("2.2-dev31")
2826
public class CondScriptLoaded extends Condition {
2927

src/main/java/ch/njol/skript/effects/EffApplyBoneMeal.java

Lines changed: 2 additions & 2 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,7 +18,7 @@
1818

1919
@Name("Apply Bone Meal")
2020
@Description("Applies bone meal to a crop, sapling, or composter")
21-
@Examples("apply 3 bone meal to event-block")
21+
@Example("apply 3 bone meal to event-block")
2222
@RequiredPlugins("MC 1.16.2+")
2323
@Since("2.8.0")
2424
public class EffApplyBoneMeal extends Effect {

src/main/java/ch/njol/skript/effects/EffBreakNaturally.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import ch.njol.skript.Skript;
99
import ch.njol.skript.aliases.ItemType;
1010
import ch.njol.skript.doc.Description;
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.Effect;
@@ -20,9 +20,18 @@
2020
@Description({"Breaks the block and spawns items as if a player had mined it",
2121
"\nYou can add a tool, which will spawn items based on how that tool would break the block ",
2222
"(ie: When using a hand to break stone, it drops nothing, whereas with a pickaxe it drops cobblestone)"})
23-
@Examples({"on right click:", "\tbreak clicked block naturally",
24-
"loop blocks in radius 10 around player:", "\tbreak loop-block using player's tool",
25-
"loop blocks in radius 10 around player:", "\tbreak loop-block naturally using diamond pickaxe"})
23+
@Example("""
24+
on right click:
25+
break clicked block naturally
26+
""")
27+
@Example("""
28+
loop blocks in radius 10 around player:
29+
break loop-block using player's tool
30+
""")
31+
@Example("""
32+
loop blocks in radius 10 around player:
33+
break loop-block naturally using diamond pickaxe
34+
""")
2635
@Since("2.4")
2736
public class EffBreakNaturally extends Effect {
2837

src/main/java/ch/njol/skript/effects/EffCharge.java

Lines changed: 5 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.Effect;
@@ -17,10 +17,10 @@
1717

1818
@Name("Charge Entity")
1919
@Description("Charges or uncharges a creeper or wither skull. A creeper is charged when it has been struck by lightning.")
20-
@Examples({
21-
"on spawn of creeper:",
22-
"\tcharge the event-entity"
23-
})
20+
@Example("""
21+
on spawn of creeper:
22+
charge the event-entity
23+
""")
2424
@Since("2.5, 2.10 (wither skulls)")
2525
public class EffCharge extends Effect {
2626

src/main/java/ch/njol/skript/effects/EffColorItems.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import ch.njol.skript.Skript;
1111
import ch.njol.skript.aliases.ItemType;
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.Effect;
@@ -27,8 +27,8 @@
2727
"You can also use RGB codes if you feel limited with the 16 default colors. " +
2828
"RGB codes are three numbers from 0 to 255 in the order <code>(red, green, blue)</code>, where <code>(0,0,0)</code> is black and <code>(255,255,255)</code> is white. " +
2929
"Armor is colorable for all Minecraft versions. With Minecraft 1.11 or newer you can also color potions and maps. Note that the colors might not look exactly how you'd expect.")
30-
@Examples({"dye player's helmet blue",
31-
"color the player's tool red"})
30+
@Example("dye player's helmet blue")
31+
@Example("color the player's tool red")
3232
@Since("2.0, 2.2-dev26 (maps and potions)")
3333
public class EffColorItems extends Effect {
3434

src/main/java/ch/njol/skript/effects/EffForceAttack.java

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

88
import ch.njol.skript.Skript;
99
import ch.njol.skript.doc.Description;
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.RequiredPlugins;
1313
import ch.njol.skript.doc.Since;
@@ -18,8 +18,10 @@
1818

1919
@Name("Force Attack")
2020
@Description("Makes a living entity attack an entity with a melee attack.")
21-
@Examples({"spawn a wolf at player's location",
22-
"make last spawned wolf attack player"})
21+
@Example("""
22+
spawn a wolf at player's location
23+
make last spawned wolf attack player
24+
""")
2325
@Since("2.5.1")
2426
@RequiredPlugins("Minecraft 1.15.2+")
2527
public class EffForceAttack extends Effect {
@@ -29,7 +31,7 @@ public class EffForceAttack extends Effect {
2931
"make %livingentities% attack %entity%",
3032
"force %livingentities% to attack %entity%");
3133
}
32-
34+
3335
@SuppressWarnings("null")
3436
private Expression<LivingEntity> entities;
3537
@SuppressWarnings("null")
@@ -52,7 +54,7 @@ protected void execute(Event e) {
5254
}
5355
}
5456
}
55-
57+
5658
@Override
5759
public String toString(@Nullable Event e, boolean debug) {
5860
return "make " + entities.toString(e, debug) + " attack " + target.toString(e, debug);

0 commit comments

Comments
 (0)