Class GiveHeroGiftsTask
- java.lang.Object
-
- net.minecraft.entity.ai.brain.task.Task<VillagerEntity>
-
- net.minecraft.entity.ai.brain.task.GiveHeroGiftsTask
-
public class GiveHeroGiftsTask 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
giftGivenDuringThisRun
private static java.util.Map<VillagerProfession,ResourceLocation>
gifts
private long
timeSinceStart
private int
timeUntilNextGift
-
Fields inherited from class net.minecraft.entity.ai.brain.task.Task
entryCondition
-
-
Constructor Summary
Constructors Constructor Description GiveHeroGiftsTask(int p_i50366_1_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
calculateTimeUntilNextGift(ServerWorld p_220397_0_)
protected boolean
canStillUse(ServerWorld p_212834_1_, VillagerEntity p_212834_2_, long p_212834_3_)
protected boolean
checkExtraStartConditions(ServerWorld p_212832_1_, VillagerEntity p_212832_2_)
private java.util.List<ItemStack>
getItemToThrow(VillagerEntity p_220399_1_)
private java.util.Optional<PlayerEntity>
getNearestTargetableHero(VillagerEntity p_220400_1_)
private boolean
isHero(PlayerEntity p_220402_1_)
private boolean
isHeroVisible(VillagerEntity p_220396_1_)
private boolean
isWithinThrowingDistance(VillagerEntity p_220401_1_, PlayerEntity p_220401_2_)
protected void
start(ServerWorld p_212831_1_, VillagerEntity p_212831_2_, long p_212831_3_)
protected void
stop(ServerWorld p_212835_1_, VillagerEntity p_212835_2_, long p_212835_3_)
private void
throwGift(VillagerEntity p_220398_1_, LivingEntity p_220398_2_)
protected void
tick(ServerWorld p_212833_1_, VillagerEntity p_212833_2_, long p_212833_3_)
-
-
-
Field Detail
-
gifts
private static final java.util.Map<VillagerProfession,ResourceLocation> gifts
-
timeUntilNextGift
private int timeUntilNextGift
-
giftGivenDuringThisRun
private boolean giftGivenDuringThisRun
-
timeSinceStart
private long timeSinceStart
-
-
Method Detail
-
checkExtraStartConditions
protected boolean checkExtraStartConditions(ServerWorld p_212832_1_, VillagerEntity p_212832_2_)
- Overrides:
checkExtraStartConditions
in classTask<VillagerEntity>
-
start
protected void start(ServerWorld p_212831_1_, VillagerEntity p_212831_2_, long p_212831_3_)
- Overrides:
start
in classTask<VillagerEntity>
-
canStillUse
protected boolean canStillUse(ServerWorld p_212834_1_, VillagerEntity p_212834_2_, long p_212834_3_)
- Overrides:
canStillUse
in classTask<VillagerEntity>
-
tick
protected void tick(ServerWorld p_212833_1_, VillagerEntity p_212833_2_, long p_212833_3_)
- Overrides:
tick
in classTask<VillagerEntity>
-
stop
protected void stop(ServerWorld p_212835_1_, VillagerEntity p_212835_2_, long p_212835_3_)
- Overrides:
stop
in classTask<VillagerEntity>
-
throwGift
private void throwGift(VillagerEntity p_220398_1_, LivingEntity p_220398_2_)
-
getItemToThrow
private java.util.List<ItemStack> getItemToThrow(VillagerEntity p_220399_1_)
-
isHeroVisible
private boolean isHeroVisible(VillagerEntity p_220396_1_)
-
getNearestTargetableHero
private java.util.Optional<PlayerEntity> getNearestTargetableHero(VillagerEntity p_220400_1_)
-
isHero
private boolean isHero(PlayerEntity p_220402_1_)
-
isWithinThrowingDistance
private boolean isWithinThrowingDistance(VillagerEntity p_220401_1_, PlayerEntity p_220401_2_)
-
calculateTimeUntilNextGift
private static int calculateTimeUntilNextGift(ServerWorld p_220397_0_)
-
-