Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

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

  • 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

 

  • 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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.