Skip to content

Commit

Permalink
Don't Copy Nulls ( #164 )
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgorithmX2 committed Nov 7, 2016
1 parent c90463b commit 53b75e3
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -660,6 +660,11 @@ public ItemStackGeneratedCache(
final ItemStack out;
final VoxelBlobStateReference ref;
final int rotations;

public ItemStack getItemStack()
{
return out == null ? null : out.copy();
}
};

/**
Expand All @@ -680,7 +685,7 @@ public ItemStack getItemStack(

if ( cache != null && cache.rotations == rotations && cache.ref == getBlobStateReference() && cache.out != null )
{
return cache.out.copy();
return cache.getItemStack();
}

VoxelBlob vb = getBlob();
Expand All @@ -703,7 +708,7 @@ public ItemStack getItemStack(
{
if ( cache != null && cache.rotations == 0 && cache.ref == getBlobStateReference() )
{
return cache.out.copy();
return cache.getItemStack();
}

final BitAccess ba = new BitAccess( null, null, getBlob(), VoxelBlob.NULL_BLOB );
Expand Down

0 comments on commit 53b75e3

Please sign in to comment.