This isn't a tutorial, per se, but I thought some people might be interested in seeing some of the changes coming up in 1.8 in regards to modding.
I've been deobfuscating the game lately (not using anything from MCP), and felt like I was at a point to do an obligatory Clippy joke just to run that into the ground that much further. But it's less about the content, and more about what went into doing it. Even though this mod does relatively little (an item and a recipe to make it), I had to edit four classes and a couple of assets to accomplish it. So I thought it might be of interest to someone. Just keep in mind that MCP could very likely use completely different names than I've chosen for some of this stuff.
The first thing was editing the traditional "Item" class. I added this to the end of the items being registered: registerItem(3000, "clippy", (new Item()).setUnlocalizedName("clippy")); And yes numeric IDs still exist too, they're not going anywhere, they're just not the preferred way of doing it, particularly with blocks after the properties/states changes.
Next is the class "Items" which is possibly also what MCP was calling it in 1.7. I'd have to look. Anyway, it's just a simple class designed for easy access to item instances: itemClippy = getItemByStringID("clippy");
Next we go to the class I've called "ItemModelManager". This is possibly a new class due to the rendering changes. It links all items to their model ID string, which I'll explain in a moment: this.registerItemModel(Items.itemClippy, "clippy");
And lastly, in the main "Recipes" class: this.registerShapedRecipe(new ItemStack(Items.itemClippy), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Items.itemIronIngot, Character.valueOf('X'), Items.itemSpiderEye});
So now, the rendering part. This is where we have to look into the new item json format, located in assets\minecraft\models\item. The string I specified with registerItemRenderer is what gets loaded here. I literally just copied the arrow's file to clippy.json and modified the name where necessary:
(Pasting code doesn't work well on here anymore, unfortunately.)
Then I tossed clippy.png into the regular assets\minecraft\textures\items folder, and lastly I added the translation into the English language file in assets\minecraft\lang: item.clippy.name=Clippy
That's pretty much it!
Maybe I'm just not realizing enough advantages to it yet, but I'm not a fan of having to make these json files for every block and item you add into the game. I'm hoping Forge handles this in a better way than vanilla does. But yeah, this is pretty much the process to add an item and a recipe into just regular old vanilla Minecraft.
If there's anything else you're curious about with this new version, just ask, I might have come across it by now. But keep in mind I've only deobfuscated about 700 classes out of almost 2500. But what I've done surprisingly covers just about the majority of anything I've done with the game before, so I don't know how particularly useful a lot of the rest of this will be for the average modder.
The Meaning of Life, the Universe, and Everything.
Join Date:
6/11/2014
Posts:
59
Member Details
Very interesting, thank you.
Incidentally, if you want to properly format your pasted code to the forum, here is what you have to do, inside 'code' brackets, of course.
(crossing fingers that I can display the special characters without them getting converted by the forum software. Here it goes.)
If it contains an 'i' in square-brackets ( [i] ), not at all uncommon in code, then you need to replace all instances with: [i]
Otherwise, your code will a get an [/i] at the end. Think about it and you'll realize why.
If it contains lesser or greater than symbols, then you need to replace them with: < and > respectively.
Then... you need to replaces all spaces with
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI've been deobfuscating the game lately (not using anything from MCP), and felt like I was at a point to do an obligatory Clippy joke just to run that into the ground that much further. But it's less about the content, and more about what went into doing it. Even though this mod does relatively little (an item and a recipe to make it), I had to edit four classes and a couple of assets to accomplish it. So I thought it might be of interest to someone. Just keep in mind that MCP could very likely use completely different names than I've chosen for some of this stuff.
The first thing was editing the traditional "Item" class. I added this to the end of the items being registered: registerItem(3000, "clippy", (new Item()).setUnlocalizedName("clippy")); And yes numeric IDs still exist too, they're not going anywhere, they're just not the preferred way of doing it, particularly with blocks after the properties/states changes.
Next is the class "Items" which is possibly also what MCP was calling it in 1.7. I'd have to look. Anyway, it's just a simple class designed for easy access to item instances: itemClippy = getItemByStringID("clippy");
Next we go to the class I've called "ItemModelManager". This is possibly a new class due to the rendering changes. It links all items to their model ID string, which I'll explain in a moment: this.registerItemModel(Items.itemClippy, "clippy");
And lastly, in the main "Recipes" class: this.registerShapedRecipe(new ItemStack(Items.itemClippy), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Items.itemIronIngot, Character.valueOf('X'), Items.itemSpiderEye});
So now, the rendering part. This is where we have to look into the new item json format, located in assets\minecraft\models\item. The string I specified with registerItemRenderer is what gets loaded here. I literally just copied the arrow's file to clippy.json and modified the name where necessary:
{ "parent": "builtin/generated", "textures": { "layer0": "items/clippy" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } }(Pasting code doesn't work well on here anymore, unfortunately.)
Then I tossed clippy.png into the regular assets\minecraft\textures\items folder, and lastly I added the translation into the English language file in assets\minecraft\lang: item.clippy.name=Clippy
That's pretty much it!
Maybe I'm just not realizing enough advantages to it yet, but I'm not a fan of having to make these json files for every block and item you add into the game. I'm hoping Forge handles this in a better way than vanilla does. But yeah, this is pretty much the process to add an item and a recipe into just regular old vanilla Minecraft.
If there's anything else you're curious about with this new version, just ask, I might have come across it by now. But keep in mind I've only deobfuscated about 700 classes out of almost 2500. But what I've done surprisingly covers just about the majority of anything I've done with the game before, so I don't know how particularly useful a lot of the rest of this will be for the average modder.
WIP site for my mods / Intermediary / FMC / Redstone Paste / Hopper Ducts / Model Citizens / Simple Refinement / Endermanage / Fycraft / etc
Incidentally, if you want to properly format your pasted code to the forum, here is what you have to do, inside 'code' brackets, of course.
(crossing fingers that I can display the special characters without them getting converted by the forum software. Here it goes.)
If it contains an 'i' in square-brackets ( [i] ), not at all uncommon in code, then you need to replace all instances with: [i]
Otherwise, your code will a get an [/i] at the end. Think about it and you'll realize why.
If it contains lesser or greater than symbols, then you need to replace them with: < and > respectively.
Then... you need to replaces all spaces with
It's just that simple!