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

Essentia transformation bug (OP) Arcane terminal #357

Open
R60D opened this issue Nov 24, 2018 · 2 comments
Open

Essentia transformation bug (OP) Arcane terminal #357

R60D opened this issue Nov 24, 2018 · 2 comments
Labels
Bug TE 1 Version 1 of Thaumic Energistics

Comments

@R60D
Copy link

R60D commented Nov 24, 2018

GTNewHorizons/GT-New-Horizons-Modpack#3848
version of Thaumic Energistics (thaumicenergistics-1.1.3.0)

@Nividica
Copy link
Owner

Nividica commented Nov 28, 2018

What I suspect is happening, is the check isItemEqual is not a robust enough check

Call chain:
public void onClientRequestExtract
https://github.com/Nividica/ThaumicEnergistics/blob/AE2-RV3/src/main/java/thaumicenergistics/common/container/ContainerPartArcaneCraftingTerminal.java#L1226

switch ( mouseButton )
case ThEGuiHelper.MOUSE_BUTTON_LEFT:
if( isShiftHeld )
targetSlot = this.locateMergeSlot( requestStack );

public final Slot locateMergeSlot
https://github.com/Nividica/ThaumicEnergistics/blob/AE2-RV3/src/main/java/thaumicenergistics/common/container/ContainerWithPlayerInventory.java#L304

for( Slot slot : this.playerSlots )
if( slot.getHasStack() )
ItemStack slotStack = slot.getStack();
if( ( slotStack.stackSize < slotStack.getMaxStackSize() ) && slotStack.isItemEqual( stack ) )
return slot;

@Nividica
Copy link
Owner

Nividica commented Nov 28, 2018

An additional check should be something along the lines of

if(
    // Slot has room for more
    ( slotStack.stackSize < slotStack.getMaxStackSize() )
    // Same item
    && slotStack.isItemEqual( stack )
    // Neither has NBT, or NBTs are equal
    && (
        (!stack.hasTagCompound() && !slotStack.hasTagCompound() )
        || ItemStack.areItemStackTagsEqual(stack, slotStack)
    )
){

There may be additional considerations for items with NBT

@Nividica Nividica added Bug TE 1 Version 1 of Thaumic Energistics labels Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug TE 1 Version 1 of Thaumic Energistics
Projects
None yet
Development

No branches or pull requests

2 participants