All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.entity.data.profession.Profession Maven / Gradle / Ivy

package cn.nukkit.entity.data.profession;

import cn.nukkit.api.PowerNukkitXInternal;
import cn.nukkit.nbt.tag.ListTag;
import cn.nukkit.nbt.tag.Tag;

import java.util.HashMap;

public abstract class Profession {

    private static final HashMap knownProfessions = new HashMap<>();

    public static void registerProfession(Profession profession) {
        knownProfessions.put(profession.getIndex(), profession);
    }

    public static HashMap getProfessions() {
        return (HashMap) knownProfessions.clone();
    }

    public static Profession getProfession(int index) {
        return knownProfessions.get(index);
    }

    private final int index;
    private final int blockid;
    private final String name;

    public Profession(int index, int blockid, String name) {
        this.index = index;
        this.blockid = blockid;
        this.name = name;
    }

    public ListTag buildTrades(int seed) {
        ListTag recipes = new ListTag<>("Recipes");
        return recipes;
    }

    @PowerNukkitXInternal
    public static void init() {
        registerProfession(new ProfessionFarmer());
        registerProfession(new ProfessionFisherman());
        registerProfession(new ProfessionShepherd());
        registerProfession(new ProfessionFletcher());
        registerProfession(new ProfessionLibrarian());
        registerProfession(new ProfessionCartographer());
        registerProfession(new ProfessionCleric());
        registerProfession(new ProfessionArmor());
        registerProfession(new ProfessionWeapon());
        registerProfession(new ProfessionTool());
        registerProfession(new ProfessionButcher());
        registerProfession(new ProfessionLeather());
        registerProfession(new ProfessionMason());
    }

    public int getBlockID() {
        return this.blockid;
    }

    public int getIndex() {
        return this.index;
    }

    public String getName() {
        return this.name;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy