Skip to content

Commit

Permalink
Fix cuboid clone vs duplicate handling of notes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 19, 2020
1 parent 9077011 commit d7f56ea
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -50,9 +50,6 @@ public class CuboidTag implements ObjectTag, Cloneable, Notable, Adjustable, Are

@Override
public CuboidTag clone() {
if (noteName != null) {
return this;
}
CuboidTag cuboid;
try {
cuboid = (CuboidTag) super.clone();
Expand All @@ -61,6 +58,7 @@ public CuboidTag clone() {
Debug.echoError(ex);
cuboid = new CuboidTag();
}
cuboid.noteName = null;
cuboid.pairs = new ArrayList<>(pairs.size());
for (LocationPair pair : pairs) {
cuboid.pairs.add(new LocationPair(pair.low.clone(), pair.high.clone()));
Expand Down Expand Up @@ -191,6 +189,9 @@ public static boolean matches(String string) {

@Override
public ObjectTag duplicate() {
if (noteName != null) {
return this;
}
return clone();
}

Expand Down

0 comments on commit d7f56ea

Please sign in to comment.