We don't need the showCraftingLabel flag, as IAEStack is perfectly fine with 0 size stacks. (#3071)
Adjust rendering code to use ItemStack with size 1 where required.
This commit is contained in:
@@ -60,7 +60,6 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
// priority = is.priority;
|
||||
this.setCraftable( is.isCraftable() );
|
||||
this.setCountRequestable( is.getCountRequestable() );
|
||||
this.setShowCraftingLabel( is.getShowCraftingLabel() );
|
||||
|
||||
this.myHash = is.myHash;
|
||||
}
|
||||
@@ -163,7 +162,6 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
final AEFluidStack fluid = AEFluidStack.create( fluidStack );
|
||||
// fluid.priority = (int) priority;
|
||||
fluid.setStackSize( stackSize );
|
||||
fluid.setShowCraftingLabel( showCraftingLabel );
|
||||
fluid.setCountRequestable( countRequestable );
|
||||
fluid.setCraftable( isCraftable );
|
||||
return fluid;
|
||||
@@ -183,7 +181,6 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
this.incStackSize( option.getStackSize() );
|
||||
this.setCountRequestable( this.getCountRequestable() + option.getCountRequestable() );
|
||||
this.setCraftable( this.isCraftable() || option.isCraftable() );
|
||||
this.setShowCraftingLabel( this.getShowCraftingLabel() || option.getShowCraftingLabel() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,6 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
this.setStackSize( is.getStackSize() );
|
||||
this.setCraftable( is.isCraftable() );
|
||||
this.setCountRequestable( is.getCountRequestable() );
|
||||
this.setShowCraftingLabel( is.getShowCraftingLabel() );
|
||||
}
|
||||
|
||||
private AEItemStack( final ItemStack is )
|
||||
@@ -158,7 +157,6 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
final byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 );
|
||||
final boolean isCraftable = ( mask & 0x40 ) > 0;
|
||||
final boolean hasTagCompound = ( mask & 0x80 ) > 0;
|
||||
boolean showCraftingLabel = data.readBoolean();
|
||||
|
||||
// don't send this...
|
||||
final NBTTagCompound d = new NBTTagCompound();
|
||||
@@ -186,11 +184,6 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
|
||||
final ItemStack itemstack = new ItemStack( d );
|
||||
|
||||
if( !showCraftingLabel )
|
||||
{
|
||||
showCraftingLabel = stackSize == 0 && isCraftable;
|
||||
}
|
||||
|
||||
if( itemstack.isEmpty() )
|
||||
{
|
||||
return null;
|
||||
@@ -198,8 +191,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
|
||||
final AEItemStack item = AEItemStack.create( itemstack );
|
||||
// item.priority = (int) priority;
|
||||
item.setStackSize( showCraftingLabel ? 1 : stackSize );
|
||||
item.setShowCraftingLabel( showCraftingLabel );
|
||||
item.setStackSize( stackSize );
|
||||
item.setCountRequestable( countRequestable );
|
||||
item.setCraftable( isCraftable );
|
||||
return item;
|
||||
@@ -219,7 +211,6 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
this.incStackSize( option.getStackSize() );
|
||||
this.setCountRequestable( this.getCountRequestable() + option.getCountRequestable() );
|
||||
this.setCraftable( this.isCraftable() || option.isCraftable() );
|
||||
this.setShowCraftingLabel( this.getShowCraftingLabel() || option.getShowCraftingLabel() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -597,12 +588,14 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
@SideOnly( Side.CLIENT )
|
||||
public List getToolTip()
|
||||
{
|
||||
if( this.getDefinition().getTooltip() != null )
|
||||
if( this.getDefinition().getTooltip() == null )
|
||||
{
|
||||
return this.getDefinition().getTooltip();
|
||||
final ItemStack is = this.getItemStack();
|
||||
is.setCount( 1 );
|
||||
this.getDefinition().setTooltip( Platform.getTooltip( is ) );
|
||||
}
|
||||
|
||||
return this.getDefinition().setTooltip( Platform.getTooltip( this.getItemStack() ) );
|
||||
return this.getDefinition().getTooltip();
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@@ -610,7 +603,9 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
{
|
||||
if( this.getDefinition().getDisplayName() == null )
|
||||
{
|
||||
this.getDefinition().setDisplayName( Platform.getItemDisplayName( this.getItemStack() ) );
|
||||
final ItemStack is = this.getItemStack();
|
||||
is.setCount( 1 );
|
||||
this.getDefinition().setDisplayName( Platform.getItemDisplayName( is ) );
|
||||
}
|
||||
|
||||
return this.getDefinition().getDisplayName();
|
||||
|
||||
@@ -32,7 +32,6 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
private boolean isCraftable;
|
||||
private long stackSize;
|
||||
private long countRequestable;
|
||||
private boolean showCraftingLabel = false;
|
||||
|
||||
static long getPacketValue( final byte type, final ByteBuf tag )
|
||||
{
|
||||
@@ -104,22 +103,9 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
// priority = Integer.MIN_VALUE;
|
||||
this.setCountRequestable( 0 );
|
||||
this.setCraftable( false );
|
||||
this.setShowCraftingLabel( false );
|
||||
return (StackType) this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getShowCraftingLabel()
|
||||
{
|
||||
return this.showCraftingLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShowCraftingLabel( boolean showCraftingLabel )
|
||||
{
|
||||
this.showCraftingLabel = showCraftingLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMeaningful()
|
||||
{
|
||||
@@ -157,7 +143,6 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
.getType( this.countRequestable ) << 4 ) | ( (byte) ( this.isCraftable ? 1 : 0 ) << 6 ) | ( this.hasTagCompound() ? 1 : 0 ) << 7 );
|
||||
|
||||
i.writeByte( mask );
|
||||
i.writeBoolean( this.showCraftingLabel );
|
||||
|
||||
this.writeIdentity( i );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user