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
    canClearCarriedItems(net.minecraft.world.entity.Entity e)
    Whether everything this mount carries can be stripped off it through the entity API.
    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 whatever vanilla is about to drop, and heals the mount 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
    shouldSuppressAllDeathLoot(net.minecraft.world.entity.LivingEntity entity)
     
    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)
    • canClearCarriedItems

      public static boolean canClearCarriedItems(net.minecraft.world.entity.Entity e)
      Whether everything this mount carries can be stripped off it through the entity API. This one predicate decides the whole death policy. True means the copy can be emptied, so letting vanilla drop the gear is safe and the two halves agree. False means some of it cannot be reached - a Saddleable mount keeps its saddle in synched data with no un-equip method, for one - so nothing may drop and the copy is left whole instead. Either way the item exists exactly once afterwards.
    • prepDeadHorseForRespawning

      public static void prepDeadHorseForRespawning(net.minecraft.world.entity.Entity e)
      Clears whatever vanilla is about to drop, and heals the mount back to full.
    • 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)
    • shouldSuppressAllDeathLoot

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