Applied Energistics 2

Applied Energistics 2

137M Downloads

Pattern Terminal Dupe

LucidTheStick opened this issue ยท 8 comments

commented

This was reported to us via our private bug reports and reproduced by our staff.

Jar: appliedenergistics2-rv2-stable-10.jar

Steps to reproduce:

  1. Place a simple ME network with Energy Acceptor, ME Drive (1 drive any size), glass cable, ME Pattern Terminal
  2. Place a stack or so of the item you'd like to dupe
  3. Fill the rest of the drive up with garbage (cobble was used)
  4. Have a full stack of the item in your inventory
  5. Remove 32 (half stack) of the cobble from ME
  6. Shift (right or left) click the stack of item you'd like to dupe from your inventory
  7. You should still see your stack in inventory, and 32 added to the original stack in system
  8. Right click the 32 items and place in inventory
  9. Repeat to your hearts content

Video (not made but us)
https://www.youtube.com/watch?v=2dB8iU9kFGY

commented

The problem happens here:

if( selectedSlots.isEmpty() && clickSlot.isPlayerSide() )
{
if( tis != null )
{
// target slots in the container...
for( final Object inventorySlot : this.inventorySlots )
{
final AppEngSlot cs = (AppEngSlot) inventorySlot;
final ItemStack destination = cs.getStack();
if( !( cs.isPlayerSide() ) && cs instanceof SlotFake )
{
if( Platform.isSameItemPrecise( destination, tis ) )
{
return null;
}
else if( destination == null )
{
cs.putStack( tis.copy() );
cs.onSlotChanged();
this.updateSlot( cs );
return null;
}
}
}
}
}
.

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.

commented

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.

commented

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.

commented

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.

commented

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.

commented

You should update to the latest beta, it is more stable than the version you are using.

commented

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.

commented

Can confirm works on latest version.