Пример #1
0
        public ItemStack TryPlaceOn(ItemStack stack, BlockEntityAnvil beAnvil)
        {
            // Already occupied anvil
            if (beAnvil.WorkItemStack != null)
            {
                return(null);
            }

            if (stack.Attributes.HasAttribute("voxels"))
            {
                try
                {
                    beAnvil.Voxels           = BlockEntityAnvil.deserializeVoxels(stack.Attributes.GetBytes("voxels"));
                    beAnvil.SelectedRecipeId = stack.Attributes.GetInt("selectedRecipeId");
                }
                catch (Exception)
                {
                    CreateVoxelsFromIronBloom(ref beAnvil.Voxels);
                }
            }
            else
            {
                CreateVoxelsFromIronBloom(ref beAnvil.Voxels);
            }


            ItemStack workItemStack = stack.Clone();

            workItemStack.StackSize = 1;
            workItemStack.Collectible.SetTemperature(api.World, workItemStack, stack.Collectible.GetTemperature(api.World, stack));

            return(workItemStack.Clone());
        }
Пример #2
0
        public ItemStack TryPlaceOn(ItemStack stack, BlockEntityAnvil beAnvil)
        {
            try
            {
                beAnvil.Voxels           = BlockEntityAnvil.deserializeVoxels(stack.Attributes.GetBytes("voxels"));
                beAnvil.SelectedRecipeId = stack.Attributes.GetInt("selectedRecipeId");
            }
            catch (Exception)
            {
            }

            return(stack.Clone());
        }
Пример #3
0
 public static byte[,,] GetVoxels(ItemStack workitemStack)
 {
     return(BlockEntityAnvil.deserializeVoxels(workitemStack.Attributes.GetBytes("voxels")));
 }