There is a tutorial for 1.6 although I don't know how much changed between 1.6 and 1.7; in particular, it talks about directly modifying files within MCP (the Forge development version, not "vanilla" MCP):
In this example we will replace the *WHOLE* EntityCreeper.class with one that has the following modifications:
After we modify the base class run forge/mcp commands to compile and obfuscate:
recompile.bat
reobfuscate.bat --> gives the obfuscated class
reobfuscate_srg.bat --> gives the unobfuscated class
This will give us the class files: net.minecraft.entity.monster.EntityCreeper.class and te.class
(then some stuff about "IFMLLoadingPlugin" and "IClassTransformer")
This actually looks a lot like making mods with MCP, just with some extra steps.
Also, I don't know if this counts as a "coremod" but this mod uses reflection to replace a class, which is another way to override vanilla code:
More specifically, this is one way I use reflection to change a field without modifying a class, in this case, to disable the (useless) Realms check; as the field being changed is static I pass null into the setBoolean method (otherwise it is the instance of the object being modified):
try
{
// Sets GuiMainMenu.field_96140_r to true so Realms check thread doesn't run
Field[] f = GuiMainMenu.class.getDeclaredFields();
f[7].setAccessible(true);
f[7].setBoolean(null, true);
}
catch (Exception e) {}
Incidentally, I recommend using this in your mod (in this case the field is public so you can access it normally from any client-side code), which will reduce the memory usage of the game by 10 MB (which is quite significant, TMCW only uses about 20 MB baseline, even with a world loaded it is still over 10% of the total and easily offsets any increase due to my additions):
Minecraft.memoryReserve = null;
or
Minecraft.memoryReserve = new byte[0];
(this field is a 10 MB byte array and is freed if the client-side throws an out of memory error (the server-side will just crash), presumably to help ensure there is enough memory to display the "Minecraft has run out of memory" message, but it clears other data anyway and I haven't seen any issues from intentionally forcing a OOM so it should be safe to clear it)
Is there a coremod tutorial that both includes addition and removal from the code?
To people who says "It is not (?) cool to repost others mods": That violates Freedom 2 of users. #AntiCopyright #ProCopyleft
I will stay in mostly 1.7.10 and sometimes 1.12.2 until all bad up(!)dates get reverted.
My mod with manually registered ItemBlocks of technical blocks:
What the hell happened to minecraft?#Post6 - My opinions about new up(!)dates since 15w33c.
https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/mapping-and-modding-tutorials/1571568-tutorial-1-6-2-changing-vanilla-without-editing
Example:
This actually looks a lot like making mods with MCP, just with some extra steps.
Also, I don't know if this counts as a "coremod" but this mod uses reflection to replace a class, which is another way to override vanilla code:
https://github.com/Zeno410/CaveControl/tree/master/caveControl
This seems to be the relevant code (the field they change in private so they use an "Accessor" class to get access to it):
"mapGenCavesFromGenerator" is an instance of https://github.com/Zeno410/CaveControl/blob/master/caveControl/Accessor.java
More specifically, this is one way I use reflection to change a field without modifying a class, in this case, to disable the (useless) Realms check; as the field being changed is static I pass null into the setBoolean method (otherwise it is the instance of the object being modified):
Incidentally, I recommend using this in your mod (in this case the field is public so you can access it normally from any client-side code), which will reduce the memory usage of the game by 10 MB (which is quite significant, TMCW only uses about 20 MB baseline, even with a world loaded it is still over 10% of the total and easily offsets any increase due to my additions):
(this field is a 10 MB byte array and is freed if the client-side throws an out of memory error (the server-side will just crash), presumably to help ensure there is enough memory to display the "Minecraft has run out of memory" message, but it clears other data anyway and I haven't seen any issues from intentionally forcing a OOM so it should be safe to clear it)
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?