public boolean instanceOf(EntityType e) { // Generic types and players if (e.equals(EntityType.ENTITY_PLAYER_SP)) { return entity instanceof EntityPlayerSP; } else if (e.equals(EntityType.ENTITY_PLAYER)) { return entity instanceof EntityPlayer; } else if (e.equals(EntityType.ENTITY_LIVING_BASE)) { return entity instanceof EntityLivingBase; } else if (e.equals(EntityType.ENTITY_LIVING)) { return entity instanceof EntityLiving; } // Mobs if (e.equals(EntityType.ENTITY_WOLF)) { return entity instanceof EntityWolf; } else if (e.equals(EntityType.Entity_Ageable)) { return entity instanceof EntityAgeable; } else if (e.equals(EntityType.EntityAmbientCreature)) { return entity instanceof EntityAmbientCreature; } else if (e.equals(EntityType.EntityWaterMob)) { return entity instanceof EntityWaterMob; } else if (e.equals(EntityType.EntityMob)) { return entity instanceof EntityMob; } else if (e.equals(EntityType.EntitySlime)) { return entity instanceof EntitySlime; } else if (e.equals(EntityType.EntityFlying)) { return entity instanceof EntityFlying; } else if (e.equals(EntityType.EntityGolem)) { return entity instanceof EntityGolem; } else if (e.equals(EntityType.ENTITY_SPIDER)) { return entity instanceof EntitySpider; } else if (e.equals(EntityType.ENTITY_SPIDER)) { return entity instanceof EntitySpider; } else if (e.equals(EntityType.ENTITY_ZOMBIE_PIGMAN)) { return entity instanceof EntityZombie; } else if (e.equals(EntityType.ENTITY_ENDERMAN)) { return entity instanceof EntityEnderman; } return false; }
public static void onPreInit() { PossessHandler.registerHandler(new BlazeHandler()); PossessHandler.registerHandler(new ChickenHandler()); PossessHandler.registerHandler(new CreeperHandler()); PossessHandler.registerHandler(new DragonHandler()); PossessHandler.registerHandler(new EndermanHandler()); PossessHandler.registerHandler(new FlyingHandler(EntityFlying.class, new ResourceLocation(Possessed.MODID, "flying"))); PossessHandler.registerHandler(new FlyingHandler(EntityBat.class, new ResourceLocation(Possessed.MODID, "bat_flying"))); PossessHandler.registerHandler(new FlyingHandler(EntityBlaze.class, new ResourceLocation(Possessed.MODID, "blaze_flying"))); PossessHandler.registerHandler(new GhastHandler()); PossessHandler.registerHandler(new GrassEatHandler(EntityCow.class, new ResourceLocation(Possessed.MODID, "cow_grass"))); PossessHandler.registerHandler(new GrassEatHandler(EntityChicken.class, new ResourceLocation(Possessed.MODID, "chicken_grass"))); PossessHandler.registerHandler(new GrassEatHandler(EntityPig.class, new ResourceLocation(Possessed.MODID, "pig_grass"))); PossessHandler.registerHandler(new GrassEatHandler(EntityHorse.class, new ResourceLocation(Possessed.MODID, "horse_grass"))); PossessHandler.registerHandler(new GuardianHandler()); PossessHandler.registerHandler(new IronGolemHandler()); PossessHandler.registerHandler(new OcelotHandler()); PossessHandler.registerHandler(new PolarBearHandler()); PossessHandler.registerHandler(new RabbitHandler()); PossessHandler.registerHandler(new SheepHandler()); PossessHandler.registerHandler(new ShulkerHandler()); PossessHandler.registerHandler(new SkeletonHandler()); PossessHandler.registerHandler(new SlimeHandler()); PossessHandler.registerHandler(new SnowmanHandler()); PossessHandler.registerHandler(new SpiderHandler()); PossessHandler.registerHandler(new SquidHandler()); PossessHandler.registerHandler(new WaterMobHandler()); PossessHandler.registerHandler(new WitherHandler()); PossessHandler.registerHandler(new ZombieHandler()); }
@Override protected void attackEntity(Entity entity, float f) { if (attackTime <= 0 && f < ( tamed() ? 2.5F : 2.0F ) && ( ( entity.boundingBox.maxY > boundingBox.minY && entity.boundingBox.minY < boundingBox.maxY ) || f == 0F )) { attackTime = 20; if (flymode() && canFlap() && scout() && entity instanceof EntityLivingBase && ridingEntity == null && riddenByEntity == null && entity.ridingEntity == null && entity.riddenByEntity == null && !( entity instanceof EntityFairy || entity instanceof EntityFlying )) { // Scout's Totally Leet Air Attack. FairyFactions.proxy.sendFairyMount(this, entity); setFlymode(true); flyTime = 200; setCanFlap(true); attackTime = 35; } else { if (scout() && ridingEntity != null && entity != null && entity == ridingEntity) { // The finish of its air attack. FairyFactions.proxy.sendFairyMount(this, entity); attackTime = 35; } // normal boring strike. doAttack(entity); } } }
public AILookAround(EntityFlying ufo) { this.parentEntity = ufo; }
public FlyMoveHelper(EntityFlying ufo) { super(ufo); this.parentEntity = ufo; }
public AIRandomFly(EntityFlying ufo) { this.parentEntity = ufo; }
public AIRandomFly(EntityFlying entity) { this.parentEntity = entity; this.setMutexBits(1); }
public CraftFlying(CraftServer server, EntityFlying entity) { super(server, entity); }
@Override public EntityFlying getHandle() { return (EntityFlying) entity; }