public class GiveGiftsToHeroTask extends Task<VillagerEntity>
Task.Status
Modifier and Type | Field and Description |
---|---|
private boolean |
done |
private static Map<VillagerProfession,Identifier> |
GIFTS |
private long |
startTime |
private int |
ticksLeft |
requiredMemoryStates
Constructor and Description |
---|
GiveGiftsToHeroTask(int delay) |
Modifier and Type | Method and 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) |
getStatus, isTimeLimitExceeded, stop, tick, toString, tryStarting
private static final Map<VillagerProfession,Identifier> GIFTS
private int ticksLeft
private boolean done
private long startTime
protected boolean shouldRun(ServerWorld serverWorld, VillagerEntity villagerEntity)
shouldRun
in class Task<VillagerEntity>
protected void run(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
run
in class Task<VillagerEntity>
protected boolean shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
shouldKeepRunning
in class Task<VillagerEntity>
protected void keepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
keepRunning
in class Task<VillagerEntity>
protected void finishRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
finishRunning
in class Task<VillagerEntity>
private void giveGifts(VillagerEntity villager, LivingEntity recipient)
private List<ItemStack> getGifts(VillagerEntity villager)
private boolean isNearestPlayerHero(VillagerEntity villager)
private Optional<PlayerEntity> getNearestPlayerIfHero(VillagerEntity villager)
private boolean isHero(PlayerEntity player)
private boolean isCloseEnough(VillagerEntity villager, PlayerEntity player)
private static int getNextGiftDelay(ServerWorld world)