Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern Terminal Dupe #2312

Closed
LucidTheStick opened this issue Jul 3, 2016 · 8 comments
Closed

Pattern Terminal Dupe #2312

LucidTheStick opened this issue Jul 3, 2016 · 8 comments
Labels
bug Self explanatory?

Comments

@LucidTheStick
Copy link

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

@XFactHD
Copy link
Collaborator

XFactHD commented Jul 3, 2016

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

@LucidTheStick
Copy link
Author

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.

@bookerthegeek bookerthegeek added the bug Self explanatory? label Jul 4, 2016
@bookerthegeek
Copy link
Collaborator

Can confirm works on latest version.

@thomas15v
Copy link

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.

@yueh
Copy link
Member

yueh commented Oct 18, 2016

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.

@thomas15v
Copy link

thomas15v commented Oct 18, 2016

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.

@yueh
Copy link
Member

yueh commented Oct 18, 2016

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.

@thomas15v
Copy link

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.

@yueh yueh closed this as completed in 0177f14 Oct 22, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Self explanatory?
Projects
None yet
Development

No branches or pull requests

5 participants