public class PiglinBrain extends Object
Modifier and Type | Field and Description |
---|---|
private static IntRange |
AVOID_MEMORY_DURATION |
private static IntRange |
field_22477 |
protected static Item |
field_23826 |
private static Set |
FOOD |
private static Set<Item> |
GOLDEN_ITEMS |
private static IntRange |
HUNT_MEMORY_DURATION |
private static IntRange |
MEMORY_TRANSFER_TASK_DURATION |
private static IntRange |
RIDE_TARGET_MEMORY_DURATION |
Constructor and Description |
---|
PiglinBrain() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
acceptsForBarter(Item item) |
private static void |
addAdmireItemActivities(Brain<PiglinEntity> brain) |
private static void |
addAvoidActivities(Brain<PiglinEntity> brain) |
private static void |
addCelebrateActivities(Brain<PiglinEntity> brain) |
private static void |
addCoreActivities(Brain<PiglinEntity> brain) |
private static void |
addFightActivities(PiglinEntity piglin,
Brain<PiglinEntity> brain) |
private static void |
addIdleActivities(Brain<PiglinEntity> brain) |
private static void |
addRideActivities(Brain<PiglinEntity> brain) |
protected static void |
angerAt(PiglinEntity piglin,
LivingEntity target) |
protected static void |
angerAtCloserTargets(PiglinEntity piglin,
LivingEntity target) |
private static void |
angerAtIfCloser(PiglinEntity piglin,
LivingEntity target) |
protected static boolean |
canGather(PiglinEntity piglin,
ItemStack stack) |
private static boolean |
canRide(PiglinEntity piglin,
Entity ridden) |
private static boolean |
canWander(LivingEntity piglin) |
protected static void |
consumeOffHandItem(PiglinEntity piglin,
boolean bool) |
protected static Brain<?> |
create(PiglinEntity piglin,
com.mojang.datafixers.Dynamic<?> data) |
private static void |
doBarter(PiglinEntity piglin,
ItemStack stack) |
private static boolean |
doesNotHaveGoldInOffHand(PiglinEntity piglin) |
private static void |
drop(PiglinEntity piglin,
ItemStack stack,
Vec3d pos) |
private static void |
dropBarteredItem(PiglinEntity piglin,
ItemStack stack) |
private static void |
dropBarteredItem(PiglinEntity piglin,
PlayerEntity player,
ItemStack stack) |
private static Vec3d |
findGround(PiglinEntity piglin) |
private static Optional<LivingEntity> |
getAngryAt(PiglinEntity piglin) |
private static ItemStack |
getBarteredItem(PiglinEntity piglin) |
private static List<PiglinEntity> |
getNearbyPiglins(PiglinEntity piglin) |
private static List<PiglinEntity> |
getNearbyVisiblePiglins(PiglinEntity piglin) |
private static Optional<? extends LivingEntity> |
getPreferredTarget(PiglinEntity piglin) |
private static void |
groupRunAwayFrom(PiglinEntity piglin,
LivingEntity target) |
private static boolean |
hasAteRecently(PiglinEntity piglin) |
private static boolean |
hasBeenHitByPlayer(PiglinEntity piglin) |
private static boolean |
hasBeenHurt(LivingEntity piglin) |
protected static boolean |
hasIdleActivity(PiglinEntity piglin) |
private static boolean |
hasItemInOffHand(PiglinEntity piglin) |
private static boolean |
hasNoAdvantageAgainstHoglins(PiglinEntity piglin) |
private static boolean |
hasOutnumberedHoglins(PiglinEntity piglins) |
private static boolean |
hasPlayerHoldingWantedItemNearby(LivingEntity entity) |
private static boolean |
hasPlayerHoldingWantedItemNearby(PiglinEntity piglin) |
private static boolean |
hasSoulFireNearby(PiglinEntity piglin) |
private static boolean |
hasZombifiedPiglinNearby(PiglinEntity piglin) |
protected static boolean |
haveHuntedHoglinsRecently(PiglinEntity piglin) |
private static boolean |
isAdmiringItem(PiglinEntity entity) |
private static boolean |
isFood(Item item) |
protected static boolean |
isGoldenItem(Item item) |
static boolean |
isGoldHoldingPlayer(LivingEntity target) |
private static boolean |
isHoldingCrossbow(LivingEntity piglin) |
private static boolean |
isPreferredAttackTarget(PiglinEntity piglin,
LivingEntity target) |
protected static void |
loot(PiglinEntity piglin,
ItemEntity drop) |
private static GoToRememberedPositionTask<BlockPos> |
makeGoToSoulFireTask() |
private static GoToRememberedPositionTask<?> |
makeGoToZombifiedPiglinTask() |
private static RandomTask<PiglinEntity> |
makeRandomFollowTask() |
private static RandomTask<PiglinEntity> |
makeRandomWanderTask() |
private static TimeLimitedTask<PiglinEntity> |
makeRememberRideableHoglinTask() |
private static ItemStack |
method_24848(ItemEntity stack) |
private static void |
method_24849(PiglinEntity piglin,
ItemStack stack) |
private static Task<PiglinEntity> |
method_24916() |
protected static void |
method_25948(PiglinEntity piglinEntity) |
protected static boolean |
method_27086(PiglinEntity piglinEntity,
ItemStack itemStack) |
protected static void |
onAttacked(PiglinEntity piglin,
LivingEntity attacker) |
static void |
onGoldBlockBroken(PlayerEntity player) |
static boolean |
playerInteract(PiglinEntity piglin,
PlayerEntity player,
Hand hand) |
private static void |
playSound(PiglinEntity piglin) |
protected static void |
playSoundAtChance(PiglinEntity piglin) |
protected static void |
rememberGroupHunting(PiglinEntity piglin) |
protected static void |
rememberHunting(PiglinEntity piglin) |
private static void |
runAwayFrom(PiglinEntity piglin,
LivingEntity target) |
private static void |
runAwayFromClosestTarget(PiglinEntity piglin,
LivingEntity target) |
private static void |
setAdmiringItem(LivingEntity entity) |
private static void |
setEatenRecently(PiglinEntity piglin) |
protected static void |
setHuntedRecently(PiglinEntity piglin) |
private static boolean |
shouldAttack(LivingEntity target) |
private static boolean |
shouldRunAwayFromHoglins(PiglinEntity piglin) |
private static void |
stopWalking(PiglinEntity piglin) |
protected static void |
tickActivities(PiglinEntity piglin) |
private static void |
tryRevenge(PiglinEntity piglin,
LivingEntity target) |
static boolean |
wearsGoldArmor(LivingEntity entity) |
protected static final Item field_23826
private static final IntRange field_22477
private static final IntRange HUNT_MEMORY_DURATION
private static final IntRange MEMORY_TRANSFER_TASK_DURATION
private static final IntRange RIDE_TARGET_MEMORY_DURATION
private static final IntRange AVOID_MEMORY_DURATION
private static final Set FOOD
protected static Brain<?> create(PiglinEntity piglin, com.mojang.datafixers.Dynamic<?> data)
protected static void setHuntedRecently(PiglinEntity piglin)
private static void addCoreActivities(Brain<PiglinEntity> brain)
private static void addIdleActivities(Brain<PiglinEntity> brain)
private static void addFightActivities(PiglinEntity piglin, Brain<PiglinEntity> brain)
private static void addCelebrateActivities(Brain<PiglinEntity> brain)
private static void addAdmireItemActivities(Brain<PiglinEntity> brain)
private static void addAvoidActivities(Brain<PiglinEntity> brain)
private static void addRideActivities(Brain<PiglinEntity> brain)
private static RandomTask<PiglinEntity> makeRandomFollowTask()
private static RandomTask<PiglinEntity> makeRandomWanderTask()
private static Task<PiglinEntity> method_24916()
private static GoToRememberedPositionTask<BlockPos> makeGoToSoulFireTask()
private static GoToRememberedPositionTask<?> makeGoToZombifiedPiglinTask()
protected static void tickActivities(PiglinEntity piglin)
protected static void loot(PiglinEntity piglin, ItemEntity drop)
private static ItemStack method_24848(ItemEntity stack)
protected static void consumeOffHandItem(PiglinEntity piglin, boolean bool)
protected static void method_25948(PiglinEntity piglinEntity)
private static void method_24849(PiglinEntity piglin, ItemStack stack)
private static void doBarter(PiglinEntity piglin, ItemStack stack)
private static void dropBarteredItem(PiglinEntity piglin, ItemStack stack)
private static void dropBarteredItem(PiglinEntity piglin, PlayerEntity player, ItemStack stack)
private static void drop(PiglinEntity piglin, ItemStack stack, Vec3d pos)
private static ItemStack getBarteredItem(PiglinEntity piglin)
protected static boolean canGather(PiglinEntity piglin, ItemStack stack)
protected static boolean isGoldenItem(Item item)
private static boolean canRide(PiglinEntity piglin, Entity ridden)
private static boolean isPreferredAttackTarget(PiglinEntity piglin, LivingEntity target)
private static Optional<? extends LivingEntity> getPreferredTarget(PiglinEntity piglin)
public static void onGoldBlockBroken(PlayerEntity player)
public static boolean playerInteract(PiglinEntity piglin, PlayerEntity player, Hand hand)
protected static boolean method_27086(PiglinEntity piglinEntity, ItemStack itemStack)
protected static void onAttacked(PiglinEntity piglin, LivingEntity attacker)
private static void tryRevenge(PiglinEntity piglin, LivingEntity target)
private static void playSound(PiglinEntity piglin)
protected static void playSoundAtChance(PiglinEntity piglin)
protected static boolean haveHuntedHoglinsRecently(PiglinEntity piglin)
private static List<PiglinEntity> getNearbyVisiblePiglins(PiglinEntity piglin)
private static List<PiglinEntity> getNearbyPiglins(PiglinEntity piglin)
public static boolean wearsGoldArmor(LivingEntity entity)
private static void stopWalking(PiglinEntity piglin)
private static TimeLimitedTask<PiglinEntity> makeRememberRideableHoglinTask()
protected static void angerAtCloserTargets(PiglinEntity piglin, LivingEntity target)
protected static void rememberGroupHunting(PiglinEntity piglin)
protected static void angerAt(PiglinEntity piglin, LivingEntity target)
private static void angerAtIfCloser(PiglinEntity piglin, LivingEntity target)
private static Optional<LivingEntity> getAngryAt(PiglinEntity piglin)
private static void groupRunAwayFrom(PiglinEntity piglin, LivingEntity target)
private static void runAwayFromClosestTarget(PiglinEntity piglin, LivingEntity target)
private static boolean shouldRunAwayFromHoglins(PiglinEntity piglin)
private static boolean hasNoAdvantageAgainstHoglins(PiglinEntity piglin)
private static boolean hasOutnumberedHoglins(PiglinEntity piglins)
private static void runAwayFrom(PiglinEntity piglin, LivingEntity target)
protected static void rememberHunting(PiglinEntity piglin)
private static boolean hasPlayerHoldingWantedItemNearby(PiglinEntity piglin)
private static void setEatenRecently(PiglinEntity piglin)
private static Vec3d findGround(PiglinEntity piglin)
private static boolean hasAteRecently(PiglinEntity piglin)
protected static boolean hasIdleActivity(PiglinEntity piglin)
private static boolean isHoldingCrossbow(LivingEntity piglin)
private static void setAdmiringItem(LivingEntity entity)
private static boolean isAdmiringItem(PiglinEntity entity)
private static boolean acceptsForBarter(Item item)
private static boolean isFood(Item item)
private static boolean shouldAttack(LivingEntity target)
private static boolean hasSoulFireNearby(PiglinEntity piglin)
private static boolean hasZombifiedPiglinNearby(PiglinEntity piglin)
private static boolean hasPlayerHoldingWantedItemNearby(LivingEntity entity)
private static boolean canWander(LivingEntity piglin)
public static boolean isGoldHoldingPlayer(LivingEntity target)
private static boolean hasBeenHitByPlayer(PiglinEntity piglin)
private static boolean hasBeenHurt(LivingEntity piglin)
private static boolean hasItemInOffHand(PiglinEntity piglin)
private static boolean doesNotHaveGoldInOffHand(PiglinEntity piglin)