Skip to content

Commit e80e7a2

Browse files
committed
implement ItemType#container
1 parent 7796c8f commit e80e7a2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemMixin_API.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public abstract class ItemMixin_API implements ItemType, SpongeImmutableDataHold
5454
@Shadow public abstract int shadow$getMaxStackSize();
5555
@Shadow public abstract String shadow$getDescriptionId();
5656
@Shadow @Final private Rarity rarity;
57+
@Shadow @Nullable public abstract Item shadow$getCraftingRemainingItem();
5758
// @formatter:on
5859

5960
@Nullable protected BlockType api$blockType = null;
@@ -97,4 +98,10 @@ public TagType<ItemType> tagType() {
9798
public Collection<Tag<ItemType>> tags() {
9899
return TagUtil.getAssociatedTags(this, RegistryTypes.ITEM_TYPE_TAGS);
99100
}
101+
102+
@Override
103+
public Optional<ItemType> container() {
104+
final Item craftingRemainingItem = this.shadow$getCraftingRemainingItem();
105+
return Optional.ofNullable((ItemType) craftingRemainingItem);
106+
}
100107
}

0 commit comments

Comments
 (0)