Interface ICitizenSkillHandler

All Known Implementing Classes:
CitizenSkillHandler

public interface ICitizenSkillHandler
The interface for the citizen skill handler.
  • Method Details

    • init

      void init(int levelCap)
      Initiate a citizen skill handler with a level cap.
      Parameters:
      levelCap - the max level.
    • init

      void init(@NotNull @NotNull IColony colony, @Nullable @Nullable ICitizenData firstParent, @Nullable @Nullable ICitizenData secondParent, Random rand)
      Initiate a citizen with parent citizen data.
      Parameters:
      firstParent - the first parent data.
      secondParent - the second parent data.
      rand - random var.
    • write

      @NotNull @NotNull net.minecraft.nbt.CompoundTag write()
      Write the handler to NBT.
      Returns:
      the handler written to NBT.
    • read

      void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compoundNBT)
      Init the handler from NBT.
      Parameters:
      compoundNBT - the input nbt.
    • tryLevelUpIntelligence

      boolean tryLevelUpIntelligence(@NotNull @NotNull Random random, double customChance, @NotNull @NotNull ICitizenData citizen)
      Attempt an intelligence level up with a base chance.
      Parameters:
      random - the random var.
      customChance - the custom chance.
      citizen - the citizen that is trying to level up.
      Returns:
      true if leveled up.
    • getLevel

      int getLevel(@NotNull @NotNull Skill skill)
      Get the level for a certain skill.
      Parameters:
      skill - the skill.
      Returns:
      the level.
    • incrementLevel

      void incrementLevel(@NotNull @NotNull Skill skill, int level)
      Increment the level for a certain skill.
      Parameters:
      skill - the skill to increment.
      level - the quantity.
    • addXpToSkill

      void addXpToSkill(Skill skill, double xp, ICitizenData data)
      Add experience to a skill.
      Parameters:
      skill - the skill.
      xp - the xp to add.
      data - the citizen.
    • removeXpFromSkill

      void removeXpFromSkill(@NotNull @NotNull Skill skill, double xp, @NotNull @NotNull ICitizenData data)
      Remove xp from a skill.
      Parameters:
      skill - the skill to remove it from.
      xp - the qty of xp.
      data - the citizen.
    • levelUp

      void levelUp(ICitizenData data)
      Level-up actions for the citizen, increases levels and notifies the Citizen's Job
      Parameters:
      data - the citizen to level up.
    • getTotalXP

      double getTotalXP()
      Get the total xp that the citizen has.
      Returns:
      the total xp.
    • getSkills

      Get a copy of the map of skills.
      Returns:
      the skills.