Conversation
|
Probably needs some compat with Thermos - https://github.com/GTNewHorizons/Thermos/blob/1.7.10/patches/net/minecraftforge/oredict/OreDictionary.java.patch Crucible oddly enough looks fine |
|
Other than that, the only other transformers that run on this are NEI and some minor thermos patches. I'm 100% fine with it not being compatible with mixins 😎 and/or only enabling for NH. |
|
Considering using an overwrite equivalent for getOreIDs so it would work on thermos as well. |
11ef238 to
94b4334
Compare
|
Assuming this works on zeta/nightlies, should be good to merge. |
|
I'm not an ASM expert. |
The goal of this PR was to replace all Integer boxing/unboxing with primitives. I don't believe the list was ever a singleton before... from getOreIDs() as an example: Integer[] tmp = set.toArray(new Integer[set.size()]);
int[] ret = new int[tmp.length];
for (int x = 0; x < tmp.length; x++)
ret[x] = tmp[x];
return ret;And if you're directly reflecting to get it... it's still a |
It is a map of singleton lists, I can confirm it. But if you just replace the implement of the list to IntList, it shouldn't be a big deal. Thanks for explaination. But if we can have codes in comments, it's better, so we don't have to "compile" the code by brain lol. |
|
Decompiled output on a server. ASM was generated by modifying OreDictionary.java, compiling, and roughly comparing the bytecode between the patched/unpatched version. |
|
Working fine in my 560 mod modpack 👍 |
|
@Dream-Master good for you to merge once this has been confirmed working on Zeta/thermos. |
|
ill do a zeta update today and we will see |
|
Looks this change breaks BW as I get the crash like this: GT: 5.09.51.290-pre This happens with my Twist 2.8.x nightly fork. LMK if you need any further details. |
|
Please provide a full log. I've run it in the full pack and haven't seen this issue - what did you do to trigger it? |
https://github.com/Taskeren/Twist-Space-Technology-Mod/tree/release/2.8.x I did nothing but start the game in debug mode (Java 17, Hotswap), and when I enter a world, this exception is thrown, and my game crashed. Here is my full log: https://mclo.gs/AuSOcL6 |
|
Try pulling the latest commit into |
|
New version: public static void rebakeMap() {
((Int2ObjectOpenHashMap)stackToId).clear();
for(int var0 = 0; var0 < idToStack.size(); ++var0) {
List var1 = (List)idToStack.get(var0);
if (var1 != null) {
for(ItemStack var3 : var1) {
String var4 = var3.getItem().delegate.name();
int var5;
if (var4 == null) {
FMLLog.log(Level.DEBUG, "Defaulting unregistered ore dictionary entry for ore dictionary %s: type %s to -1", new Object[]{getOreName(var0), var3.getItem().getClass()});
var5 = -1;
} else {
var5 = GameData.getItemRegistry().getId(var4);
}
if (var3.getItemDamage() != 32767) {
var5 |= var3.getItemDamage() + 1 << 16;
}
Object var6 = (IntList)((Int2ObjectOpenHashMap)stackToId).get(var5);
if (var6 == null) {
var6 = new IntArrayList();
((Int2ObjectOpenHashMap)stackToId).put(var5, var6);
}
((IntList)var6).add(var0);
}
}
} |
|
What should I do to get the new commit in my project? |
|
checkout the -pre tag, and cherry pick it. |
Gets rid of all Integer boxing/unboxing, and swaps based collections with the fastutils primative equivalent.
Local profile showing Integer.valueOf() top offenders w/ 32 chunk render distance + DH