public void doRenderLayer(
     EntitySlime p_177159_1_,
     float p_177159_2_,
     float p_177159_3_,
     float p_177159_4_,
     float p_177159_5_,
     float p_177159_6_,
     float p_177159_7_,
     float p_177159_8_) {
   if (!p_177159_1_.isInvisible()) {
     GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
     GlStateManager.enableNormalize();
     GlStateManager.enableBlend();
     GlStateManager.blendFunc(770, 771);
     this.slimeModel.setModelAttributes(this.slimeRenderer.getMainModel());
     this.slimeModel.render(
         p_177159_1_,
         p_177159_2_,
         p_177159_3_,
         p_177159_5_,
         p_177159_6_,
         p_177159_7_,
         p_177159_8_);
     GlStateManager.disableBlend();
     GlStateManager.disableNormalize();
   }
 }
Beispiel #2
0
  /** Will get destroyed next tick. */
  public void setDead() {
    int var1 = this.getSlimeSize();

    if (!this.worldObj.isClient && var1 > 1 && this.getHealth() <= 0.0F) {
      int var2 = 2 + this.rand.nextInt(3);

      for (int var3 = 0; var3 < var2; ++var3) {
        float var4 = ((float) (var3 % 2) - 0.5F) * (float) var1 / 4.0F;
        float var5 = ((float) (var3 / 2) - 0.5F) * (float) var1 / 4.0F;
        EntitySlime var6 = this.createInstance();
        var6.setSlimeSize(var1 / 2);
        var6.setLocationAndAngles(
            this.posX + (double) var4,
            this.posY + 0.5D,
            this.posZ + (double) var5,
            this.rand.nextFloat() * 360.0F,
            0.0F);
        this.worldObj.spawnEntityInWorld(var6);
      }
    }

    super.setDead();
  }
 @Override
 public boolean inject(World world, EntityLivingBase entity, ItemStack syringe) {
   EntitySlime slime = (EntitySlime) entity;
   slime.setSlimeSize(slime.getSlimeSize() << 1);
   return true;
 }
  @Override
  public List<RandomMob> getRandomMobs(World world) {
    List<RandomMob> mobs = new ArrayList<RandomMob>();

    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityMooshroom.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySlime.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityCow.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityChicken.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySheep.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityWitch.class, world), 10));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityGhast.class, world), 15));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityPig.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityCreeper.class, world), 25));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySquid.class, world), 30));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityOcelot.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityWolf.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityBat.class, world), 35));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityHorse.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityMinecartHopper.class, world), 15));

    EntityCreeper chargedCreeper = (EntityCreeper) MFRUtil.prepareMob(EntityCreeper.class, world);
    NBTTagCompound creeperNBT = new NBTTagCompound();
    chargedCreeper.writeToNBT(creeperNBT);
    creeperNBT.setBoolean("powered", true);
    creeperNBT.setShort("Fuse", (short) 120);
    chargedCreeper.readFromNBT(creeperNBT);
    mobs.add(new RandomMob(chargedCreeper, 5));

    EntityTNTPrimed armedTNT = (EntityTNTPrimed) MFRUtil.prepareMob(EntityTNTPrimed.class, world);
    armedTNT.fuse = 120;
    mobs.add(new RandomMob(armedTNT, 5));

    EntitySlime invisislime = (EntitySlime) MFRUtil.prepareMob(EntitySlime.class, world);
    invisislime.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    mobs.add(new RandomMob(invisislime, 5));

    EntityMooshroom invisishroom =
        (EntityMooshroom) MFRUtil.prepareMob(EntityMooshroom.class, world);
    invisishroom.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    mobs.add(new RandomMob(invisishroom, 5));

    EntityWolf invisiwolf = (EntityWolf) MFRUtil.prepareMob(EntityWolf.class, world);
    invisiwolf.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    invisiwolf.setAngry(true);
    mobs.add(new RandomMob(invisiwolf, 5));

    EntityTNTPrimed tntJockey = (EntityTNTPrimed) MFRUtil.prepareMob(EntityTNTPrimed.class, world);
    EntityBat tntMount = (EntityBat) MFRUtil.prepareMob(EntityBat.class, world);
    tntJockey.fuse = 120;
    tntJockey.mountEntity(tntMount);
    mobs.add(new RandomMob(tntMount, 2));

    EntitySkeleton skeleton1 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton2 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton3 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton4 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    skeleton4.mountEntity(skeleton3);
    skeleton3.mountEntity(skeleton2);
    skeleton2.mountEntity(skeleton1);
    mobs.add(new RandomMob(skeleton1, 2));

    EntityBlaze blazeJockey = (EntityBlaze) MFRUtil.prepareMob(EntityBlaze.class, world);
    EntityGhast blazeMount = (EntityGhast) MFRUtil.prepareMob(EntityGhast.class, world);
    blazeJockey.mountEntity(blazeMount);
    mobs.add(new RandomMob(blazeMount, 2));

    EntityCreeper creeperJockey = (EntityCreeper) MFRUtil.prepareMob(EntityCreeper.class, world);
    EntityCaveSpider creeperMount =
        (EntityCaveSpider) MFRUtil.prepareMob(EntityCaveSpider.class, world);
    creeperJockey.mountEntity(creeperMount);
    mobs.add(new RandomMob(creeperMount, 2));

    tntJockey = (EntityTNTPrimed) MFRUtil.prepareMob(EntityTNTPrimed.class, world);
    EntityXPOrb tntMount2 = (EntityXPOrb) MFRUtil.prepareMob(EntityXPOrb.class, world);
    tntJockey.fuse = 120;
    tntMount2.xpValue = 1;
    tntMount2.xpOrbAge = Short.MIN_VALUE;
    tntMount2.field_70532_c = Short.MAX_VALUE;
    tntJockey.mountEntity(tntMount2);
    mobs.add(new RandomMob(tntMount2, 2));

    creeperJockey = (EntityCreeper) MFRUtil.prepareMob(EntityCreeper.class, world);
    EntityXPOrb creeperMount2 = (EntityXPOrb) MFRUtil.prepareMob(EntityXPOrb.class, world);
    creeperMount2.xpValue = 1;
    creeperMount2.xpOrbAge = Short.MIN_VALUE;
    creeperMount2.field_70532_c = Short.MAX_VALUE;
    creeperJockey.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 20));
    creeperJockey.onStruckByLightning(null);
    creeperJockey.mountEntity(creeperMount2);
    mobs.add(new RandomMob(creeperMount2, 1));

    EntityEnderman direBane = (EntityEnderman) MFRUtil.prepareMob(EntityEnderman.class, world);
    direBane.addPotionEffect(new PotionEffect(Potion.regeneration.id, 120 * 20));
    direBane.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 120 * 20));
    direBane.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(120);
    direBane.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.7);
    direBane.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(15);
    direBane.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(32);
    direBane.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setAttribute(1);
    direBane.stepHeight = 2;
    EntityPlayer player = world.getPlayerEntityByName("direwolf20");
    if (player != null) {
      direBane.setCustomNameTag("Bane of direwolf");
      direBane.setAlwaysRenderNameTag(true);
      direBane.func_110163_bv();
      ItemStack armor = new ItemStack(Item.plateGold);
      AutoEnchantmentHelper.addRandomEnchantment(direBane.getRNG(), armor, 60);
      int i = EntityLiving.getArmorPosition(armor);
      direBane.setCurrentItemOrArmor(i, armor);
      direBane.setEquipmentDropChance(i, 2.0F);
    }
    mobs.add(new RandomMob(direBane, 1));

    return mobs;
  }