Cache booleanresult in asyncsink 1.12

This commit is contained in:
ZXMushroom63 2025-04-27 14:12:35 +08:00 committed by GitHub
parent 614d062d3e
commit cb0eb182d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,8 @@ ModAPI.meta.credits("By ZXMushroom63");
let booleanResult; let booleanResult;
if (ModAPI.is_1_12) { if (ModAPI.is_1_12) {
booleanResult = (b) => ModAPI.reflect.getClassById("net.lax1dude.eaglercraft.internal.teavm.BooleanResult").constructors[0](b*1); const _boolRes = ModAPI.reflect.getClassById("net.lax1dude.eaglercraft.internal.teavm.BooleanResult").constructors[0];
booleanResult = (b) => _boolRes(b*1);
} else { } else {
booleanResult = (b) => ModAPI.hooks.methods.nlevit_BooleanResult__new(b * 1); booleanResult = (b) => ModAPI.hooks.methods.nlevit_BooleanResult__new(b * 1);
} }