Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.greenadine.scarecrow.nms;
- import org.bukkit.entity.ArmorStand;
- import com.google.common.base.Predicate;
- import me.greenadine.scarecrow.Main;
- import net.minecraft.server.v1_12_R1.Entity;
- import net.minecraft.server.v1_12_R1.EntityCreature;
- import net.minecraft.server.v1_12_R1.World;
- public class CustomEntityBat<T extends Entity> extends EntityCreature {
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public CustomEntityBat(World world, Main main)
- {
- super(world);
- this.goalSelector.a(new PathfinderGoalAvoidScarecrow(this, super.world, super.navigation, super.getBoundingBox(), 8.0F, 0.6D, 0.6D, (Class<T>) CustomEntityBat.class, super.lastX, super.lastY, super.lastZ
- , new Predicate<Entity>() {
- @SuppressWarnings("unlikely-arg-type")
- public boolean apply(Entity paramT) {
- if(paramT instanceof ArmorStand) {
- ArmorStand am = (ArmorStand) paramT;
- if(main.getScarecrows().contains(am)) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
- }));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment