Skip to content

NBT Data Loosed on Contraption Disassembly  #5420

@Allmoz

Description

@Allmoz

Describe the Bug

when a contraption is disassembled, create first destroy the block at a location and then it sets the blocks into the world in 2 steps. first it create the block as default, then it fills the nbt data. When one of the 2 first steps fails the functions continues and the nbt data is lost.

the function in question is addBlocksToWorld:

https://github.com/Creators-of-Create/Create/blob/mc1.18/dev/src/main/java/com/simibubi/create/content/contraptions/Contraption.java#L1095C52-L1095C52

For example when there is a bedrock block removal is denied and the new block is dropped as it was to be placed in the world in by the first step. this means for example that items in chest or liquids in tanks gets lost.

Later in the chain of the modding community it also extend to claim and permissions mods (for example OPAC) that also could deny part of the steps.

** edited to add bedrock block issue, and better reflect the bug

Reproduction Steps

  1. assembly a minecart contraption on unclaimed chunks
  2. un assembly a minecart contraption in claimed chunks ( has to be different chunks and be in those states and protection has to be enabled)

Expected Result

ideally, for the contraption to not be able to be disassembled if any of its block is in a chunk that it cannot be replaced. rising an exception to the chat

the issue has been raised also to the opac mod developer:

thexaero/open-parties-and-claims#279 (comment)

:) best regards!

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

Windows 11

Mod Version

0.5.1d

Minecraft Version

1.18.2

Forge Version

40.2.9

Other Mods

OPAC

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugIssue where something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions