mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-12 06:07:31 +00:00
max item id crash fix
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -22,7 +22,7 @@ public class FmlRegistry implements IClassNodeTransformer {
|
||||
}
|
||||
field = AsmUtil.findField(cn, "MAX_ITEM_ID", true);
|
||||
if (field != null) {
|
||||
field.value = ExtendedConstants.maxBlockID;
|
||||
field.value = ExtendedConstants.maxItemID;
|
||||
}
|
||||
boolean found = false;
|
||||
for (final MethodNode method : cn.methods) {
|
||||
@@ -30,7 +30,7 @@ public class FmlRegistry implements IClassNodeTransformer {
|
||||
ExtendedConstants.maxBlockID, true)) {
|
||||
found = true;
|
||||
}
|
||||
AsmUtil.transformInlinedSizeMethod(cn, method, 31999, ExtendedConstants.maxBlockID, true);
|
||||
AsmUtil.transformInlinedSizeMethod(cn, method, 31999, ExtendedConstants.maxItemID, true);
|
||||
}
|
||||
if (!found) {
|
||||
throw new AsmTransformException("can't find 4095 constant in any method");
|
||||
|
||||
@@ -24,6 +24,9 @@ public class ExtendedConstants {
|
||||
public static final int blockIDCount = 1 << (bitsPerID - countCorrectionBits);
|
||||
public static final int maxBlockID = blockIDCount - 1;
|
||||
|
||||
public static final int itemIDCount = 1 << (bitsPerID);
|
||||
public static final int maxItemID = itemIDCount - 1;
|
||||
|
||||
public static final int bitsPerBlock = 8 + bitsPerID + bitsPerMetadata;
|
||||
public static final int nibblesPerBlock = bitsPerBlock / 4;
|
||||
public static final int nibblesPerEBS = nibblesPerBlock * 16 * 16 * 16;
|
||||
|
||||
Reference in new issue
Block a user