mojira.dev
MC-265257

Structure blocks don't rotate when loaded by a structure block

When you load a rotated structure there are blocks which change, such as logs, but if the structure contains another structure block that block doesn't change at all if rotated. I think it would be better if they did, tho, in order to totally rotate the structure.

For example, I have created a structure named "structure" which contains 4 logs:

[media][media]

After that, I created a structure named "hello" which contains a log and a load structure block:

[media][media]

The content of the structure block contained in "hello" is:

[media][media]

Then I tried to load the "hello" structure somewhere else but rotating it:

[media][media][media]

As you can see, the log has been changed to be rotated, but this hasn't happened for the generated structure block, which has still the same parameters of the original one:

[media]

I would have expected this result in this case, tho:

[media]

This could be solved with this formula:

taken "x" the x-coordinate of Relative Position of the original block, "z" the z-coordinate of Relative Position of the original block, "angle" the angle of rotation in degrees of the original block and "rotation" the angle of rotation in degrees of the structure that includes the block, the new values will be:

new_x = x*cos(rotation)-z*sin(rotation)
new_z = x*sin(rotation)+z*cos(rotation)
new_angle = (angle+rotation)mod360

In this specific case, the values would be:

angle = 0°, rotation = 90°, x=-1, z=0

and the result:

new_x = -1*cos(90°)-0*sin(90°) = 0
new_z = -1*sin(90°)+0*cos(90°) = -1
new_angle = (0°+90°)mod360 = 90°

Linked issues

Attachments

Comments 8

The same goes for command blocks, but that's a lot more difficult to fix, the command would need parsing to find any x y z arguments to update, ignore ones after /execute at and /execute positioned as, and add /execute rotated at the start of the command.

@@unknown, that is MC-106143 (invalid).

@Dhranios I don't thinks that's the same case: rotating command blocks would be more difficult and could produce unwanted results, while rotating structure blocks should be more easy to do and a more expecter result.

Damm, I knew I saw a report about it before, but failed to find it by sesrching.

@FVbico I searched too before writing this, but found nothing as well.

Can confirm in 23w44a:

[media]

This is a feature request

actually this feature used to exist

GiAnMMV

(Unassigned)

Community Consensus

Platform

Low

Block states

1.20.1, 1.20.2 Pre-release 1, 23w44a

Retrieved