EngineHub / WorldEdit

🗺️ Minecraft map editor and mod
https://enginehub.org/worldedit/
Other
3.05k stars 826 forks source link

Forward `getBlock` and `getFullBlock` to extents chain #2544

Closed EpicPlayerA10 closed 1 month ago

EpicPlayerA10 commented 1 month ago

Forward getBlock and getFullBlock to the extents chain. I don't see the reason why it must directly access world extent. For example the getBiome already passes its call to extents chain: https://github.com/EngineHub/WorldEdit/blob/00148305cea5fe99187b5b30912349a5c4c8b8b7/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java#L690-L693

After this change, people can override getBlock and getFullBlock in AbstractDelegateExtent to make some modifications in getting blocks. For example in plugins that adds custom blocks and they need to modify block nbt a bit.

octylFractal commented 1 month ago

This would need a much further rework and extensive testing of pretty much every feature as it at least affects how masks apply when multiple blocks are set in the same location for one EditSession, and likely many other features that rely on this to bypass to the world. Feel free to test and fix these issues, but as it stands this PR cannot be merged.