So here's my problem
I've got this code that extends enchantment ids to 4096 and when initialized in my pre int stage works for my mod, how do i go about making it work for any mods after my mod. Do i need to do something asm related or
is it something different
package me.core.moreEnchantments.Api;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import cpw.mods.fml.common.FMLLog;
import net.minecraft.enchantment.Enchantment;
public class IdExtension {
public static void expand() {
Enchantment[] enchantmentsList = null;
FMLLog.fine("MoreEnchantments >> Expanding Enchantment Ids", new Object[0]);
for (Field f : Enchantment.class.getDeclaredFields()) {
f.setAccessible(true);
try {
if (f.getName().equals("enchantmentsList") || f.getName().equals("field_77331_b")) {
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
enchantmentsList = (Enchantment[]) f.get(null);
final Enchantment[] newEnchantmentsList = new Enchantment[4096];
System.arraycopy(enchantmentsList, 0, newEnchantmentsList, 0, enchantmentsList.length);
f.set(enchantmentsList, newEnchantmentsList);
}
} catch (Exception e) {
System.err.println("There was an error. Please report this to Lithial. Remember to include a copy of the crashlog in your report");
System.err.println(e);
}
}
}
}
I've got this code that extends enchantment ids to 4096 and when initialized in my pre int stage works for my mod, how do i go about making it work for any mods after my mod. Do i need to do something asm related or
is it something different