Skip to content

Commit

Permalink
fix: overlaysMeta not merging properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Aug 15, 2024
1 parent b45145a commit 1652f98
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.mineinabyss.idofront.messaging.idofrontLogger
import net.kyori.adventure.key.Key
import org.bukkit.Material
import team.unnamed.creative.ResourcePack
import team.unnamed.creative.metadata.overlays.OverlaysMeta
import team.unnamed.creative.model.Model
import team.unnamed.creative.serialize.minecraft.MinecraftResourcePackReader
import team.unnamed.creative.serialize.minecraft.MinecraftResourcePackWriter
Expand Down Expand Up @@ -103,6 +104,12 @@ object ResourcePacks {
}

if (originalPack.packMeta()?.description().isNullOrEmpty()) mergePack.packMeta()?.let { originalPack.packMeta(it) }
if (mergePack.overlaysMeta() != null) {
val originalOverlays = originalPack.overlaysMeta()?.entries() ?: emptyList()
val mergeOverlays = mergePack.overlaysMeta()?.entries() ?: emptyList()

originalPack.overlaysMeta(OverlaysMeta.of(originalOverlays.plus(mergeOverlays)))
}
if (originalPack.icon() == null) mergePack.icon()?.let { originalPack.icon(it) }
}

Expand Down

0 comments on commit 1652f98

Please sign in to comment.