Class HorseManager

java.lang.Object
tschipp.callablehorses.common.HorseManager

public class HorseManager extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    callHorse(net.minecraft.world.entity.player.Player player)
     
    static boolean
    canCallHorse(net.minecraft.world.entity.player.Player player)
     
    static boolean
    canSetHorse(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.Entity entity)
     
    static void
    clearHorse(@Nullable StoredHorseData horse)
     
    static @Nullable net.minecraft.world.entity.Mob
    findHorseWithStorageID(String id, net.minecraft.world.level.Level world)
     
    static void
    prepDeadHorseForRespawning(net.minecraft.world.entity.Entity e)
    Clears everything the mount is carrying, and heals it back to full.
    static void
    saveHorse(net.minecraft.world.entity.Entity e)
     
    static void
    saveHorse(net.minecraft.world.entity.Entity e, boolean includeDying)
     
    static void
    setHorse(net.minecraft.world.entity.player.Player player)
     
    static boolean
    shouldSuppressDrops(net.minecraft.world.entity.LivingEntity entity)
     
    static void
    showHorseStats(net.minecraft.server.level.ServerPlayer player)
     

    Methods inherited from class java.lang.Object

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

    • HorseManager

      public HorseManager()
  • Method Details

    • callHorse

      public static boolean callHorse(net.minecraft.world.entity.player.Player player)
    • setHorse

      public static void setHorse(net.minecraft.world.entity.player.Player player)
    • showHorseStats

      public static void showHorseStats(net.minecraft.server.level.ServerPlayer player)
    • clearHorse

      public static void clearHorse(@Nullable @Nullable StoredHorseData horse)
    • findHorseWithStorageID

      @Nullable public static @Nullable net.minecraft.world.entity.Mob findHorseWithStorageID(String id, net.minecraft.world.level.Level world)
    • prepDeadHorseForRespawning

      public static void prepDeadHorseForRespawning(net.minecraft.world.entity.Entity e)
      Clears everything the mount is carrying, and heals it back to full. Every slot is reachable through the entity API now that saddles live in EquipmentSlot.SADDLE rather than in synched data, so vanilla is always left to drop the gear and the stored copy is always emptied. The item exists exactly once afterwards.
    • canCallHorse

      public static boolean canCallHorse(net.minecraft.world.entity.player.Player player)
    • canSetHorse

      public static boolean canSetHorse(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.Entity entity)
    • saveHorse

      public static void saveHorse(net.minecraft.world.entity.Entity e)
    • saveHorse

      public static void saveHorse(net.minecraft.world.entity.Entity e, boolean includeDying)
      Parameters:
      includeDying - store the mount even though it is already dying. Only the death handler passes true: the copy it rebuilds is healed by prepDeadHorseForRespawning(net.minecraft.world.entity.Entity) anyway, and for a mount whose drops are suppressed the stored snapshot is the only surviving record of what it was carrying when it died. Everything else must keep the guard, or an ordinary chunk unload during the death tick would store a dead copy.
    • shouldSuppressDrops

      public static boolean shouldSuppressDrops(net.minecraft.world.entity.LivingEntity entity)