Jump to content

Recommended Posts

Posted

On line 12 it says "; expected" and I know what that means but can't for the life of me find where it is expected. I have made sure all braces are closed. Code is below

 

package com.chunk.tutorialmod.tools;

import com.chunk.tutorialmod.util.RegistryHandler;
import net.minecraft.item.IItemTier;
import net.minecraft.item.crafting.Ingredient;

import java.util.function.Supplier;

public enum ModItemTier implements IItemTier
{
    CHUNGITE(4, 3122, 10.0f, 12, () -> {
        return Ingredient.fromItems(RegistryHandler.CHUNGITE.get())
    });

    private final int harvestLevel;
    private final int maxUses;
    private final float efficiency;
    private final float attackDamage;
    private final int enchantability;
    private final Supplier<Ingredient> repairMaterial;

    ModItemTier(int harvestLevel, int maxUses, float efficiency, float attackDamage, int enchantability, Supplier<Ingredient> repairMaterial)
    {
        this.harvestLevel = harvestLevel;
        this.maxUses = maxUses;
        this.efficiency = efficiency;
        this.attackDamage = attackDamage;
        this.enchantability = enchantability;
        this.repairMaterial = repairMaterial;
    }


    @Override
    public int getMaxUses() {
        return maxUses;
    }

    @Override
    public float getEfficiency() {
        return efficiency;
    }

    @Override
    public float getAttackDamage() {
        return attackDamage;
    }

    @Override
    public int getHarvestLevel() {
        return harvestLevel;
    }

    @Override
    public int getEnchantability() {
        return enchantability;
    }

    @Override
    public Ingredient getRepairMaterial() {
        return repairMaterial.get();
    }
}

 

 

ModItemTier.javaFetching info...

Posted

First time using lambda's. Any idea how this would be solved as the whole statement results in an error stating "Int is not a functional interface"

 

    SAPPHIRE(4, 3122, 10.0f, 12, () -> {
        return Ingredient.fromItems(RegistryHandler.SAPPHIRE.get());
});
Posted

The arguments here

  On 9/10/2020 at 9:18 PM, chunkertown said:

CHUNGITE(4, 3122, 10.0f, 12, () -> { return Ingredient.fromItems(RegistryHandler.CHUNGITE.get()) });

Expand  

don't match the parameters here:

  On 9/10/2020 at 9:18 PM, chunkertown said:

ModItemTier(int harvestLevel, int maxUses, float efficiency, float attackDamage, int enchantability, Supplier<Ingredient> repairMaterial)

Expand  

Try to add the missing float or remove the argument from the constuctor.

Posted

Threads merged

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.