rutgerkok / WorldGeneratorApi

Minecraft Spigot plugin that enables other plugins to customize world generation
MIT License
95 stars 9 forks source link

DecorationArea cannot set BlockState #2

Closed Uziskull closed 6 years ago

Uziskull commented 6 years ago

It seems that the Decoration part of the API can only set the Material or BlockData of a given block in the DecorationArea. This would suffice for most cases, but this also means that placing, for example, written signs or chests with items in them is impossible, since text and/or inventory are part of the block's BlockState.

Would it be possible to make DecorationArea#getBlock(x, y, z) and DecorationArea#setBlock(x, y, z, material) deal with the Block itself (and not just the Material)? Or at least add a DecorationArea#setBlockState(x, y, z, state) method?

rutgerkok commented 6 years ago

The Bukkit Block class operates on Chunks. However, during world generation we do not have chunks yet, only ProtoChunks. So the Bukkit Block class cannot be used.

Instead, I added a getBlockState and a setBlockState method.