Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Peter200lx opened this issue Jul 2, 2012 · 1 comment
Open
Labels

Comments

@Peter200lx
Copy link
Owner

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

@Peter200lx
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant