private void craftRecipe( Recipe<?> currentRecipe)
    {
        if (currentRecipe != null && this.canAcceptRecipeOutput(currentRecipe))
        {
            ItemStack inputStack = this.inventory.get(0);
            ItemStack outputStack = this.inventory.get(2);
            ItemStack recipeResultStack = currentRecipe.getOutput();
            int resultCount = world.random.nextInt(100) < dupeChance100 ? 2 : 1;
            if (outputStack.isEmpty())
            {
                ItemStack newResultStack = recipeResultStack.copy();
                newResultStack.setAmount(resultCount);
                this.inventory.set(2, newResultStack);
            }
            else if (outputStack.getItem() == recipeResultStack.getItem())
            {
                // TODO: WHAT HAPPENS IF FINAL COUNT IS 63 AND WE SMELT DOUBLE?
                outputStack.addAmount(resultCount);
            }
            if (!this.world.isClient)
                this.setLastRecipe(currentRecipe);
            if (inputStack.getItem() == Blocks.WET_SPONGE.getItem() && !((ItemStack) this.inventory.get(1)).isEmpty() && ((ItemStack) this.inventory.get(1)).getItem() == Items.BUCKET)
            {
                this.inventory.set(1, new ItemStack(Items.WATER_BUCKET));
            }
            inputStack.subtractAmount(1);
        }
    }
private void craftRecipe( Recipe<?> currentRecipe)
    {
        if (currentRecipe != null && this.canAcceptRecipeOutput(currentRecipe))
        {
            ItemStack inputStack = this.inventory.get(0);
            ItemStack outputStack = this.inventory.get(2);
            ItemStack recipeResultStack = currentRecipe.getOutput();
            int resultCount = world.random.nextInt(100) < dupeChance100 ? 2 : 1;
            if (outputStack.isEmpty())
            {
                ItemStack newResultStack = recipeResultStack.copy();
                newResultStack.setAmount(resultCount);
                this.inventory.set(2, newResultStack);
            }
            else if (outputStack.getItem() == recipeResultStack.getItem())
            {
               
                outputStack.addAmount(resultCount);
            }
            if (!this.world.isClient)
                this.setLastRecipe(currentRecipe);
            if (inputStack.getItem() == Blocks.WET_SPONGE.getItem() && !((ItemStack) this.inventory.get(1)).isEmpty() && ((ItemStack) this.inventory.get(1)).getItem() == Items.BUCKET)
            {
                this.inventory.set(1, new ItemStack(Items.WATER_BUCKET));
            }
            inputStack.subtractAmount(1);
        }
    }
private void craftrecipe( recipe<?> currentrecipe) { if (currentrecipe != null && this.canacceptrecipeoutput(currentrecipe)) { itemstack inputstack = this.inventory.get(0); itemstack outputstack = this.inventory.get(2); itemstack reciperesultstack = currentrecipe.getoutput(); int resultcount = world.random.nextint(100) < dupechance100 ? 2 : 1; if (outputstack.isempty()) { itemstack newresultstack = reciperesultstack.copy(); newresultstack.setamount(resultcount); this.inventory.set(2, newresultstack); } else if (outputstack.getitem() == reciperesultstack.getitem()) { outputstack.addamount(resultcount); } if (!this.world.isclient) this.setlastrecipe(currentrecipe); if (inputstack.getitem() == blocks.wet_sponge.getitem() && !((itemstack) this.inventory.get(1)).isempty() && ((itemstack) this.inventory.get(1)).getitem() == items.bucket) { this.inventory.set(1, new itemstack(items.water_bucket)); } inputstack.subtractamount(1); } }