Pattern Terminal Dupe
LucidTheStick opened this issue ยท 8 comments
This was reported to us via our private bug reports and reproduced by our staff.
Jar: appliedenergistics2-rv2-stable-10.jar
Steps to reproduce:
- Place a simple ME network with Energy Acceptor, ME Drive (1 drive any size), glass cable, ME Pattern Terminal
- Place a stack or so of the item you'd like to dupe
- Fill the rest of the drive up with garbage (cobble was used)
- Have a full stack of the item in your inventory
- Remove 32 (half stack) of the cobble from ME
- Shift (right or left) click the stack of item you'd like to dupe from your inventory
- You should still see your stack in inventory, and 32 added to the original stack in system
- Right click the 32 items and place in inventory
- Repeat to your hearts content
Video (not made but us)
https://www.youtube.com/watch?v=2dB8iU9kFGY
The problem happens here:
Applied-Energistics-2/src/main/java/appeng/container/AEBaseContainer.java
Lines 536 to 562 in 41b8754
This piece of code is getting used for things that have fake itemslots (import buses, cables, ... ). So the the player doesn't lose the item when being set. However the pattern terminal also has some fake slots. Wich causes this piece of code to return "Null" and not handeling the code needed to make the used itemstack go down.
Thanks for finding it @thomas15v. The fix does not seem to be that hard, just a break
instead of return
would already force it to still do the cleanup afterwards.
But the question is also should it really shift click into the pattern terminal. It only works when the network is completely full. Which makes it pretty pointless. Or the alternative is to have in on a different network without access to the main network to prevent if from dumping them into the network. Also useless as you have to constantly switch between terminals.
Thus another solution would be to ignore use fake slots, if there are other types. But that might cause issues with buses, as they still have the real slot for upgrades.
I fixed it with adding a if (this instanceof PatternTerminalContainer)
because with mixins I can't remove/edit return null
.
Also I think using a pattern-terminal to acces/send items is usefully for creating recipes. So I would let shift clicking just work like it does with the crafting and normal terminal.
It is about shift clicking into a fake slot. With the pattern terminal that it the last resort, if it could not insert into the network. But the shift click to insert into the network has to stay.
Shift clicking will only add 1 stack of the same type. So either you have some useless fake item lingering around, which needs to be removed in >99% of the cases because it was placed in the wrong slot or simply not part of the recipe at all. And the few compression recipes, which could make use of being able to shift click 9 cobble into the pattern do not work, because it will never allow the placement of more than 1 stack of the same type.
I don't see any use of shift clicking in the crafting slots. The crafting terminal also doesn't do that. And most people just use NEI to import the recipe directly.
You should update to the latest beta, it is more stable than the version you are using.
I'll update a test server for testing but this is on the Crackpack Modpack so I can't update that server. However I know this works on previous versions as well.