Package etithespirit.orimod.spirit
Class SpiritIdentifier
java.lang.Object
etithespirit.orimod.spirit.SpiritIdentifier
This class manages the identification of spirits. It also stores which players are opting to use a spirit playermodel.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
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 tosetSpirit(Player, boolean)
, but this will send the appropriate network request for both sides.
-
Constructor Details
-
SpiritIdentifier
public SpiritIdentifier()
-
-
Method Details
-
isSpirit
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
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
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 tosetSpirit(Player, boolean)
, but this will send the appropriate network request for both sides.- Parameters:
player
- The player to change.isSpirit
- The new spirit state.
-