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
This script does not work, specifically this line ReflectionUtil.invokeMethod(event.context, "fill", 100, 100, 200, 200, -1); does not work.
constscript=registerScript({name: "IssueExample",version: "1.0.0",authors: ["Ajax"]});script.registerModule({name: "IssueExample_drawGuiTexture",category: "Client",description: "Sausage"},(mod)=>{mod.on("overlayRender",(event)=>{if(!mc.player||!mc.world)return;// Should map to method_52706, but (probably) maps to method_52709// inb4 some smartass goes "oh this is because of null!1!", noconsole.log(event);console.log(event.context);console.log(event.context.drawGuiTexture);ReflectionUtil.invokeMethod(event.context,"drawGuiTexture",null,100,100,200,200);})});script.registerModule({name: "IssueExample_fill",category: "Client",description: "Sausage"},(mod)=>{mod.on("overlayRender",(event)=>{if(!mc.player||!mc.world)return;// Should map to method_25294, but (probably) maps to method_51737console.log(event);console.log(event.context);console.log(event.context.fill);ReflectionUtil.invokeMethod(event.context,"fill",100,100,200,200,-1);})});
Steps to reproduce
save the script as a js file in the script folder (either from a launcher or gradle)
launch LB
enable module IssueExample_fill
expect to see a white square rendering on screen, actually see visible drops in FPS.
First I swapped name and method.name as shown in the screenshot, and placed a breakpoint in the next line, after the change the break point was hit 4 times/invokeMethod call with the previous args (4 overloads in that class). Only the one in the screenshot seems to be one having a signature that matches the args, but one type is int and the other is class java.lang.Integer so they aren't equal. We might need a dedicated function for matching the args that can be null or primitive types. Not yet sure where the performance hit comes from, could be printing or this function calling, will do a profiling later.
commandblock2
changed the title
[BUG] invokeMethod in ScriptReflectionUtil cannot correctly filter method based on args (and potentially other methods)
[BUG] invokeMethod in ScriptReflectionUtil cannot correctly filter method based on args (and potentially other methods)
Dec 23, 2024
commandblock2
changed the title
[BUG] invokeMethod in ScriptReflectionUtil cannot correctly filter method based on args (and potentially other methods)
[BUG] invokeMethod in ScriptReflectionUtil cannot correctly filter method based on args
Dec 23, 2024
LiquidBounce Branch
Nextgen
LiquidBounce Build/Version
git-5d29ed9
Operating System
Linux
Minecraft Version
1.21.1
Describe the bug
This script does not work, specifically this line
ReflectionUtil.invokeMethod(event.context, "fill", 100, 100, 200, 200, -1);
does not work.Steps to reproduce
IssueExample_fill
Client Log
Screenshots
The text was updated successfully, but these errors were encountered: