public class GiveHeroGiftsTask extends Task<VillagerEntity>
Task.Status
Modifier and Type | Field and Description |
---|---|
private int |
cooldown |
private boolean |
done |
private static java.util.Map<VillagerProfession,ResourceLocation> |
GIFTS |
private long |
startTime |
Constructor and Description |
---|
GiveHeroGiftsTask(int p_i50366_1_) |
Modifier and Type | Method and Description |
---|---|
private java.util.List<ItemStack> |
getGifts(VillagerEntity p_220399_1_) |
private java.util.Optional<PlayerEntity> |
getNearestPlayer(VillagerEntity p_220400_1_) |
private static int |
getNextCooldown(ServerWorld p_220397_0_) |
private void |
giveGifts(VillagerEntity p_220398_1_,
LivingEntity p_220398_2_) |
private boolean |
hasNearestPlayer(VillagerEntity p_220396_1_) |
private boolean |
isCloseEnough(VillagerEntity p_220401_1_,
PlayerEntity p_220401_2_) |
private boolean |
isHero(PlayerEntity p_220402_1_) |
protected void |
resetTask(ServerWorld worldIn,
VillagerEntity entityIn,
long gameTimeIn) |
protected boolean |
shouldContinueExecuting(ServerWorld worldIn,
VillagerEntity entityIn,
long gameTimeIn) |
protected boolean |
shouldExecute(ServerWorld worldIn,
VillagerEntity owner) |
protected void |
startExecuting(ServerWorld worldIn,
VillagerEntity entityIn,
long gameTimeIn) |
protected void |
updateTask(ServerWorld worldIn,
VillagerEntity owner,
long gameTime) |
private static final java.util.Map<VillagerProfession,ResourceLocation> GIFTS
private int cooldown
private boolean done
private long startTime
protected boolean shouldExecute(ServerWorld worldIn, VillagerEntity owner)
shouldExecute
in class Task<VillagerEntity>
protected void startExecuting(ServerWorld worldIn, VillagerEntity entityIn, long gameTimeIn)
startExecuting
in class Task<VillagerEntity>
protected boolean shouldContinueExecuting(ServerWorld worldIn, VillagerEntity entityIn, long gameTimeIn)
shouldContinueExecuting
in class Task<VillagerEntity>
protected void updateTask(ServerWorld worldIn, VillagerEntity owner, long gameTime)
updateTask
in class Task<VillagerEntity>
protected void resetTask(ServerWorld worldIn, VillagerEntity entityIn, long gameTimeIn)
resetTask
in class Task<VillagerEntity>
private void giveGifts(VillagerEntity p_220398_1_, LivingEntity p_220398_2_)
private java.util.List<ItemStack> getGifts(VillagerEntity p_220399_1_)
private boolean hasNearestPlayer(VillagerEntity p_220396_1_)
private java.util.Optional<PlayerEntity> getNearestPlayer(VillagerEntity p_220400_1_)
private boolean isHero(PlayerEntity p_220402_1_)
private boolean isCloseEnough(VillagerEntity p_220401_1_, PlayerEntity p_220401_2_)
private static int getNextCooldown(ServerWorld p_220397_0_)