I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
How would I handle class names and variable names clashing?
In Entity (qr)
- CrashReport ( b ) conflicts with static field b that holds the next entity ID. this is no problem because this field is only accessed from one other location, and is easily changed.
- CrashReportCategory (k) conflicts with public boolean field k (mapped to preventEntitySpawning in MCP 1.6.4). This is a problem because this field is read and written from at least 6 other classes.
This leads to compilation errors because the compiler believes methods are attempted to be called by primitives instead of the intended types.
The first solution that came to mind was to use fully qualified names, but obfuscated MC sources do not have packaging....
How would I solve this?
Edit: Using fernflower decompiler that was included with MCP for 1.6.4
How would I handle class names and variable names clashing?
In Entity (qr)
- CrashReport ( b ) conflicts with static field b that holds the next entity ID. this is no problem because this field is only accessed from one other location, and is easily changed.
- CrashReportCategory (k) conflicts with public boolean field k (mapped to preventEntitySpawning in MCP 1.6.4). This is a problem because this field is read and written from at least 6 other classes.
This leads to compilation errors because the compiler believes methods are attempted to be called by primitives instead of the intended types.
The first solution that came to mind was to use fully qualified names, but obfuscated MC sources do not have packaging....
How would I solve this?
Edit: Using fernflower decompiler that was included with MCP for 1.6.4
I also experienced this problem in GuiNewChat and thought it was a decompiler error. Class a (EnumChatFormatting) conflicted with private field a (Logger) and caused some mess. I asked around in the IRC modding channels and found that the proper approach would be to use ((class name)null). In your example that would be replace the class reference b with ((b)null) and k with ((k)null), then call methods and fields from there.
I hope this helps
Rollback Post to RevisionRollBack
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
I also experienced this problem in GuiNewChat and thought it was a decompiler error. Class a (EnumChatFormatting) conflicted with private field a (Logger) and caused some mess. I asked around in the IRC modding channels and found that the proper approach would be to use ((class name)null). In your example that would be replace the class reference b with ((b)null) and k with ((k)null), then call methods and fields from there.
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
There's another way to mod the game without MCP - use Java Bytecode Editor to edit the raw bytecode, although this is difficult unless you are making small changes and have corresponding source code or know a lot about bytecode (I don't really, but can easily see how it corresponds to the source code).
For example, I modified cave generation in 1.7 by editing the following bytecode, with the corresponding deobfuscated source from MCP (1.6.4):
By editing the (bipush) 40 and 15, I can change cave generation as I did here (in 1.7 they simply changed those numbers to 15 and 7, making caves much smaller). I've also edited other classes in a similar manner, using Java Decompiler and Windows grep to find the files I want by searching for a string in them (e.g. I searched for 3.14159 to find MapGenCaves; many other files also have this string but I can easily recognize it from the layout of the code), albeit this assumes that they weren't changed too much from 1.6 (and in fact, many of the "thousands of lines of code" that were changed appear to be just a few numbers/variables changed, as in the MapGenCaves class; for example, BiomeDecorator is mostly the same in even the latest snapshots, aside from changing numbers to reflect the changes to terrain height, now able to go to the height limit, and adding in new types of stone).
Indeed, modifying bytecode is a way to mod the game, however; if one is to add a lot of code to a class file, converting all the code to bytecode would be a very time-consuming process. It's a very fascinating way, though!
Rollback Post to RevisionRollBack
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
Now that MCP and Forge are out the only reason you would do this is for fun/to see how modders did it back in the day.
Or to make 1.7.4 mods
Rollback Post to RevisionRollBack
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
I found this guide very useful and a couple of my modifications work. However, I keep getting an error while trying to recompile the aby (items) file.
/* 211:337 */ for (String str : aif.c.b())
Required: String
Found: Object
Not completely sure how to fix this. Help would be greatly appreciated.
Ah, I encountered that too in another class but forgot to add it in here. Rename str to something (I'd use xstr) in the for loop declaration, then on the first line inside the loop add "String str = (String) xstr;". If that for some strange reason doesn't work, try using "String str = String.valueOf(xstr);" or even "String str = xstr.toString()" (as an emergency fallback) (you see, I can't test it right now). Should solve the issue.
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
To post a comment, please login or register a new account.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYay thanks! I love Linux Mint
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIn Entity (qr)
- CrashReport ( b ) conflicts with static field b that holds the next entity ID. this is no problem because this field is only accessed from one other location, and is easily changed.
- CrashReportCategory (k) conflicts with public boolean field k (mapped to preventEntitySpawning in MCP 1.6.4). This is a problem because this field is read and written from at least 6 other classes.
This leads to compilation errors because the compiler believes methods are attempted to be called by primitives instead of the intended types.
The first solution that came to mind was to use fully qualified names, but obfuscated MC sources do not have packaging....
How would I solve this?
Edit: Using fernflower decompiler that was included with MCP for 1.6.4
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI also experienced this problem in GuiNewChat and thought it was a decompiler error. Class a (EnumChatFormatting) conflicted with private field a (Logger) and caused some mess. I asked around in the IRC modding channels and found that the proper approach would be to use ((class name)null). In your example that would be replace the class reference b with ((b)null) and k with ((k)null), then call methods and fields from there.
I hope this helps
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThank you very much!
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThanks
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
For example, I modified cave generation in 1.7 by editing the following bytecode, with the corresponding deobfuscated source from MCP (1.6.4):
By editing the (bipush) 40 and 15, I can change cave generation as I did here (in 1.7 they simply changed those numbers to 15 and 7, making caves much smaller). I've also edited other classes in a similar manner, using Java Decompiler and Windows grep to find the files I want by searching for a string in them (e.g. I searched for 3.14159 to find MapGenCaves; many other files also have this string but I can easily recognize it from the layout of the code), albeit this assumes that they weren't changed too much from 1.6 (and in fact, many of the "thousands of lines of code" that were changed appear to be just a few numbers/variables changed, as in the MapGenCaves class; for example, BiomeDecorator is mostly the same in even the latest snapshots, aside from changing numbers to reflect the changes to terrain height, now able to go to the height limit, and adding in new types of stone).
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIndeed, modifying bytecode is a way to mod the game, however; if one is to add a lot of code to a class file, converting all the code to bytecode would be a very time-consuming process. It's a very fascinating way, though!
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
I know how to use google, I searched, nothing, can't find the beta version at all /:
sorry to trouble you this late but, do you have a link to it?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNow that MCP and Forge are out the only reason you would do this is for fun/to see how modders did it back in the day.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOr to make 1.7.4 mods
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
/* 211:337 */ for (String str : aif.c.b())
Required: String
Found: Object
Not completely sure how to fix this. Help would be greatly appreciated.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAh, I encountered that too in another class but forgot to add it in here. Rename str to something (I'd use xstr) in the for loop declaration, then on the first line inside the loop add "String str = (String) xstr;". If that for some strange reason doesn't work, try using "String str = String.valueOf(xstr);" or even "String str = xstr.toString()" (as an emergency fallback) (you see, I can't test it right now). Should solve the issue.
Also, glad you found it useful, I'm here to help
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
I tried the other two as well. Still the same error:
Thanks for the help!
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOh, oops! Replace String with Object in the String xstr (for loop) and try again
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumGreat
I AM NOT YOUR PERSONAL MINECRAFT MOD SUPPORT AGENT, SO PLEASE DO NOT PM ME ABOUT PROBLEMATIC MODS THAT ARE NOT MINE. If you're having trouble/crashes with a mod, you'll have better luck resolving it in this forum section than PMing me. If you already made a topic, be patient about responses. If you have troubles with anything non-Minecraft related on your PC, I might be able to help, though, but no promises. Even though I could wish to be, I'm not a wizard.