event: FORCETREE(@BIRCH,REDWOOD, etc)
Zarius opened this issue ยท 7 comments
Checks for block below that being destroyed - if something unimportant like stone, gravel, water, lava, cobble, wood then replace with dirt and grow the tree (main blocks we want to avoid are ores, chests, pistons, etc).
Alternative: store the block's type, data, and state, replace it with dirt, grow the tree, restore its type, data, and state.
You'd want to test a bit with chests and such to make sure it doesn't clear them, but I think so long as you store the state (which contains the inventory) you should be fine.
That's almost what I did last two nights ago - implemented this in 1.9 but couldn't get states casting properly so I just save the blocks type and data and ignore container blocks.
Forgot about pistons - will add them to the ignore list. States would be cool but could there still be a risk? Don't want to kill someone's chest just for a tree.
As I said, I would try it and see. :) If it wipes the inventory, unimplement it.
Added in 1.9 - will ignore containers (chests, dispensers, furnaces). 2.0 ignores anything with state.getType (I assume this includes signs, pistons, etc).
To clarify, FORCETREE does not replace the following blocks by default:
- Chest
- Mob spawner
- Dispenser
- Furnace
- Note Block
- Sign Post
- Wall Sign
- Extended Piston
- Jukebox
If you set "event.Trees.force-tile-entities" to true in the main configuration file (not the drops file), it will replace any block temporarily in order to force the tree. At least, that was the intention; haven't tested it.