SpongePowered / SpongeAPI

A Minecraft plugin API
http://www.spongepowered.org/
MIT License
1.14k stars 342 forks source link

Make schematics rotatable #2102

Open eirikh1996 opened 4 years ago

eirikh1996 commented 4 years ago

Make it possible to rotate schematics in the Sponge API. They are currently not rotatable

simon816 commented 4 years ago

It would be pretty trivial to rotate a block volume as-is, however I suspect you're also looking to rotate directional blocks such as stairs too. From what I recall, there isn't any generic way of doing this; each block would have to be handled specially. I don't think this is possible with modded blocks as sponge does not know how to handle them.

gabizou commented 4 years ago

From what I recall, there isn't any generic way of doing this; each block would have to be handled specially. I don't think this is possible with modded blocks as sponge does not know how to handle them.

Yep, and this is precisely why schematics originally didn't handle them well enough.. There's a lot of block logic specific code that has to be handled, but the hooks do exist in the vanilla blocks, but I almost sincerely doubt that some mod blocks correctly override those methods to perform their rotations correctly.

It's a feature that'd be very welcome to being PR'ed in both API and Common (since both hooks exist in native vanilla mc), but will likely need to be tested against in the integration test in SpongeForge.

gabizou commented 3 years ago

For what its worth: In #2241, I've added the relevant API's to support this feature, but the caveat is that it repurposes an existing API class name for the actual better name.

It's very well possible to back port the API addition for 7.4+, but acknowledgement of the classname changes would be required (the implementation is about as trivial as well). Rotating the actual schematic is albeit a little different.