Temporary (?) hacky fix to display the craftable items

This is kind of a hackjob IMO but it saves me the trouble of possibly rewriting large portions of either the AE codebase or ASM'ing the vanilla classes.
This commit is contained in:
Gunther De Wachter
2017-06-25 18:01:30 +02:00
parent c74aaddbd3
commit 370fc49357
6 changed files with 47 additions and 4 deletions
@@ -32,6 +32,7 @@ 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 )
{
@@ -103,9 +104,20 @@ 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()
{
@@ -142,6 +154,8 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
final byte mask = (byte) ( this.getType( 0 ) | ( this.getType( this.stackSize ) << 2 ) | ( this.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 );
this.readNBT( i );