Fixes #2571: Only call getDurabilityForDisplay if the item is damageable.
This commit is contained in:
@@ -26,7 +26,6 @@ import java.io.DataOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.InvalidParameterException;
|
import java.security.InvalidParameterException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
@@ -92,7 +91,14 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
|||||||
* Kinda hackery
|
* Kinda hackery
|
||||||
*/
|
*/
|
||||||
this.getDefinition().setDamageValue( this.def.getDamageValueHack( is ) );
|
this.getDefinition().setDamageValue( this.def.getDamageValueHack( is ) );
|
||||||
this.getDefinition().setDisplayDamage( (int) ( is.getItem().getDurabilityForDisplay( is ) * Integer.MAX_VALUE ) );
|
if( !is.getItem().isDamageable() )
|
||||||
|
{
|
||||||
|
this.getDefinition().setDisplayDamage( Integer.MAX_VALUE );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.getDefinition().setDisplayDamage( (int) ( is.getItem().getDurabilityForDisplay( is ) * Integer.MAX_VALUE ) );
|
||||||
|
}
|
||||||
this.getDefinition().setMaxDamage( is.getMaxDamage() );
|
this.getDefinition().setMaxDamage( is.getMaxDamage() );
|
||||||
|
|
||||||
final NBTTagCompound tagCompound = is.getTagCompound();
|
final NBTTagCompound tagCompound = is.getTagCompound();
|
||||||
|
|||||||
Reference in New Issue
Block a user