diff options
Diffstat (limited to 'src/main/kotlin/repo/ItemCache.kt')
-rw-r--r-- | src/main/kotlin/repo/ItemCache.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/kotlin/repo/ItemCache.kt b/src/main/kotlin/repo/ItemCache.kt index 9f1d45c..e140dd8 100644 --- a/src/main/kotlin/repo/ItemCache.kt +++ b/src/main/kotlin/repo/ItemCache.kt @@ -77,6 +77,11 @@ object ItemCache : IReloadable { val ItemStack.isBroken get() = get(FirmamentDataComponentTypes.IS_BROKEN) ?: false + fun ItemStack.withFallback(fallback: ItemStack?): ItemStack { + if (isBroken && fallback != null) return fallback + return this + } + fun brokenItemStack(neuItem: NEUItem?, idHint: SkyblockId? = null): ItemStack { return ItemStack(Items.PAINTING).apply { setCustomName(Text.literal(neuItem?.displayName ?: idHint?.neuItem ?: "null")) |