From 512941fa76228f01f60d83eb2781ce45317a24c0 Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sun, 27 Oct 2024 16:39:10 +0800 Subject: [PATCH] upgrade reflect doc --- docs/apidoc/reflect.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/apidoc/reflect.md b/docs/apidoc/reflect.md index 9db03ad..76a3318 100644 --- a/docs/apidoc/reflect.md +++ b/docs/apidoc/reflect.md @@ -66,4 +66,6 @@ Each `ReflectClass` has the following methods: - `method(...)` - This is the java method. - If it is an instance method (accessed from a ReflectClasses' `methods` property), the first argument should be an instance of the class. Eg: `ModAPI.reflect.getClassByName("EntityPlayerSP").methods.closeScreen.method(ModAPI.player.getRef())` - - If it is a static method (accessed from a ReflectClasses' `staticMethods` property), call the method as usual. Eg: `ModAPI.reflect.getClassById("net.minecraft.init.Items").staticMethods.getRegisteredItem.method(ModAPI.util.str("apple"))` \ No newline at end of file + - If it is a static method (accessed from a ReflectClasses' `staticMethods` property), call the method as usual. Eg: `ModAPI.reflect.getClassById("net.minecraft.init.Items").staticMethods.getRegisteredItem.method(ModAPI.util.str("apple"))` + +Keep in mind that you need to wrap strings using `ModAPI.util.str("MyString")`, convert booleans into respective numbers (`true`->`1`, `false`->`0`), and get references of ModAPI proxies (`ModAPI.player`->`ModAPI.player.getRef()`); \ No newline at end of file