Skip to content

Commit

Permalink
Fix ItemConfig#merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSzabo committed Jul 8, 2024
1 parent b177de9 commit 390e680
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ItemConfig merge(ItemConfig other) {
ret.refresh = other.refresh;
if (other.name != null) ret.name = other.name;

if (other.lore != null) {
if (other.lore != null && !other.lore.isEmpty()) {
ret.lore = new ArrayList<>(other.lore);
}

Expand All @@ -50,27 +50,27 @@ public ItemConfig merge(ItemConfig other) {
ret.skull = new SkullConfig(other.skull);
}

if (other.flags != null) {
if (other.flags != null && !other.flags.isEmpty()) {
ret.flags = new HashSet<>(other.flags);
}

if (other.potion != null) {
ret.potion = new PotionConfig(other.potion);
}

if (other.enchantments != null) {
if (other.enchantments != null && !other.enchantments.isEmpty()) {
ret.enchantments = new HashMap<>(other.enchantments);
}

if (other.onClick != null) {
if (other.onClick != null && !other.onClick.isEmpty()) {
ret.onClick = new ArrayList<>(other.onClick);
}

if (other.onLeftClick != null) {
if (other.onLeftClick != null && !other.onLeftClick.isEmpty()) {
ret.onLeftClick = new ArrayList<>(other.onLeftClick);
}

if (other.onRightClick != null) {
if (other.onRightClick != null && !other.onRightClick.isEmpty()) {
ret.onRightClick = new ArrayList<>(other.onRightClick);
}

Expand Down

0 comments on commit 390e680

Please sign in to comment.