File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
src/main/kotlin/com/lambda/util/item Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 1818package com.lambda.util.item
1919
2020import com.lambda.util.collections.Cacheable.Companion.cacheable
21+ import net.minecraft.component.ComponentType
2122import net.minecraft.component.DataComponentTypes
2223import net.minecraft.component.type.AttributeModifiersComponent
2324import net.minecraft.entity.EquipmentSlot
@@ -104,15 +105,8 @@ object ItemStackUtils {
104105 return listOf (copyWithCount(maxCount), copyWithCount(remainder))
105106 }
106107
107- // TODO: Find another way
108108 val ItemStack .shulkerBoxContents: List <ItemStack > by cacheable { stack ->
109- /* BlockItem.getBlockEntityNbt(stack)?.takeIf {
110- it.contains("Items", NbtElement.LIST_TYPE.toInt())
111- }?.let {
112- val list = DefaultedList.ofSize(27, ItemStack.EMPTY)
113- Inventories.readNbt(it, list)
114- list
115- } ?: */ emptyList()
109+ stack.components.get(DataComponentTypes .CONTAINER )?.stream()?.toList() ? : emptyList()
116110 }
117111
118112 /* *
You can’t perform that action at this time.
0 commit comments