Skip to content

Commit

Permalink
Fixed style not being copied
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni0451 committed Sep 20, 2024
1 parent ab6890a commit 2ae02b7
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public ATextComponent copy() {
public ATextComponent shallowCopy() {
KeybindComponent copy = new KeybindComponent(this.keybind);
copy.translator = this.translator;
return copy;
return copy.setStyle(this.getStyle().copy());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public ATextComponent copy() {
public ATextComponent shallowCopy() {
ScoreComponent copy = new ScoreComponent(this.name, this.objective);
copy.value = this.value;
return copy;
return copy.setStyle(this.getStyle().copy());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public ATextComponent copy() {

@Override
public ATextComponent shallowCopy() {
if (this.separator == null) return new SelectorComponent(this.selector, null);
else return new SelectorComponent(this.selector, this.separator.copy());
if (this.separator == null) return new SelectorComponent(this.selector, null).setStyle(this.getStyle().copy());
else return new SelectorComponent(this.selector, this.separator.copy()).setStyle(this.getStyle().copy());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ATextComponent copy() {

@Override
public ATextComponent shallowCopy() {
return new StringComponent(this.text);
return new StringComponent(this.text).setStyle(this.getStyle().copy());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public ATextComponent shallowCopy() {
}
TranslationComponent copy = new TranslationComponent(this.key, copyArgs);
copy.translator = this.translator;
return copy;
return copy.setStyle(this.getStyle().copy());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public ATextComponent copy() {

@Override
public ATextComponent shallowCopy() {
if (this.getSeparator() == null) return new BlockNbtComponent(this.getComponent(), this.isResolve(), this.getSeparator(), this.pos);
else return new BlockNbtComponent(this.getComponent(), this.isResolve(), this.getSeparator().copy(), this.pos);
if (this.getSeparator() == null) return new BlockNbtComponent(this.getComponent(), this.isResolve(), this.getSeparator(), this.pos).setStyle(this.getStyle().copy());
else return new BlockNbtComponent(this.getComponent(), this.isResolve(), this.getSeparator().copy(), this.pos).setStyle(this.getStyle().copy());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public ATextComponent copy() {

@Override
public ATextComponent shallowCopy() {
if (this.getSeparator() == null) return new EntityNbtComponent(this.getComponent(), this.isResolve(), null, this.selector);
else return new EntityNbtComponent(this.getComponent(), this.isResolve(), this.getSeparator(), this.selector);
if (this.getSeparator() == null) return new EntityNbtComponent(this.getComponent(), this.isResolve(), null, this.selector).setStyle(this.getStyle().copy());
else return new EntityNbtComponent(this.getComponent(), this.isResolve(), this.getSeparator(), this.selector).setStyle(this.getStyle().copy());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public ATextComponent copy() {

@Override
public ATextComponent shallowCopy() {
if (this.getSeparator() == null) return new StorageNbtComponent(this.getComponent(), this.isResolve(), null, this.id);
else return new StorageNbtComponent(this.getComponent(), this.isResolve(), this.getSeparator(), this.id);
if (this.getSeparator() == null) return new StorageNbtComponent(this.getComponent(), this.isResolve(), null, this.id).setStyle(this.getStyle().copy());
else return new StorageNbtComponent(this.getComponent(), this.isResolve(), this.getSeparator(), this.id).setStyle(this.getStyle().copy());
}

@Override
Expand Down

0 comments on commit 2ae02b7

Please sign in to comment.