Posted December 25, 20177 yr Bukkit has an event which can be used to modify the result of mixing lava and water. I'm wondering if Forge has something similar. I don't see anything in net.minecraft,block.BlockLiquid.checkForMixing, but I thought I'd double check here before I try anything too complex. My intention is to modify minecraft's behavior such that you can get granite etc. from a cobblestone generator.
December 25, 20177 yr Would this not be possible (but ugly) with an IWorldEventListener & overriding IWorldEventListener::notifyBlockUpdate? Would require some guess-work to make sure it was indeed placed by BlockLiquid::checkForMixing, but should be viable. Edited December 25, 20177 yr by Matryoshika Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
December 26, 20177 yr Author It is possible; I've confirmed that this code has the desired effect: public void notifyBlockUpdate(World worldIn, BlockPos pos, IBlockState oldState, IBlockState newState, int flags){ if (oldState.getBlock() != Blocks.FLOWING_LAVA) return; if (newState.getBlock() != Blocks.COBBLESTONE) return; boolean adjacentToWater = false; if (worldIn.getBlockState(pos.north()).getMaterial() == Material.WATER) adjacentToWater = true; if (worldIn.getBlockState(pos.south()).getMaterial() == Material.WATER) adjacentToWater = true; if (worldIn.getBlockState(pos.east() ).getMaterial() == Material.WATER) adjacentToWater = true; if (worldIn.getBlockState(pos.west() ).getMaterial() == Material.WATER) adjacentToWater = true; if (worldIn.getBlockState(pos.down() ).getMaterial() == Material.WATER) adjacentToWater = true; if (worldIn.getBlockState(pos.up() ).getMaterial() == Material.WATER) adjacentToWater = true; if(!adjacentToWater) return; worldIn.setBlockState(pos, Blocks.DIAMOND_BLOCK.getDefaultState()); } But like you said, I'm using guess-work. I would still be interested in submitting a PR - if my technical knowledge extended to all that "@@ -452,4 +452,29 @@" stuff in BlockLiquid.java.patch. I don't suppose anyone has suggestions for topics to google?
December 26, 20177 yr You don't write the patches yourself, you set up a Forge workspace, make your changes to the appropriate Vanilla classes and then run the genPatches Gradle task to re-generate the patches with your changes. Forge's documentation explains how to contribute to Forge here and here. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.