Class EnchanterStationsModule

java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.EnchanterStationsModule
All Implemented Interfaces:
IBuildingEventsModule, IBuildingModule, IPersistentModule, IHasDirty

public class EnchanterStationsModule extends AbstractBuildingModule implements IBuildingModule, IPersistentModule, IBuildingEventsModule
The enchanters station selection module.
  • Constructor Details

    • EnchanterStationsModule

      public EnchanterStationsModule()
  • Method Details

    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Deserialize the module.
      Specified by:
      deserializeNBT in interface IPersistentModule
      Parameters:
      compound - the nbt compound.
    • serializeNBT

      public void serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Serialize the module from a compound.
      Specified by:
      serializeNBT in interface IPersistentModule
      Parameters:
      compound - the compound.
    • serializeToView

      public void serializeToView(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf)
      Description copied from interface: IBuildingModule
      Serialization method to send the module data to the client side.
      Specified by:
      serializeToView in interface IBuildingModule
      Parameters:
      buf - the buffer to write it to.
    • getBuildingsToGatherFrom

      public Set<net.minecraft.core.BlockPos> getBuildingsToGatherFrom()
      Return the set of the buildings to gather from.
      Returns:
      a copy of th eset.
    • getRandomBuildingToDrainFrom

      @Nullable public @Nullable net.minecraft.core.BlockPos getRandomBuildingToDrainFrom()
      Get a random worker building id to gather xp from.
      Returns:
      the unique pos id of it.
    • setAsGathered

      public void setAsGathered(net.minecraft.core.BlockPos pos)
      Set the building as gathered.
      Parameters:
      pos - the pos of the building.
    • addWorker

      public void addWorker(net.minecraft.core.BlockPos blockPos)
      Add a new worker to gather xp from.
      Parameters:
      blockPos - the pos of the building.
    • removeWorker

      public void removeWorker(net.minecraft.core.BlockPos blockPos)
      Remove a worker to stop gathering from.
      Parameters:
      blockPos - the pos of that worker.
    • onWakeUp

      public void onWakeUp()
      Description copied from interface: IBuildingEventsModule
      Specific wakeup hook in modules.
      Specified by:
      onWakeUp in interface IBuildingEventsModule