Skip to content

Commit

Permalink
Use bit logic instead to get names for chiseled blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgorithmX2 committed Feb 3, 2018
1 parent 7c48ccb commit be5d69a
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -19,6 +19,7 @@
import mod.chiselsandbits.helpers.ModUtil;
import mod.chiselsandbits.interfaces.IItemScrollWheel;
import mod.chiselsandbits.interfaces.IVoxelBlobItem;
import mod.chiselsandbits.items.ItemChiseledBit;
import mod.chiselsandbits.network.NetworkRouter;
import mod.chiselsandbits.network.packets.PacketAccurateSneakPlace;
import mod.chiselsandbits.network.packets.PacketAccurateSneakPlace.IItemBlockAccurate;
Expand Down Expand Up @@ -434,13 +435,11 @@ public String getItemStackDisplayName(
c.readChisleData( BlockEntityTag, VoxelBlob.VERSION_ANY );

final IBlockState state = c.getPrimaryBlockState();
final Block blk = state.getBlock();
String name = ItemChiseledBit.getBitStateName( state );

final ItemStack target = new ItemStack( blk, 1, blk.getMetaFromState( state ) );

if ( target.getItem() != null )
if ( name != null )
{
return new StringBuilder().append( super.getItemStackDisplayName( stack ) ).append( " - " ).append( target.getDisplayName() ).toString();
return new StringBuilder().append( super.getItemStackDisplayName( stack ) ).append( " - " ).append( name ).toString();
}
}
}
Expand Down

0 comments on commit be5d69a

Please sign in to comment.