From 9edf2c80fc9f9be06a7c9b74ea33d0f897a035eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Tue, 5 Jul 2016 16:01:52 +0200 Subject: [PATCH] Thrones - Clean item names Used to have ".bottom" in them due to being auto-registered. --- src/java/mmm/deco/DThrone.java | 10 ++++++++-- src/java/mmm/deco/DThroneBlock.java | 7 ++----- 2 files changed, 10 insertions(+), 7 deletions(-) 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 ) ) ); }