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 ItemStack
customerHeldStack
private int
offerIndex
private List<ItemStack>
offers
private int
offerShownTicks
private int
ticksLeft
Fields 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 LivingEntity
findPotentialCustomer(VillagerEntity villager)
void
finishRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
private void
holdOffer(VillagerEntity villager)
private boolean
isPossible(TradeOffer offer)
void
keepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
private void
loadPossibleOffers(VillagerEntity villager)
private void
refreshShownOffer(VillagerEntity villager)
void
run(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
private void
setupOffers(LivingEntity customer, VillagerEntity villager)
boolean
shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
boolean
shouldRun(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:
shouldRun
in classTask<VillagerEntity>
-
shouldKeepRunning
public boolean shouldKeepRunning(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)- Overrides:
shouldKeepRunning
in classTask<VillagerEntity>
-
run
- Overrides:
run
in classTask<VillagerEntity>
-
keepRunning
- Overrides:
keepRunning
in classTask<VillagerEntity>
-
finishRunning
- Overrides:
finishRunning
in classTask<VillagerEntity>
-
setupOffers
-
holdOffer
-
loadPossibleOffers
-
isPossible
-
findPotentialCustomer
-
refreshShownOffer
-