|
11 | 11 | import ch.njol.skript.lang.SkriptParser.ParseResult; |
12 | 12 | import ch.njol.skript.registrations.EventValues; |
13 | 13 | import ch.njol.skript.variables.Variables; |
| 14 | +import ch.njol.skript.doc.Example; |
14 | 15 | import ch.njol.util.Kleenean; |
15 | 16 | import org.bukkit.Bukkit; |
16 | 17 | import org.bukkit.WorldBorder; |
|
23 | 24 | import java.util.concurrent.atomic.AtomicBoolean; |
24 | 25 |
|
25 | 26 | @Name("Create WorldBorder") |
26 | | -@Description("Create a virtual worldborder. You can make this a real border by setting a world's worldborder to a virtual border.") |
27 | | -@Examples({ |
28 | | - "set player's worldborder to a virtual worldborder", |
29 | | - "", |
30 | | - "on join:", |
31 | | - "\tset {_border} to a worldborder:", |
32 | | - "\t\tset worldborder radius to 25", |
33 | | - "\t\tset worldborder warning distance of event-worldborder to 5", |
34 | | - "\tset worldborder of player to {_border}" |
| 27 | +@Description({ |
| 28 | + "Creates a new, unused world border. World borders can be assigned to either worlds or specific players.", |
| 29 | + "Borders assigned to worlds apply to all players in that world.", |
| 30 | + "Borders assigned to players apply only to those players, and different players can have different borders." |
35 | 31 | }) |
| 32 | +@Example(""" |
| 33 | + on join: |
| 34 | + set {_location} to location of player |
| 35 | + set worldborder of player to a virtual worldborder: |
| 36 | + set worldborder radius to 25 |
| 37 | + set world border center of event-worldborder to {_location} |
| 38 | + """) |
| 39 | +@Example(""" |
| 40 | + on load: |
| 41 | + set worldborder of world "world" to a worldborder: |
| 42 | + set worldborder radius of event-worldborder to 200 |
| 43 | + set worldborder center of event-worldborder to location(0, 64, 0) |
| 44 | + set worldborder warning distance of event-worldborder to 5 |
| 45 | + """) |
36 | 46 | @Since("2.11") |
37 | 47 | public class ExprSecCreateWorldBorder extends SectionExpression<WorldBorder> { |
38 | 48 |
|
@@ -80,7 +90,7 @@ public Class<WorldBorder> getReturnType() { |
80 | 90 |
|
81 | 91 | @Override |
82 | 92 | public String toString(@Nullable Event event, boolean debug) { |
83 | | - return "a worldborder"; |
| 93 | + return "a virtual worldborder"; |
84 | 94 | } |
85 | 95 |
|
86 | 96 | public static class CreateWorldborderEvent extends Event { |
|
0 commit comments