Class HoldTradeOffersTask
java.lang.Object
net.minecraft.entity.ai.brain.task.Task<VillagerEntity>
net.minecraft.entity.ai.brain.task.HoldTradeOffersTask
public class HoldTradeOffersTask 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 ItemStackcustomerHeldStackprivate intofferIndexprivate List<ItemStack>offersprivate intofferShownTicksprivate intticksLeftFields inherited from class net.minecraft.entity.ai.brain.task.Task
requiredMemoryStates -
Constructor Summary
Constructors Constructor Description HoldTradeOffersTask(int minRunTime, int maxRunTime) -
Method Summary
Modifier and Type Method Description private LivingEntityfindPotentialCustomer(VillagerEntity villager)voidfinishRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)private voidholdOffer(VillagerEntity villager)private booleanisPossible(TradeOffer offer)voidkeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)private voidloadPossibleOffers(VillagerEntity villager)private voidrefreshShownOffer(VillagerEntity villager)voidrun(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)private voidsetupOffers(LivingEntity customer, VillagerEntity villager)booleanshouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)booleanshouldRun(ServerWorld serverWorld, VillagerEntity villagerEntity)Methods inherited from class net.minecraft.entity.ai.brain.task.Task
getStatus, isTimeLimitExceeded, stop, tick, toString, tryStarting
-
Field Details
-
customerHeldStack
-
offers
-
offerShownTicks
private int offerShownTicks -
offerIndex
private int offerIndex -
ticksLeft
private int ticksLeft
-
-
Constructor Details
-
HoldTradeOffersTask
public HoldTradeOffersTask(int minRunTime, int maxRunTime)
-
-
Method Details
-
shouldRun
- Overrides:
shouldRunin classTask<VillagerEntity>
-
shouldKeepRunning
public boolean shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)- Overrides:
shouldKeepRunningin classTask<VillagerEntity>
-
run
- Overrides:
runin classTask<VillagerEntity>
-
keepRunning
- Overrides:
keepRunningin classTask<VillagerEntity>
-
finishRunning
- Overrides:
finishRunningin classTask<VillagerEntity>
-
setupOffers
-
holdOffer
-
loadPossibleOffers
-
isPossible
-
findPotentialCustomer
-
refreshShownOffer
-