From 2f9edbc3815427e1108a3223508ffebbfeafd7a7 Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Thu, 29 May 2025 16:16:32 +0800 Subject: [PATCH] only allow sound keygen on 1.12 --- core/postinit.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/postinit.js b/core/postinit.js index 089dc7d..e8049b1 100644 --- a/core/postinit.js +++ b/core/postinit.js @@ -1249,6 +1249,9 @@ const modapi_postinit = "(" + (() => { return qhash(entity, values, 127); } ModAPI.keygen.sound = function (soundId) { + if (!ModAPI.is_1_12) { + return -1; + } 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);