Class GiveGiftsToHeroTask
java.lang.Object
net.minecraft.entity.ai.brain.task.Task<VillagerEntity>
net.minecraft.entity.ai.brain.task.GiveGiftsToHeroTask
public class GiveGiftsToHeroTask extends Task<VillagerEntity>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.ai.brain.task.Task
Task.Status
-
Field Summary
Fields Modifier and Type Field Description private boolean
done
private static Map<VillagerProfession,Identifier>
GIFTS
private long
startTime
private int
ticksLeft
Fields inherited from class net.minecraft.entity.ai.brain.task.Task
requiredMemoryStates
-
Constructor Summary
Constructors Constructor Description GiveGiftsToHeroTask(int delay)
-
Method Summary
Modifier and Type Method Description protected void
finishRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
private List<ItemStack>
getGifts(VillagerEntity villager)
private Optional<PlayerEntity>
getNearestPlayerIfHero(VillagerEntity villager)
private static int
getNextGiftDelay(ServerWorld world)
private void
giveGifts(VillagerEntity villager, LivingEntity recipient)
private boolean
isCloseEnough(VillagerEntity villager, PlayerEntity player)
private boolean
isHero(PlayerEntity player)
private boolean
isNearestPlayerHero(VillagerEntity villager)
protected void
keepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
protected void
run(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
protected boolean
shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
protected boolean
shouldRun(ServerWorld serverWorld, VillagerEntity villagerEntity)
Methods inherited from class net.minecraft.entity.ai.brain.task.Task
getStatus, isTimeLimitExceeded, stop, tick, toString, tryStarting
-
Field Details
-
GIFTS
-
ticksLeft
private int ticksLeft -
done
private boolean done -
startTime
private long startTime
-
-
Constructor Details
-
GiveGiftsToHeroTask
public GiveGiftsToHeroTask(int delay)
-
-
Method Details
-
shouldRun
- Overrides:
shouldRun
in classTask<VillagerEntity>
-
run
- Overrides:
run
in classTask<VillagerEntity>
-
shouldKeepRunning
protected boolean shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)- Overrides:
shouldKeepRunning
in classTask<VillagerEntity>
-
keepRunning
- Overrides:
keepRunning
in classTask<VillagerEntity>
-
finishRunning
- Overrides:
finishRunning
in classTask<VillagerEntity>
-
giveGifts
-
getGifts
-
isNearestPlayerHero
-
getNearestPlayerIfHero
-
isHero
-
isCloseEnough
-
getNextGiftDelay
-