Class JobEnchanter

All Implemented Interfaces:
IJob<EntityAIWorkEnchanter>, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class JobEnchanter extends AbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter>
  • Constructor Details

    • JobEnchanter

      public JobEnchanter(ICitizenData entity)
      Initialize citizen data.
      Parameters:
      entity - the citizen data.
  • Method Details

    • getModel

      @NotNull public @NotNull net.minecraft.resources.ResourceLocation getModel()
      Get the RenderBipedCitizen.Model to use when the Citizen performs this job role.
      Specified by:
      getModel in interface IJob<EntityAIWorkEnchanter>
      Overrides:
      getModel in class AbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter>
      Returns:
      Model of the citizen.
    • generateAI

      public EntityAIWorkEnchanter generateAI()
      Description copied from interface: IJob
      Generate your AI class to register.

      Suppressing Sonar Rule squid:S1452 This rule does "Generic wildcard types should not be used in return parameters" But in this case the rule does not apply because We are fine with all AbstractJob implementations and need generics only for java

      Returns:
      your personal AI instance.
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      deserializeNBT in class AbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter>
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      serializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      serializeNBT in class AbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter>
    • setBuildingToDrainFrom

      public void setBuildingToDrainFrom(net.minecraft.core.BlockPos pos)
      Set the building the worker is currently draining.
      Parameters:
      pos - the pos of the building to drain.
    • getPosToDrainFrom

      public net.minecraft.core.BlockPos getPosToDrainFrom()
      Get the current set pos to drain from.
      Returns:
      the pos.
    • incrementWaitingTicks

      public boolean incrementWaitingTicks()
      Increment the waiting ticks.
      Returns:
      false if limit reached.
    • playSound

      public void playSound(net.minecraft.core.BlockPos blockPos, EntityCitizen worker)
      Description copied from class: AbstractJobCrafter
      Play a job specific work sound at a pos.
      Overrides:
      playSound in class AbstractJobCrafter<EntityAIWorkEnchanter,JobEnchanter>
      Parameters:
      blockPos - the pos to play it at.
      worker - the worker to play it for.