Events are defined statically in normal classes and added handler for extensions to add their built-ins
This commit is contained in:
1 parent
815c75b827
commit
3105d5bb71
11 files changed
+126
-113
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package carpet;
|
||||
|
||||
import carpet.script.CarpetExpression;
|
||||
import carpet.settings.SettingsManager;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -65,4 +66,21 @@ public interface CarpetExtension
|
||||
|
||||
default Map<String, String> canHasTranslations(String lang) { return null;}
|
||||
|
||||
/**
|
||||
* Handles each call that creates / parses the scarpet expression.
|
||||
* Extensions can add their own built-in functions here.
|
||||
*
|
||||
* Events such as generic events or entity events, can be added statically
|
||||
* by creating new events as
|
||||
*
|
||||
* CarpetEventServer.Event class: to handle `__on_foo()` type of call definitions
|
||||
*
|
||||
* or
|
||||
*
|
||||
* EntityEventsGroup.Event class: to handle `entity_event('foo', ...)` type of events
|
||||
*
|
||||
* @param expression: Passed CarpetExpression to add built-in functions to
|
||||
*/
|
||||
default void scarpetApi(CarpetExpression expression) {}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user