Skip to content

Bug in CompoundTag.partOf() #100

@arvitus

Description

@arvitus

There is a bug in the CompoundTag.partOf() method that leads to inaccurate results. Because of this, it might happen that this methods returns True, even if not all of the child tags of the other Compound are also in the original Compound.

This is because of this line and can be easyily fixed by only return from this line, if the result is False.

So return tag.equals(other.get(entry.getKey())); becomes if (!tag.equals(other.get(entry.getKey()))) return false;, and that's it.

I discovered this, because a Script I wrote for MCA did not work as intended. So this fix should also be included in MCA.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions