Jump to content

Recommended Posts

Posted

So I recently just started getting familiar with modding minecraft so that I could start work on of my own ideas for mod projects.  One of the things I want to do is add the force of gravity to all blocks so that all blocks will fall by default (the exceptions will be construction blocks like wood planks, etc) and another will be to make liquids be more realistic by causing them to spread and pool rather than have a block infinitely generate streams of liquid out of it.  The one question I have before I begin this project is will this require me to alter core minecraft classes, and if so, will that be a bad thing, i.e. cause my mod to be incompatible with other mods?

Posted

If forge can't cover what you want to do, then yes. Yes it will break compatibility with other mods.

Though you can use alternate methods to do it. I haven't touched source since 1.2.5 but you could possibly overwrite all the block definitions with new ones derived from the original but with the gravel/sand falling code added in. Or maybe an event listener for block updates and test/react accordingly.

  • 3 weeks later...
Posted

Doing the sense of gravity could likely be done with just a regular mod.  I'm fairly certain there's a hook to catch when any block is broken, at which point you can just scan upwards for blocks to the height of that specific X/Z column, and shift all of those blocks downwards, maybe with a visual effect entity like the falling sand/gravel uses.  I can imagine that there might be performance implications though.  I believe TerraFirmaCraft does something like this, if you want to check that out.

Changing the fluid mechanics would more likely require you to change the vanilla code.  But you don't replace entire classes like in the old days; FML allows you to use ASM to modify the base classes at startup, to patch just the spots you need to change.  It's complicated and requires knowledge of Java opcodes but this makes it more compatible with other mods (and with Forge itself) than just replacing the whole thing.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...