diff --git a/src/java/mmm/deco/DThrone.java b/src/java/mmm/deco/DThrone.java index e83fc26..aa84df6 100644 --- a/src/java/mmm/deco/DThrone.java +++ b/src/java/mmm/deco/DThrone.java @@ -2,6 +2,8 @@ package mmm.deco; import mmm.utils.URegistry; +import net.minecraft.item.Item; +import net.minecraft.item.ItemCloth; @@ -10,12 +12,16 @@ public class DThrone public final DThroneBlock TOP; public final DThroneBlock BOTTOM; + public final Item ITEM; - public DThrone( E_DWoodType woodType ) + public DThrone( final E_DWoodType woodType ) { - URegistry.addBlock( this.BOTTOM = new DThroneBlock( this , woodType , false ) ); + URegistry.addBlock( this.BOTTOM = new DThroneBlock( this , woodType , false ) , null ); URegistry.addBlock( this.TOP = new DThroneBlock( this , woodType , true ) , null ); + this.ITEM = new ItemCloth( this.BOTTOM ); + URegistry.setIdentifiers( this.ITEM , "deco" , "throne" , woodType.suffix ); + URegistry.addItem( this.ITEM ); } } diff --git a/src/java/mmm/deco/DThroneBlock.java b/src/java/mmm/deco/DThroneBlock.java index 8bcedf8..8dbdfd4 100644 --- a/src/java/mmm/deco/DThroneBlock.java +++ b/src/java/mmm/deco/DThroneBlock.java @@ -238,7 +238,7 @@ public class DThroneBlock public Item getItemDropped( IBlockState state , Random rand , int fortune ) { - return Item.getItemFromBlock( this.parts.BOTTOM ); + return this.parts.ITEM; } @@ -246,10 +246,7 @@ public class DThroneBlock public ItemStack getPickBlock( final IBlockState state , final RayTraceResult target , final World world , final BlockPos pos , final EntityPlayer player ) { - final Item item = Item.getItemFromBlock( this.parts.BOTTOM ); - return item == null - ? null - : new ItemStack( item , 1 , this.damageDropped( state.getActualState( world , pos ) ) ); + return new ItemStack( this.parts.ITEM , 1 , this.damageDropped( state.getActualState( world , pos ) ) ); }