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

We have the following code. This code works great in our dev environment (Using Intellij)

But the moment we leave the dev environment this doesn't work anymore.

 

try (DataOutputStream dataOutputStream = new DataOutputStream(new GZIPOutputStream(new FileOutputStream(file))))
            {
                Method method = ReflectionHelper.findMethod(NBTTagCompound.class, null, new String[] {
                        "writeEntry", "a" }, String.class, NBTBase.class, DataOutput.class);
                method.invoke(null, "Schematic", tagCompound, dataOutputStream);
            }

 

Executing it on technic leads to:

 

[b#347]  net.minecraftforge.fml.relauncher.ReflectionHelper$UnableToFindMethodException: java.lang.NoSuchMethodException: net.minecraft.nbt.NBTTagCompound.a(java.lang.String, net.minecraft.nbt.NBTBase, java.io.DataOutput)
[b#347]  	at net.minecraftforge.fml.relauncher.ReflectionHelper.findMethod(ReflectionHelper.java:183) ~[modpack.jar:?]
[b#347]  	at com.schematica.world.schematic.SchematicFormat.writeToFile(SchematicFormat.java:92) [schematicFormat.class:?]
[b#347]  	at com.minecolonies.util.Schematic.saveSchematic(Schematic.java:264) [schematic.class:?]
[b#347]  	at com.minecolonies.items.ItemScanTool.func_180614_a(ItemScanTool.java:58) [itemScanTool.class:?]
[b#347]  	at net.minecraft.item.ItemStack.func_179546_a(ItemStack.java:135) [zx.class:?]
[b#347]  	at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:403) [bda.class:?]
[b#347]  	at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1491) [ave.class:?]
[b#347]  	at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:2036) [ave.class:?]
[b#347]  	at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1024) [ave.class:?]
[b#347]  	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:349) [ave.class:?]
[b#347]  	at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
[b#347]  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
[b#347]  	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
[b#347]  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
[b#347]  	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
[b#347]  	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
[b#347]  	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
[b#347]  Caused by: java.lang.NoSuchMethodException: net.minecraft.nbt.NBTTagCompound.a(java.lang.String, net.minecraft.nbt.NBTBase, java.io.DataOutput)
[b#347]  	at java.lang.Class.getDeclaredMethod(Unknown Source) ~[?:1.8.0_91]
[b#347]  	at net.minecraftforge.fml.relauncher.ReflectionHelper.findMethod(ReflectionHelper.java:174) ~[modpack.jar:?]
[b#347]  	... 16 more

  • Author

Using the deobfuscates names lead to a error in the dev environment that's why I changed it. (One of our devs installed the 1.8.9-Mappings)

  • Author

Previously we were using these SRG names "func_29484b". But since we've updated to the 1.8.9-Mappings we had to change it to these "obfuscated notch names".

There are 3 names:

 

obfuscated "notch" names (

a.bc()

)

SRG deobfuscated names (

WorldServer.func_12345_a()

)

MCP deobfuscated names (

WorldServer.getWorldTime()

)

 

For reflection, you have to use MCP names in dev, but SRG names in release.  There's no real way around this, which is why ReflectionHelper exists.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

There are 3 names:

 

obfuscated "notch" names (

a.bc()

)

SRG deobfuscated names (

WorldServer.func_12345_a()

)

MCP deobfuscated names (

WorldServer.getWorldTime()

)

 

For reflection, you have to use MCP names in dev, but SRG names in release.  There's no real way around this, which is why ReflectionHelper exists.

Hm, I'm doing this in my mod, too. So there has to be a check if we are in dev-env or not? If so, how can this be done?

Developer of Primeval Forest.

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.