Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to Schematic Command relating to Entities #2623

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

kitkatod
Copy link
Contributor

Fixes Schematic Command relating to Entities

  • Add missing "glow_item_frame" entity to copied entities.
  • Fix for Entity being pasted 1 block off of expected position after schematic is flipped.
  • Fix for Entity being pasted with incorrect Yaw value after schematic is flipped.
  • Fix for exception thrown when non-rotatable entity is rotated.
  • Update command meta with missing supported entity types.

Notable potential issues

  • Removed "rotation" value being tracked for entities in a schematic (note: this is not the "entity rotation" mechanism).
    • The "rotation" value was tracking "how much should the entity rotate when being pasted", however complicated logic figuring out "how far to rotate" when flipping schematics correctly.
    • Yaw and the entity rotation mechanism are now changed during schematic flip/rotate, aligning more with how blocks flip/rotate for schematics.
    • This should only be an issue for users who have created a schematic, flipped/rotated, then saved that schematic - however the saved rotation value would have also been incorrect when saved.

…Now functions as expected for any valid yaw value.

Update entity rotation mechanism and entity yaw anytime schematic is flipped or rotated, instead of calculating when pasting "how much entity has rotated since creation" then applying.

Remove an offset compensation for hanging entities being weird. During testing this has not caused any issues, unsure if this was an issue previously due to incorrect entity rotations.
@@ -104,7 +104,7 @@ public void run(ReplaceableTagEvent event) {
// This takes an optional duration as "fake_duration" for how long the fake blocks should remain.
//
// The "create" and "paste" options allow the "entities" argument to be specified - when used, entities will be copied or pasted.
// At current time, entity types included will be: Paintings, ItemFrames, ArmorStands.
// At current time, entity types included will be: Paintings, ItemFrames, GlowItemFrames, ArmorStands, and DisplayEntities.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is DisplayEntities implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point... Display Entities were already included in the types to be copied so the meta update for it was just to document what already existed. However after adding display entities to the test schematic I'm seeing them getting updated in unexpected ways, losing transformation data, and text_displays losing text.

After disabling the thrown exception on EntityHelper.setStepHeight (not all entity mechanisms are applied otherwise) it does actually spawn display entities, however rotation transformation is still completely lost - wondering if this might be a v1.20.6 issue? I'm not able to spawn in display entities with pitch/yaw ever applied either.

Want me to remove the DisplayEntities note for the moment?

@mcmonkey4eva
Copy link
Member

Have you tested this very very very thoroughly with item frames in weird positions? There's a lot of obscure hacks in the original code that exist entirely because of incredibly specific edge-case behaviors with item frames

@kitkatod
Copy link
Contributor Author

I'm pretty confident in the transformations for item_frame, glow_item_frame, and armor_stand. Attached are the script and schematic I've used during testing, which has a bunch of item frames and armor stands in all sorts of positions. The script pastes 50 copies of the schematic, applying a random transformation to the same schematic between each paste.

I did catch a comment in the pasteEntities method which referenced item_frame being weird, however no item_frames were incorrectly placed or broken during testing after the changes. item_frame entities do still spawn in with their (annoying) appropriate 0.03125 offset from the block they're attached to. Should I go back to test an older MC version to make sure this isn't something that will pop up again later?

schemtesting.zip
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants