16 million item IDs

This commit is contained in:
FalsePattern committed 2022-03-17 22:24:32 +01:00
1 parent c486782e32
commit 366582f781
13 files changed
+260 -139

No files matched your search

@@ -2,6 +2,7 @@ package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import lombok.var;
import org.objectweb.asm.tree.FieldNode;
import com.falsepattern.endlessids.asm.AsmTransformException;
import org.objectweb.asm.tree.MethodNode;
@@ -17,7 +18,11 @@ public class FmlRegistry implements IClassNodeTransformer
@Override
public void transform(final ClassNode cn, final boolean obfuscated) {
final FieldNode field = AsmUtil.findField(cn, "MAX_BLOCK_ID", true);
var field = AsmUtil.findField(cn, "MAX_BLOCK_ID", true);
if (field != null) {
field.value = ExtendedConstants.maxBlockID;
}
field = AsmUtil.findField(cn, "MAX_ITEM_ID", true);
if (field != null) {
field.value = ExtendedConstants.maxBlockID;
}
@@ -26,6 +31,7 @@ public class FmlRegistry implements IClassNodeTransformer
if (AsmUtil.transformInlinedSizeMethod(cn, method, VanillaConstants.maxBlockID, ExtendedConstants.maxBlockID, true)) {
found = true;
}
AsmUtil.transformInlinedSizeMethod(cn, method, 31999, ExtendedConstants.maxBlockID, true);
}
if (!found) {
throw new AsmTransformException("can't find 4095 constant in any method");