Package tschipp.callablehorses.common
Class HorseManager
java.lang.Object
tschipp.callablehorses.common.HorseManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancallHorse(net.minecraft.world.entity.player.Player player) static booleancanCallHorse(net.minecraft.world.entity.player.Player player) static booleancanSetHorse(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.Entity entity) static voidclearHorse(@Nullable StoredHorseData horse) static @Nullable net.minecraft.world.entity.MobfindHorseWithStorageID(String id, net.minecraft.world.level.Level world) static voidprepDeadHorseForRespawning(net.minecraft.world.entity.Entity e) Clears everything the mount is carrying, and heals it back to full.static voidsaveHorse(net.minecraft.world.entity.Entity e) static voidsaveHorse(net.minecraft.world.entity.Entity e, boolean includeDying) static voidsetHorse(net.minecraft.world.entity.player.Player player) static booleanshouldSuppressDrops(net.minecraft.world.entity.LivingEntity entity) static voidshowHorseStats(net.minecraft.server.level.ServerPlayer player)
-
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
-
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 inEquipmentSlot.SADDLErather 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 byprepDeadHorseForRespawning(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)
-