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