From cab22724eaff9cb8f76c83c2025c512dc133c4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 4 Jul 2016 17:37:53 +0200 Subject: [PATCH] Throne - Recipes Base recipe + dyeing recipe --- src/java/mmm/deco/DThroneBlock.java | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/java/mmm/deco/DThroneBlock.java b/src/java/mmm/deco/DThroneBlock.java index 0238912..dfa1dea 100644 --- a/src/java/mmm/deco/DThroneBlock.java +++ b/src/java/mmm/deco/DThroneBlock.java @@ -5,6 +5,7 @@ import java.util.List; import mmm.utils.I_UBlockSeat; import mmm.utils.I_UColoredBlock; +import mmm.utils.I_URecipeRegistrar; import mmm.utils.I_USupportBlock; import mmm.utils.URegistry; import mmm.utils.USeat; @@ -22,6 +23,8 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -32,6 +35,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -39,7 +43,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class DThroneBlock extends Block - implements I_UColoredBlock , I_UBlockSeat + implements I_UColoredBlock , I_UBlockSeat , I_URecipeRegistrar { public static final PropertyDirection FACING; @@ -314,4 +318,29 @@ public class DThroneBlock } } + + // ************************************************************************************************* + // CRAFTING + // ************************************************************************************************* + + @Override + public void registerRecipes( ) + { + for ( EnumDyeColor dyeColor : EnumDyeColor.values( ) ) { + GameRegistry.addShapedRecipe( new ItemStack( this , 1 , dyeColor.getMetadata( ) ) , // + " E " , // + "GWG" , // + "BBB" , // + 'W' , new ItemStack( Blocks.WOOL , 1 , dyeColor.getMetadata( ) ) , // + 'B' , new ItemStack( this.woodType.block , 1 , this.woodType.metaData ) , // + 'G' , Items.GOLD_INGOT , // + 'E' , Items.EMERALD // + ); + GameRegistry.addShapelessRecipe( new ItemStack( this , 1 , dyeColor.getMetadata( ) ) , // + new ItemStack( this , 1 , 32767 ) , // + new ItemStack( Items.DYE , 1 , dyeColor.getDyeDamage( ) ) ); + } + + } + }