Posted May 13, 20169 yr 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
May 13, 20169 yr 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)
May 13, 20169 yr 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".
May 13, 20169 yr 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.
May 13, 20169 yr 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.