Throne - Recipes

Base recipe + dyeing recipe
This commit is contained in:
Emmanuel BENOîT 2016-07-04 17:37:53 +02:00
parent 510ecab1ac
commit cab22724ea

View file

@ -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( ) ) );
}
}
}