Tinkers Construct

Tinkers Construct

170M Downloads

Bundles allow for tools with inventories inside other tools with inventories

Closed this issue ยท 2 comments

commented

Minecraft Version

1.20.1

Modloader

Forge

Modloader Version

47.4.2

Mantle Version

1.11.63

Tinkers' Construct Version

3.10.1.76

Describe your issue

A tool with an inventory can be put inside a bundle, as bundles specifically call the Item#canFitInsideContainerItems() method to check if an item should be allowed inside them. Bundles can also fit inside container items; a bundle can be put inside a Shulker Box, another bundle, or the inventory of a tool.

By putting a tool that has an inventory inside of a bundle, and putting that bundle inside another tool's inventory, it is possible to put a tool with an inventory inside another tool's inventory. This can be repeated multiple times to further nest tools inside tools inside tools and so on. This is normally behavior that is not allowed.

Here is a visual demonstration, using wooden swords that have Smelting:

javaw_nx2DTBgyXs.mp4

Steps to reproduce

  1. Obtain two tools with inventories, such as two Slimeshells or two tools with Smelting
  2. Obtain a bundle, likely through the /give command
  3. Insert one of the tools into the bundle
  4. Open the inventory of the other tool
  5. Place the bundle inside the tool

After following these steps, the first tool should be inside a bundle which is inside the second tool's inventory. Normally, having a tool with an inventory inside the inventory of a tool is not allowed.

Crash Report

No response

Can you reproduce with just Tinkers?

Yes

Performance Enchancers

None of the above

Other mods

No response

Searched for known issues?

Checked pinned issues, Searched open issues, Searched closed issues, Checked the FAQ, Checked the in game books

commented

Yeah, this is an annoying one.

The method to check if an item can go in a bundle is not stack sensitive. So either we forbid tools from ever going in bundles, or we forbid bundles from ever going in tools.

Between the two, I think tools going in bundles has much less usecase. Though a lot of mods use the non-stack sensitive method to blacklist things in their container items, so that likely has the consequence of blocking tools in a lot of other mods containers (including our own). Will have to consider how to best fix this.

commented

v3.10.2.92 for 1.20.1 adds a workaround by disallowing bundles in tools. A proper fix requires a forge change for NBT sensitive allowed in inventories method in bundles, feel free to make a PR to Forge/Neo for that.