add keygen for sound objects in 1.12

This commit is contained in:
ZXMushroom63 2025-05-29 16:16:14 +08:00
parent 00358df441
commit a3189d3d99

View File

@ -1248,6 +1248,11 @@ const modapi_postinit = "(" + (() => {
} }
return qhash(entity, values, 127); return qhash(entity, values, 127);
} }
ModAPI.keygen.sound = function (soundId) {
const SoundEvent = ModAPI.reflect.getClassByName("SoundEvent")
const values = ModAPI.util.wrap(SoundEvent.staticVariables.REGISTRY).getCorrective().underlyingIntegerMap.identityMap.elementData.filter(x=>!!x).map(y=>y.value.value);
return qhash(soundId, values, 4095);
}
}).toString() + ")();"; }).toString() + ")();";
if (globalThis.process) { if (globalThis.process) {