Class FeedAnimalsTicker
java.lang.Object
com.hammy275.immersivemc.common.ticker.AbstractTicker
com.hammy275.immersivemc.server.ticker.FeedAnimalsTicker
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<net.minecraft.world.entity.animal.Animal> getLivingNearby(net.minecraft.world.entity.player.Player player) static net.minecraft.world.phys.AABBgetMouthHitbox(net.minecraft.world.entity.LivingEntity entity) protected booleanshouldTick(net.minecraft.world.entity.player.Player player, org.vivecraft.api.data.VRPose pose, org.vivecraft.api.data.VRPoseHistory poseHistory) Method that checks if the action should be performed (usually).protected voidtick(net.minecraft.world.entity.player.Player player, org.vivecraft.api.data.VRPose pose, org.vivecraft.api.data.VRPoseHistory poseHistory) Tick method that performs some action (usually).Methods inherited from class AbstractTicker
doTick, onPlayerDisconnect, setCooldown
-
Field Details
-
COOLDOWN_TICKS
public static final int COOLDOWN_TICKS- See Also:
-
-
Constructor Details
-
FeedAnimalsTicker
public FeedAnimalsTicker()
-
-
Method Details
-
tick
protected void tick(net.minecraft.world.entity.player.Player player, org.vivecraft.api.data.VRPose pose, org.vivecraft.api.data.VRPoseHistory poseHistory) Description copied from class:AbstractTickerTick method that performs some action (usually). Called for each player on each tick when the player is not on cooldown andAbstractTicker.shouldTick(Player, VRPose, VRPoseHistory)returns true.- Specified by:
tickin classAbstractTicker- Parameters:
player- The player running for this ticker.pose- The player's pose in VR.poseHistory- The player's pose history in VR.
-
shouldTick
protected boolean shouldTick(net.minecraft.world.entity.player.Player player, org.vivecraft.api.data.VRPose pose, org.vivecraft.api.data.VRPoseHistory poseHistory) Description copied from class:AbstractTickerMethod that checks if the action should be performed (usually). Called for each player on each tick when the player is not on cooldown.- Specified by:
shouldTickin classAbstractTicker- Parameters:
player- The player running for this ticker.pose- The player's pose in VR.poseHistory- The player's pose history in VR.- Returns:
- Whether the
AbstractTicker.tick(Player, VRPose, VRPoseHistory)method should be run for the player.
-
getMouthHitbox
public static net.minecraft.world.phys.AABB getMouthHitbox(net.minecraft.world.entity.LivingEntity entity) -
getLivingNearby
public static List<net.minecraft.world.entity.animal.Animal> getLivingNearby(net.minecraft.world.entity.player.Player player)
-