MinecraftForge/MinecraftForge — pull request #1394 by Zot201 (2014-09-08 04:27:57+00:00)
Title: Metadata sensitive isReplaceableOreGen

Consider a customized mod oregen that perform replacement to a block type with specific metadata. One could always use:

1) world.getBlock(x, y, z) == targetBlock && world.getBlockMetadata(x, y, z) == targetMeta

to perfom such a matching to the target block and metadata, but if you want to resemble the forge-modified vanilla oregen, the method isReplaceableOreGen would be a little bit inappropriate, considering only half of the criteria could be delegated to the block itself:

2) block.isReplaceableOreGen(world, x, y, z, targetBlock) && world.getBlockMetadata(x, y, z) == targetMeta

And comparing it with:

3) block.isReplaceableOreGenMeta(world, x, y, z, targetBlock, targetMeta)

The latter one is much clear and compact. And most importantly, it allows other mods to add equivalent block in a sensible way: no need to have the same usage of metadata to the original block.

And it would nice if the new method could co-exist with the old isReplaceableOreGen, considering block.isReplaceableOreGen(world, x, y, z, targetBlock) being a forge equivalent for block == targetBlock, and, 3) being a forge equivalent for 1).