Fixes #4090 Portable cell incorrect empty itemstack handling (#4093)

This commit is contained in:
yueh
2019-07-23 20:13:15 +02:00
committed by GitHub
parent ded71cb2bd
commit 92536fceb4
@@ -60,31 +60,21 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable
{
final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot( this.slot );
if( this.civ != null )
{
if( currentItem != this.civ.getItemStack() )
{
if( !currentItem.isEmpty() )
{
if( ItemStack.areItemsEqual( this.civ.getItemStack(), currentItem ) )
{
this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.civ.getItemStack() );
}
else
{
this.setValidContainer( false );
}
}
else
{
this.setValidContainer( false );
}
}
}
else
if( this.civ == null || currentItem.isEmpty() )
{
this.setValidContainer( false );
}
else if( this.civ != null && !this.civ.getItemStack().isEmpty() && currentItem != this.civ.getItemStack() )
{
if( ItemStack.areItemsEqual( this.civ.getItemStack(), currentItem ) )
{
this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.civ.getItemStack() );
}
else
{
this.setValidContainer( false );
}
}
// drain 1 ae t
this.ticks++;