lunar-sway / minestuck

A Homestuck Minecraft mod
Other
54 stars 65 forks source link

TemplatePlacement uses and structure feature cleanup #562

Closed kirderf1 closed 6 months ago

kirderf1 commented 7 months ago

Updates various structure feature implementations to use TemplatePlacement for placement and coordinate math, and adds more features to TemplatePlacement to support it. Also does some more targeted code cleanup in some of these features.

I have done some testing to make sure that the position/coordinate stuff is done correctly (by placing blocks at these coordinates and making sure that they align with the placed template in the right way).

The y placement and fluid filtering for some features (those that do not depend on the height of multiple blocks) has been moved out of the feature class and instead added as a PlacementModifier. I also changed the height placement of the ornate shadewood to just look at the height of the center block.

TemplatePlacement is still only built for features. However with some additions, it could prove very useful for structure pieces as well.

Some static helper functions in TemplatePlacement could very well be moved out as they're not tied to template placement specifically, but I have not done so due to a lack of idea for where to move them.

I have so far left out the rotation pivot. I may or may not take another look at it for this PR.

I had an idea that a feature for simple templates could be built, where where the specific template is set in the feature configuration. However that's out of scope for this PR. I'm not sure if I will do it later or not, so it's up in the air if someone else is interested in implementing that idea.

kirderf1 commented 7 months ago

Also, pretty much all structure templates are using our structure block registry right now. I don't think all of them should use it (shadewood tree, for example), and I might add some changes on that to this PR.