You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
# skript-mirror-tp
1
+
# skript-reflect
2
2
3
3
This fork of [skript-mirror](https://github.com/btk5h/skript-mirror) aims to fix multiple issues that I believe have been present for too long, and implement some long-wanted features.
Downloads: [actions](https://github.com/TPGamesNL/skript-mirror/actions?query=event%3Apush+is%3Asuccess+actor%3ATPGamesNL) (I'll probably release an actual version soon).
9
+
Downloads: [actions](https://github.com/TPGamesNL/skript-reflect/actions?query=event%3Apush+is%3Asuccess+actor%3ATPGamesNL) (I'll probably release an actual version soon).
10
10
11
11
If you want to talk about this project or something else, contact me on Discord: TPGamesNL#0880
Copy file name to clipboardExpand all lines: docs/advanced/custom-syntax/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Custom syntax
2
2
3
-
Due to Skript and skript-mirror limitations, it is not easy to create custom syntax through Java calls alone. To help with this, skript-mirror offers utilities that simplify the creation of custom syntax.
3
+
Due to Skript and skript-reflect limitations, it is not easy to create custom syntax through Java calls alone. To help with this, skript-reflect offers utilities that simplify the creation of custom syntax.
Copy file name to clipboardExpand all lines: docs/advanced/custom-syntax/events.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@
5
5
{% code-tabs %}
6
6
{% code-tabs-item title="Syntax" %}
7
7
```text
8
-
[local] [custom] event <pattern>:
9
-
name: # unique name, required
8
+
[local] [custom] event %string%:
9
+
pattern: # pattern, required
10
10
event-values: # list of types, optional
11
11
parse:
12
12
# code, optional
@@ -21,10 +21,9 @@
21
21
{% code-tabs %}
22
22
{% code-tabs-item title="Syntax" %}
23
23
```text
24
-
[local] [custom] event:
24
+
[local] [custom] event %string%:
25
25
patterns:
26
26
# patterns, one per line
27
-
name: # unique name, required
28
27
event-values: # list of types, optional
29
28
parse:
30
29
# code, optional
@@ -44,9 +43,10 @@ Specifying that an event is `local` makes the event only usable from within the
44
43
Local events are guaranteed to be parsed before other custom events, but not necessarily before events from other addons.
45
44
{% endhint %}
46
45
47
-
### Option `name`
46
+
### Event identifier
48
47
49
-
The name you specify here should be used for [`calling the event`](#calling-the-event).
48
+
The string used in the trigger line represents the identifier of this custom event.
49
+
This identifier should be used for [`calling the event`](#calling-the-event).
50
50
51
51
### Option `event-values`
52
52
@@ -56,23 +56,23 @@ The event-values specified here will be available in the event, either as a defa
56
56
57
57
Code in this section is executed whenever the event is parsed. This section may be used to emit errors if the effect is used in an improper context.
58
58
59
-
If this section is included, you must also [`continue`](./#continue) if the event was parsed successfully.
59
+
If this section is included, you must also [`continue`](README.md#continue) if the event was parsed successfully.
60
60
61
61
{% hint style="info" %}
62
62
Local variables created in this section are copied by-value to other sections.
63
63
64
64
{% code-tabs %}
65
65
{% code-tabs-item title="example.sk" %}
66
66
```text
67
-
event example:
68
-
name: example
67
+
event "example":
68
+
pattern: example
69
69
parse:
70
70
set {_test} to 1
71
71
continue
72
72
check:
73
73
# {_test} always starts at 1 here
74
74
add 1 to {_test}
75
-
# 2 is always broadcast
75
+
# broadcasts 2
76
76
broadcast "%{_test}%"
77
77
```
78
78
{% endcode-tabs-item %}
@@ -83,7 +83,7 @@ event example:
83
83
84
84
Code in this section is executed just before the event is called. This section may be used to stop the event from being called if certain conditions are met.
85
85
86
-
If this section is included, you must also [`continue`](./#continue) if you want to event to be called.
86
+
If this section is included, you must also [`continue`](README.md#continue) if you want to event to be called.
Copy file name to clipboardExpand all lines: docs/advanced/error-handling.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Error handling
2
2
3
-
By default, warnings and errors related to your code are logged to the console. Skript-mirror also offers additional tools that give you more control over how errors are handled.
3
+
By default, warnings and errors related to your code are logged to the console. Skript-reflect also offers additional tools that give you more control over how errors are handled.
4
4
5
5
## Suppressing errors
6
6
@@ -31,5 +31,5 @@ In some cases, you may want to handle errors yourself, either to do your own err
31
31
{% endcode-tabs-item %}
32
32
{% endcode-tabs %}
33
33
34
-
Returns the last error object thrown by a java call. If there was an issue resolving the method or converting its output, it may be a `com.btk5h.skriptmirror.JavaCallException`.
34
+
Returns the last error object thrown by a java call. If there was an issue resolving the method or converting its output, it may be a `com.btk5h.skriptmirror.JavaCallException`.
I understand that the following features are experimental and may change in the future.
62
-
I have read about this at https://skript-mirror.gitbook.io/docs/advanced/experiments
63
-
proxies
64
-
65
-
function do_something():
66
-
broadcast "It does something!"
67
-
68
-
command /proxy:
69
-
trigger:
70
-
# As you can see on https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html
71
-
# the Runnable interface has one method: run
72
-
set {_functions::run} to function reference "do_something"
73
-
set {_proxy} to new proxy instance of Runnable using {_functions::*}
74
-
{_proxy}.run() # will broadcast 'It does something!'
75
-
Bukkit.getScheduler().runTask(Skript.getInstance(), {_proxy}) # also broadcasts 'It does something!'
76
-
```
77
-
{% endcode-tabs-item %}
78
-
{% endcode-tabs %}
79
-
80
-
{% hint style="info" %}
81
-
Class proxies are most useful for more interaction with Java code, for example when methods require some implementation of an interface.
82
-
{% endhint %}
83
-
84
21
## `deferred-parsing`
85
22
86
23
Deferred parsing allows you to prefix any line with `(parse[d] later)` to defer parsing until the first execution of the line. This allows you to circumvent issues where custom syntaxes are used before they are defined.
Normally, you may only access classes loaded in the server's classpath, such as Java standard library classes, Bukkit classes, and plugin classes. If you want to use third-party libraries that are not included on the server classpath, you must load them through skript-mirror first.
3
+
Normally, you may only access classes loaded in the server's classpath, such as Java standard library classes, Bukkit classes, and plugin classes. If you want to use third-party libraries that are not included on the server classpath, you must load them through skript-reflect first.
4
4
5
-
To load a jar file, place it in `plugins/skript-mirror/`\(create the folder if it doesn't exist\).
5
+
To load a jar file, place it in `plugins/skript-reflect/`\(create the folder if it doesn't exist\).
6
6
7
7
Once an external library is loaded, its classes may be imported just like any other class.
0 commit comments