Posted July 4, 201213 yr Hi, I've been trying to set the private values in EnumCreatureType using ModLoader.setPrivateValue. This works fine in the eclipse environment but when i come to reobfuscate it doesn't update the name of the field that i'm trying to set and so it will die with a fieldNotFound exception. Is this a bug or am i doing something not supported? MrMasochism
July 4, 201213 yr The reobf does not reobf strings. How could it? You have to take that into account. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
July 4, 201213 yr Author Yeah that's fair enough, how can i find what the reobfuscated variable is named?
July 4, 201213 yr By using MCPBot on espernet. EXA: <LexManos> gcf Minecraft.thePlayer -MCPBot- [ GET CLIENT FIELDS ] -MCPBot- Side : client -MCPBot- Name : Minecraft.thePlayer -MCPBot- Notch : Minecraft.h -MCPBot- Searge : field_6322_g -MCPBot- Type/Notch : LEntityPlayerSP; | Lvq; -MCPBot- Description : The player who's actually in control of this game. Or, looking at the maping files inside the conf folder, those are fairly self explanatory. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
July 4, 201213 yr Author Alright, so i found that maxNumberOfCreature was reobfuscated to field_21108_e but when i switched the call over to that field it still came up saying that the field could not be found: try { ModLoader.setPrivateValue(EnumCreatureType.class, EnumCreatureType.monster, "field_21108_e", 80); ModLoader.setPrivateValue(EnumCreatureType.class, EnumCreatureType.creature, "field_21108_e", 80); ModLoader.setPrivateValue(EnumCreatureType.class, EnumCreatureType.waterCreature, "field_21108_e", 100); } catch (Throwable e) { System.err.println(e); } [sEVERE] Unexpected exception java.lang.RuntimeException: java.lang.NoSuchFieldException: field_21108_e at cpw.mods.fml.common.ReflectionHelper.setPrivateValue(ReflectionHelper.java:93) at ModLoader.setPrivateValue(ModLoader.java:731) at pixelmon.PixelmonSpawner.init(PixelmonSpawner.java:17) at mod_Pixelmon.addSpawns(mod_Pixelmon.java:271) at mod_Pixelmon.load(mod_Pixelmon.java:214) at cpw.mods.fml.common.modloader.ModLoaderModContainer.init(ModLoaderModContainer.java:351) at cpw.mods.fml.common.Loader.modInit(Loader.java:263) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:604) at cpw.mods.fml.server.FMLServerHandler.onLoadComplete(FMLServerHandler.java:147) at net.minecraft.server.MinecraftServer.s(MinecraftServer.java:204) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:412) at dn.run(SourceFile:492) Caused by: java.lang.NoSuchFieldException: field_21108_e at java.lang.Class.getDeclaredField(Unknown Source) at cpw.mods
July 4, 201213 yr Author This error of course comes up after reobfuscation and was before i stuck the try catch loop around it. Running it inside eclipse with the maxNumberOfCreature string works fine too
July 4, 201213 yr That isnt the obfuscated name, that's the Searge name. You want the Notch name. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.