ToolBelt

9.6k Downloads

Temporaraly store tile-entity data for signs/chests/note-blocks/etc

Peter200lx opened this issue ยท 1 comments

commented

Currently, because blocks can loose tile-entity data when ToolBelt tries to test for region protection, blocks with tile-entity data are prevented from being manipulated. Ideally this would be fixed by finding a generic method for storing any relevant data and resetting it if the user doesn't have rights for a region.

http://www.minecraftwiki.net/wiki/Chunk_format#Tile_Entity_Format

commented

BlockState.update(boolean force) Might hold the answer. This purports to apply the saved BlockState back to the originated Block.
http://jd.bukkit.org/doxygen/d9/d1c/interfaceorg_1_1bukkit_1_1block_1_1BlockState.html

I tested this with the generic BlockState, and it did update the original Block, however it did not keep the TileEntity data. I'll next test this by checking for instanceof against the org.bukkit.block.Furnace and such to see if the specific call provides the desired TileEnitity restoration that is desired.

If this fails, most likely the next recourse is to hard-code a handler for each Material type with TileEntity data to store the information so that it can be restored in case of region protection.