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>
- Mappings:
Namespace Name official atyintermediary net/minecraft/class_4243named net/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask
-
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
- Mappings:
Namespace Name Mixin selector official bLaty;b:Ljava/util/Map;intermediary field_18984Lnet/minecraft/class_4243;field_18984:Ljava/util/Map;named GIFTSLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;GIFTS:Ljava/util/Map;
-
ticksLeft
private int ticksLeft- Mappings:
Namespace Name Mixin selector official cLaty;c:Iintermediary field_18985Lnet/minecraft/class_4243;field_18985:Inamed ticksLeftLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;ticksLeft:I
-
done
private boolean done- Mappings:
Namespace Name Mixin selector official dLaty;d:Zintermediary field_18986Lnet/minecraft/class_4243;field_18986:Znamed doneLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;done:Z
-
startTime
private long startTime- Mappings:
Namespace Name Mixin selector official eLaty;e:Jintermediary field_18987Lnet/minecraft/class_4243;field_18987:Jnamed startTimeLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;startTime:J
-
-
Constructor Details
-
GiveGiftsToHeroTask
public GiveGiftsToHeroTask(int delay)- Mappings:
Namespace Name Mixin selector official <init>Laty;<init>(I)Vintermediary <init>Lnet/minecraft/class_4243;<init>(I)Vnamed <init>Lnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;<init>(I)V
-
-
Method Details
-
shouldRun
- Overrides:
shouldRunin classTask<VillagerEntity>- Mappings:
Namespace Name Mixin selector official aLaty;a(Labf;Lbhs;)Zintermediary method_19962Lnet/minecraft/class_4243;method_19962(Lnet/minecraft/class_3218;Lnet/minecraft/class_1646;)Znamed shouldRunLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;shouldRun(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/passive/VillagerEntity;)Z
-
run
- Overrides:
runin classTask<VillagerEntity>- Mappings:
Namespace Name Mixin selector official aLaty;a(Labf;Lbhs;J)Vintermediary method_19963Lnet/minecraft/class_4243;method_19963(Lnet/minecraft/class_3218;Lnet/minecraft/class_1646;J)Vnamed runLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;run(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/passive/VillagerEntity;J)V
-
shouldKeepRunning
protected boolean shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)- Overrides:
shouldKeepRunningin classTask<VillagerEntity>- Mappings:
Namespace Name Mixin selector official bLaty;b(Labf;Lbhs;J)Zintermediary method_19965Lnet/minecraft/class_4243;method_19965(Lnet/minecraft/class_3218;Lnet/minecraft/class_1646;J)Znamed shouldKeepRunningLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;shouldKeepRunning(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/passive/VillagerEntity;J)Z
-
keepRunning
- Overrides:
keepRunningin classTask<VillagerEntity>- Mappings:
Namespace Name Mixin selector official cLaty;c(Labf;Lbhs;J)Vintermediary method_19967Lnet/minecraft/class_4243;method_19967(Lnet/minecraft/class_3218;Lnet/minecraft/class_1646;J)Vnamed keepRunningLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;keepRunning(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/passive/VillagerEntity;J)V
-
finishRunning
- Overrides:
finishRunningin classTask<VillagerEntity>- Mappings:
Namespace Name Mixin selector official dLaty;d(Labf;Lbhs;J)Vintermediary method_19968Lnet/minecraft/class_4243;method_19968(Lnet/minecraft/class_3218;Lnet/minecraft/class_1646;J)Vnamed finishRunningLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;finishRunning(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/passive/VillagerEntity;J)V
-
giveGifts
- Mappings:
Namespace Name Mixin selector official aLaty;a(Lbhs;Lasb;)Vintermediary method_19957Lnet/minecraft/class_4243;method_19957(Lnet/minecraft/class_1646;Lnet/minecraft/class_1309;)Vnamed giveGiftsLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;giveGifts(Lnet/minecraft/entity/passive/VillagerEntity;Lnet/minecraft/entity/LivingEntity;)V
-
getGifts
- Mappings:
Namespace Name Mixin selector official aLaty;a(Lbhs;)Ljava/util/List;intermediary method_19956Lnet/minecraft/class_4243;method_19956(Lnet/minecraft/class_1646;)Ljava/util/List;named getGiftsLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;getGifts(Lnet/minecraft/entity/passive/VillagerEntity;)Ljava/util/List;
-
isNearestPlayerHero
- Mappings:
Namespace Name Mixin selector official bLaty;b(Lbhs;)Zintermediary method_19964Lnet/minecraft/class_4243;method_19964(Lnet/minecraft/class_1646;)Znamed isNearestPlayerHeroLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;isNearestPlayerHero(Lnet/minecraft/entity/passive/VillagerEntity;)Z
-
getNearestPlayerIfHero
- Mappings:
Namespace Name Mixin selector official cLaty;c(Lbhs;)Ljava/util/Optional;intermediary method_19966Lnet/minecraft/class_4243;method_19966(Lnet/minecraft/class_1646;)Ljava/util/Optional;named getNearestPlayerIfHeroLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;getNearestPlayerIfHero(Lnet/minecraft/entity/passive/VillagerEntity;)Ljava/util/Optional;
-
isHero
- Mappings:
Namespace Name Mixin selector official aLaty;a(Lbif;)Zintermediary method_19959Lnet/minecraft/class_4243;method_19959(Lnet/minecraft/class_1657;)Znamed isHeroLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;isHero(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
isCloseEnough
- Mappings:
Namespace Name Mixin selector official aLaty;a(Lbhs;Lbif;)Zintermediary method_19958Lnet/minecraft/class_4243;method_19958(Lnet/minecraft/class_1646;Lnet/minecraft/class_1657;)Znamed isCloseEnoughLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;isCloseEnough(Lnet/minecraft/entity/passive/VillagerEntity;Lnet/minecraft/entity/player/PlayerEntity;)Z
-
getNextGiftDelay
- Mappings:
Namespace Name Mixin selector official aLaty;a(Labf;)Iintermediary method_19961Lnet/minecraft/class_4243;method_19961(Lnet/minecraft/class_3218;)Inamed getNextGiftDelayLnet/minecraft/entity/ai/brain/task/GiveGiftsToHeroTask;getNextGiftDelay(Lnet/minecraft/server/world/ServerWorld;)I
-