Buildinggadgets: Stairs rotate incorrectly via the Copy Paste Gadget

Created on 17 May 2020  路  20Comments  路  Source: Direwolf20-MC/BuildingGadgets

Forge version: 31.1.89
Building Gadgets version: 3.3.5

Hey, I installed the latest version of the mod into my 1.15.2 modpack and encountered an issue. Whenever I Rotate builds with the Copy Paste Gadget, the entire build rotates counter-clockwise, with the exception of stairs: they rotate clockwise.

image

As you can see, I built and copied a little compass to test this (blocks rotated north -> west; stairs rotated north -> east). I tested with Vanilla stairs and they do the same thing.

I would like to copy builds from my Creative worlds into Survival and use Building Gadgets for that, any ideas what might be causing this?

EDIT: Same issue is with connected fences and other blocks with directional states

1.15 bug requires backport

All 20 comments

I presume it is caused by some Rotation being inverted somewhere...
I'll check that later

Sorry, but it really looks like I'm not going to do anything besides uni in this lecture period...
I hope that keeping this open reminds us/me that this is still a thing.

I have a few ideas on why this might be but I won't be able to take a look at it for a few days

The relevant code is 99% sure in the Template class...
There's a rotate Method somewhere and I presume it accidentally flips the rotation. If it were in the copy paste Gadget, then it would just rotate into the other direction.

From what I can remember of the template system, the state data isn't being handle properly but I can take a look.

the state data isn't being handle properly

?

The rejection of state data isn't working, so I'd assume most features of it are some what broken, I'd have to look at it to remind me of what is actually wrong

so I'd assume most features of it are some what broken

Rotation is completly unrelated to selecting irrelevant properties...
The point at which a state is rotated, it is already under the control of a Template instance and especially doesn't apply black lists.

Applying a blacklist should happen either at creation time of a Template, or at build time of a Template, as this is not a property of the build. It is rather something that we do in order to prevent some special data not getting build - doing it within the Template would violate seperation of concerncs!

The second part does not happen as we've discussed the code that should do it was never hooked up thus why currently tile support is broken in many ways.

I am unsure of the state of this code but during mine and dires time porting to 1.15 we found many issues with the copy-paste gadgets new systems.

We just need to pay attention to the ghosting outline before confirming the paste for now, If you face a certain way the blocks paste correctly from world to world. Looks like progress is being made, thank you dev's for taking the time to work through these issues , your doing a magnificent job. :)

Looks like progress is being made,
Remember that we have very limited time... But thanks

We just need to pay attention to the ghosting outline before confirming the paste for now, If you face a certain way the blocks paste correctly from world to world. Looks like progress is being made, thank you dev's for taking the time to work through these issues , your doing a magnificent job. :)

Yeah. I'll look into this soon as I'll be porting the mod in the coming days / week.

Ok, just tested this on master branch, rotation seems to work there correctly, but placement seems to flipwhen rotating..

So the block on the left gets placed on the right and the other way around.

So a 90 degree rotation followed by a mirror places the blocks correctly.
180 degrees doesn't need a mirror
But 270 needs a mirror to be correct

Ah, but that's only on a line, in 3 dimensions it's indeed all wrong...
but looking at the specific block transformation they seem to be correct, so maybe it's the rotationMatrixFor that's wrong?

Found it.. the rotation matrix was indeed wrong !

https://github.com/Direwolf20-MC/BuildingGadgets/blob/master/src/main/java/com/direwolf20/buildinggadgets/common/util/tools/MathUtils.java#L120

The [2][0] needs to be sine and [0][2] needs to be -sine

@MajorTuvok can you confirm so I can build out an update today or tomorrow to fix this and a few other outstanding issues?

Had to look it up myself: https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations

Seems this is also a bug in the 1.14 branch, want me to base my PR on 1.14?

If you're working on a PR then feel free to make the same PR for both 1.14 and 1.15 as they are basically the same code bases

Ok, I'll base it on 1.14, then it should be upmergable to 1.15 too :)

Backported and will be released soon :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

douyabian picture douyabian  路  6Comments

SirFlip picture SirFlip  路  4Comments

MajorTuvok picture MajorTuvok  路  6Comments

matsaa93 picture matsaa93  路  7Comments

sonolumin picture sonolumin  路  5Comments