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 booleandoneprivate static Map<VillagerProfession,Identifier>GIFTSprivate longstartTimeprivate intticksLeftFields 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 voidfinishRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)private List<ItemStack>getGifts(VillagerEntity villager)private Optional<PlayerEntity>getNearestPlayerIfHero(VillagerEntity villager)private static intgetNextGiftDelay(ServerWorld world)private voidgiveGifts(VillagerEntity villager, LivingEntity recipient)private booleanisCloseEnough(VillagerEntity villager, PlayerEntity player)private booleanisHero(PlayerEntity player)private booleanisNearestPlayerHero(VillagerEntity villager)protected voidkeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)protected voidrun(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)protected booleanshouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)protected booleanshouldRun(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:
shouldRunin classTask<VillagerEntity>
-
run
- Overrides:
runin classTask<VillagerEntity>
-
shouldKeepRunning
protected boolean shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)- Overrides:
shouldKeepRunningin classTask<VillagerEntity>
-
keepRunning
- Overrides:
keepRunningin classTask<VillagerEntity>
-
finishRunning
- Overrides:
finishRunningin classTask<VillagerEntity>
-
giveGifts
-
getGifts
-
isNearestPlayerHero
-
getNearestPlayerIfHero
-
isHero
-
isCloseEnough
-
getNextGiftDelay
-