Class SpiritIdentifier

java.lang.Object
etithespirit.orimod.spirit.SpiritIdentifier

public final class SpiritIdentifier extends Object
This class manages the identification of spirits. It also stores which players are opting to use a spirit playermodel.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Returns whether or not the given UUID classifies as a spirit.
    static boolean
    isSpirit(net.minecraft.world.entity.Entity entity)
    Returns whether or not the given entity classifies as a spirit.
    static void
    setSpirit(UUID playerID, boolean isSpirit)
    Tells the system that the given player does (not) want to be a spirit.
    static void
    setSpirit(net.minecraft.world.entity.player.Player player, boolean isSpirit)
    Tells the system that the given player does (not) want to be a spirit.
    static void
    setSpiritNetworked(net.minecraft.world.entity.player.Player player, boolean isSpirit)
    Identical to setSpirit(Player, boolean), but this will send the appropriate network request for both sides.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpiritIdentifier

      public SpiritIdentifier()
  • Method Details

    • isSpirit

      @NetworkReplicated public static boolean isSpirit(net.minecraft.world.entity.Entity entity)
      Returns whether or not the given entity classifies as a spirit.
      Parameters:
      entity - The entity to test.
      Returns:
      True if the entity is either an instance of the Spirit mob, or is a player who has elected to use the spirit playermodel.
    • isSpirit

      @NetworkReplicated public static boolean isSpirit(UUID id)
      Returns whether or not the given UUID classifies as a spirit.
      Parameters:
      id - The UUID to test.
      Returns:
      True if the entity is either an instance of the Spirit mob, or is a player who has elected to use the spirit playermodel.
    • setSpirit

      @NotNetworkReplicated public static void setSpirit(net.minecraft.world.entity.player.Player player, boolean isSpirit)
      Tells the system that the given player does (not) want to be a spirit.
      Parameters:
      player - The player to change.
      isSpirit - The new state, whether or not they are a spirit.
    • setSpirit

      @NotNetworkReplicated public static void setSpirit(UUID playerID, boolean isSpirit)
      Tells the system that the given player does (not) want to be a spirit.
      Parameters:
      playerID - The UUID of the player to change.
      isSpirit - The new state, whether or not they are a spirit.
    • setSpiritNetworked

      @NetworkReplicated public static void setSpiritNetworked(net.minecraft.world.entity.player.Player player, boolean isSpirit)
      Identical to setSpirit(Player, boolean), but this will send the appropriate network request for both sides.
      Parameters:
      player - The player to change.
      isSpirit - The new spirit state.