All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.PathfinderGoalTradeWithPlayer Maven / Gradle / Ivy

package net.minecraft.server;

public class PathfinderGoalTradeWithPlayer extends PathfinderGoal {
	
	private final EntityVillager a;
	
	public PathfinderGoalTradeWithPlayer(EntityVillager entityvillager) {
		this.a = entityvillager;
		this.setMutexBits(5);
	}
	
	public boolean a() {
		if (!this.a.isAlive()) {
			return false;
		} else if (this.a.isInWater()) {
			return false;
		} else if (!this.a.onGround) {
			return false;
		} else if (this.a.velocityChanged) {
			return false;
		} else {
			EntityHuman entityhuman = this.a.v_();
			
			return entityhuman != null && (!(this.a.getDistanceSquaredToEntity(entityhuman) > 16.0D) && entityhuman.activeContainer != null);
		}
	}
	
	public void c() {
		this.a.getNavigation().clearPathEntity();
	}
	
	public void d() {
		this.a.a_((EntityHuman) null);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy