Mekanism Additions

Mekanism Additions

21M Downloads

[1.12] Transport Pipes not running validation checks

DarkGuardsman opened this issue ยท 6 comments

commented

Issue description:

Transport pipes are not running any item validation check when working with IItemHandler capabilities. This causes inventories which expect validation to be run to have items in invalid slots.

https://github.com/aidancbrady/Mekanism/blob/master/src/main/java/mekanism/common/content/transporter/TransporterManager.java#L322

Javadoc for isItemValid, which should be run before doing an insert call.
screenshot 2018-09-19 10 37 17

Version (make sure you are on the latest version before reporting):

Forge: 1.12.2-14.23.4.2759
Mekanism: 1.12.2-9.4.13.349

commented

@DarkGuardsman Reading over the javadoc, I'm not sure of the necessity of this.

The line you linked (permalink) is a simulation. If a provider returns an empty stack, it accepted the item. IMO its a flaw in the receiver if it does not check an inserted item is 'valid' in terms of filters etc

commented

Yes I read the docs that is why I posted this issue. Here are screenshots from the latest forge.

image
image

Problem is a lot of mods do not validate on insert. As it is expected that a mod calls isItemValid before calling insert. This results in mekanism forcing items into slots on a few mods that have not implemented isItemValid internally.

commented

Ya that is what I was thinking as well. I recall previously there was some extract or getSlot functionality that did this behavior as a filter check. Regardless it would be cool if you could fix it as it will become more common for mods to use the method.

commented

This is a new function which did not previously exist.

commented

Just checking in, have you had a chance to work on this? If not care if I Pull Request the changes myself?

commented

I have not, and it's low on my priority list