I shall write a Minecraft mod. Day #11

in #programming7 years ago (edited)

This is the end of holidays. Yesterday I had a quick chat with Fergus to summarize what we have managed to do and what he wanted to get. The general status so far is:

  • there is a bluestone
  • it can be mined
  • it can be crafted into a bluestone sword
  • the sword is quite powerful

He had a slightly different idea:

  • there is a bluestone ore
  • it can be mined
  • it can be smelted into bluestone
  • bluestone has no block associated with it, only an item
  • bluestone can be crafted into a bluestone sword
  • there are more items

I have therefore done a quick refactoring making the naming consistent across the mod and then renamed bluestone into a bluestone ore. I have created a bluestone item as well and set crafting recipe for the sword to use the bluestone. This is where I got stuck for the last two days: My smelting recipe did not work and I didn't know why.

I have tried to create a smelting recipe json file but I couldn't get it to work as I could not find a proper type for it. furnace, smelting, minecraft:furnace, minecraft:smelting etc. - after looking at the source code I got an impression that it is not possible to define a json with it just yet.

Forge has a FurnaceRecipes class that holds the default smelting recipes. One can use a GameRegistry to add a new one. I did add it, but it did not get initialized. When I put bluestone in the top compartment of the furnace and coal in the bottom one, it would not work.

I thought it was just that I did it too late and it was not included in some Minecraft code. I could not identify when the recipes were being fed to the game to check whether the recipe was used. I double checked in tutorials and then realized I ran the recipe code in items registration, not init in proxy code. Changed that and got this:

smelting.jpg

Sadly, one cannot make the smelting require more fuel or anything. Certain type of fuel will work the same way for any tipe of smelting input material.

By the way, I changed the sword slightly and added some transparency. Sadly, if the surface pixel is transparent, the sword is transparent throught this point, even if the second pixel is not transparent. I was hoping for something else looking at the Slime that has a transparent layer. Oh well.

There are three things that come to my mind now:

  • add tools, armour etc. - as Fergus requested
  • prepare a distributable package for the mod - so that you don't have to set up a dev environment to play it
  • play the darn game with the darn mod - I still don't know how to survive the night, you know? It would be nice if I could play what I made. I think there will be some parameters I will need to tweak as well, for instance add some resistance to the bluestone ore as it is very easily mineable right now.

Not sure what to do first at this point.

You can see the outcome on github: https://github.com/breadcentric/fergusmod. I started tagging the state after each day of work with tag day_x.
Repo state after this work: https://github.com/breadcentric/fergusmod/tree/day_11

Visit the tag #ishallwriteaminecraftmod and follow me to see the progress

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63207.55
ETH 2571.17
USDT 1.00
SBD 2.82