Interface ICognitiveInducerMarks

All Known Implementing Classes:
CognitiveInducerMarksImpl

public interface ICognitiveInducerMarks
Capability to be attached to Villagers marked by the Cognitive Inducer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraftforge.common.capabilities.Capability<ICognitiveInducerMarks>
     
    static final net.minecraft.resources.ResourceLocation
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a sorted set of all marks.
    void
    mark(long gameTime)
    Marks the villager indicating that a cognitive inducer tried to take an impression.
    void
    pruneMarks(long gameTime)
    Prunes any marks older than the configured retention time.
    static void
    with(net.minecraft.world.entity.npc.Villager villager, net.minecraftforge.common.util.NonNullConsumer<ICognitiveInducerMarks> consumer)
    Passes the ICognitiveInducerMarks capability for the given Villager to the consumer.
    static <T> T
    withF(net.minecraft.world.entity.npc.Villager villager, net.minecraftforge.common.util.NonNullFunction<ICognitiveInducerMarks,T> func)
    Calls func with the ICognitiveInducerMarks capability for the given Villager.
  • Field Details

    • CAPABILITY

      static final net.minecraftforge.common.capabilities.Capability<ICognitiveInducerMarks> CAPABILITY
    • ID

      static final net.minecraft.resources.ResourceLocation ID
  • Method Details

    • with

      static void with(net.minecraft.world.entity.npc.Villager villager, net.minecraftforge.common.util.NonNullConsumer<ICognitiveInducerMarks> consumer)
      Passes the ICognitiveInducerMarks capability for the given Villager to the consumer.

      Note: In practice, the capability will always be present as it is attached unconditionally in CapabilityEventHandler.

    • withF

      static <T> T withF(net.minecraft.world.entity.npc.Villager villager, net.minecraftforge.common.util.NonNullFunction<ICognitiveInducerMarks,T> func)
      Calls func with the ICognitiveInducerMarks capability for the given Villager.

      Note: In practice, the capability will always be present as it is attached unconditionally in CapabilityEventHandler.

    • mark

      void mark(long gameTime)
      Marks the villager indicating that a cognitive inducer tried to take an impression.
      Parameters:
      gameTime - The current game time as per `Level.getGameTime()`
    • getMarks

      SortedSet<Long> getMarks()
      Returns a sorted set of all marks.
    • pruneMarks

      void pruneMarks(long gameTime)
      Prunes any marks older than the configured retention time.
      Parameters:
      gameTime - The current game time as per `Level.getGameTime()`