Beispiel #1
0
        public override ItemStack OnPickBlock(IWorldAccessor world, BlockPos pos)
        {
            ItemStack stack = base.OnPickBlock(world, pos);

            BlockEntityMeal bem = world.BlockAccessor.GetBlockEntity(pos) as BlockEntityMeal;

            if (bem != null)
            {
                SetContents(bem.RecipeCode, stack, bem.GetNonEmptyContentStacks(), bem.QuantityServings);
            }

            return(stack);
        }
Beispiel #2
0
        public override int GetRandomColor(ICoreClientAPI capi, BlockPos pos, BlockFacing facing)
        {
            BlockEntityMeal bem = capi.World.BlockAccessor.GetBlockEntity(pos) as BlockEntityMeal;

            if (bem == null)
            {
                return(base.GetRandomColor(capi, pos, facing));
            }

            ItemStack[] stacks = bem.GetNonEmptyContentStacks(false);

            return(GetRandomBlockColor(capi, stacks));
        }