mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-22 21:51:17 -09:00
update block and item keygen functions for 1.12
This commit is contained in:
parent
734db357cf
commit
5ee3e7d97f
@ -1224,6 +1224,7 @@ const modapi_postinit = "(" + (() => {
|
||||
var NonNullList = ModAPI.reflect.getClassById("net.minecraft.util.NonNullList").class;
|
||||
var ArrayAsList = ModAPI.reflect.getClassById("java.util.Arrays$ArrayAsList").class;
|
||||
easyStaticPropAlias("net.minecraft.block.Block", "REGISTRY", "blockRegistry");
|
||||
easyStaticPropAlias("net.minecraft.item.Item", "REGISTRY", "itemRegistry");
|
||||
}
|
||||
|
||||
ModAPI.util.qhash = function qhash(txt, arr, interval) {
|
||||
@ -1257,11 +1258,19 @@ const modapi_postinit = "(" + (() => {
|
||||
return registryNamespaceMethod.apply(this, args);
|
||||
}
|
||||
ModAPI.keygen.item = function (item) {
|
||||
var values = [...ModAPI.reflect.getClassById("net.minecraft.item.Item").staticVariables.itemRegistry.$modapi_specmap.values()];
|
||||
if (ModAPI.is_1_12) {
|
||||
var values = ModAPI.util.wrap(ModAPI.reflect.getClassById("net.minecraft.item.Item").staticVariables.REGISTRY).getCorrective().underlyingIntegerMap.identityMap.elementData.filter(x => !!x).map(y => y.value.value);
|
||||
} else {
|
||||
var values = [...ModAPI.reflect.getClassById("net.minecraft.item.Item").staticVariables.itemRegistry.$modapi_specmap.values()];
|
||||
}
|
||||
return qhash(item, values, 4095);
|
||||
}
|
||||
ModAPI.keygen.block = function (block) {
|
||||
var values = [...ModAPI.reflect.getClassById("net.minecraft.block.Block").staticVariables.blockRegistry.$modapi_specmap.values()];
|
||||
if (ModAPI.is_1_12) {
|
||||
var values = ModAPI.util.wrap(ModAPI.reflect.getClassById("net.minecraft.block.Block").staticVariables.REGISTRY).getCorrective().underlyingIntegerMap.identityMap.elementData.filter(x => !!x).map(y => y.value.value);
|
||||
} else {
|
||||
var values = [...ModAPI.reflect.getClassById("net.minecraft.block.Block").staticVariables.blockRegistry.$modapi_specmap.values()];
|
||||
}
|
||||
return qhash(block, values, 4095);
|
||||
}
|
||||
ModAPI.keygen.entity = function (entity) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user