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