Java 类net.minecraft.entity.EntityAreaEffectCloud 实例源码

项目:Backmemed    文件:EntityPotion.java   
private void func_190542_a(ItemStack p_190542_1_, PotionType p_190542_2_)
{
    EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
    entityareaeffectcloud.setOwner(this.getThrower());
    entityareaeffectcloud.setRadius(3.0F);
    entityareaeffectcloud.setRadiusOnUse(-0.5F);
    entityareaeffectcloud.setWaitTime(10);
    entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float)entityareaeffectcloud.getDuration());
    entityareaeffectcloud.setPotion(p_190542_2_);

    for (PotionEffect potioneffect : PotionUtils.getFullEffectsFromItem(p_190542_1_))
    {
        entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
    }

    NBTTagCompound nbttagcompound = p_190542_1_.getTagCompound();

    if (nbttagcompound != null && nbttagcompound.hasKey("CustomPotionColor", 99))
    {
        entityareaeffectcloud.setColor(nbttagcompound.getInteger("CustomPotionColor"));
    }

    this.world.spawnEntityInWorld(entityareaeffectcloud);
}
项目:Backmemed    文件:EntityCreeper.java   
private void func_190741_do()
{
    Collection<PotionEffect> collection = this.getActivePotionEffects();

    if (!collection.isEmpty())
    {
        EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
        entityareaeffectcloud.setRadius(2.5F);
        entityareaeffectcloud.setRadiusOnUse(-0.5F);
        entityareaeffectcloud.setWaitTime(10);
        entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2);
        entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float)entityareaeffectcloud.getDuration());

        for (PotionEffect potioneffect : collection)
        {
            entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
        }

        this.world.spawnEntityInWorld(entityareaeffectcloud);
    }
}
项目:Backmemed    文件:EntityDragonFireball.java   
/**
 * Called when this EntityFireball hits a block or entity.
 */
protected void onImpact(RayTraceResult result)
{
    if (result.entityHit == null || !result.entityHit.isEntityEqual(this.shootingEntity))
    {
        if (!this.world.isRemote)
        {
            List<EntityLivingBase> list = this.world.<EntityLivingBase>getEntitiesWithinAABB(EntityLivingBase.class, this.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D));
            EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
            entityareaeffectcloud.setOwner(this.shootingEntity);
            entityareaeffectcloud.setParticle(EnumParticleTypes.DRAGON_BREATH);
            entityareaeffectcloud.setRadius(3.0F);
            entityareaeffectcloud.setDuration(600);
            entityareaeffectcloud.setRadiusPerTick((7.0F - entityareaeffectcloud.getRadius()) / (float)entityareaeffectcloud.getDuration());
            entityareaeffectcloud.addEffect(new PotionEffect(MobEffects.INSTANT_DAMAGE, 1, 1));

            if (!list.isEmpty())
            {
                for (EntityLivingBase entitylivingbase : list)
                {
                    double d0 = this.getDistanceSqToEntity(entitylivingbase);

                    if (d0 < 16.0D)
                    {
                        entityareaeffectcloud.setPosition(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ);
                        break;
                    }
                }
            }

            this.world.playEvent(2006, new BlockPos(this.posX, this.posY, this.posZ), 0);
            this.world.spawnEntityInWorld(entityareaeffectcloud);
            this.setDead();
        }
    }
}
项目:Backmemed    文件:RenderAreaEffectCloud.java   
@Nullable

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected ResourceLocation getEntityTexture(EntityAreaEffectCloud entity)
    {
        return null;
    }
项目:CustomWorldGen    文件:EntityDragonFireball.java   
/**
 * Called when this EntityFireball hits a block or entity.
 */
protected void onImpact(RayTraceResult result)
{
    if (!this.worldObj.isRemote)
    {
        List<EntityLivingBase> list = this.worldObj.<EntityLivingBase>getEntitiesWithinAABB(EntityLivingBase.class, this.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D));
        EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.worldObj, this.posX, this.posY, this.posZ);
        entityareaeffectcloud.setOwner(this.shootingEntity);
        entityareaeffectcloud.setParticle(EnumParticleTypes.DRAGON_BREATH);
        entityareaeffectcloud.setRadius(3.0F);
        entityareaeffectcloud.setDuration(2400);
        entityareaeffectcloud.setRadiusPerTick((7.0F - entityareaeffectcloud.getRadius()) / (float)entityareaeffectcloud.getDuration());
        entityareaeffectcloud.addEffect(new PotionEffect(MobEffects.INSTANT_DAMAGE, 1, 1));

        if (!list.isEmpty())
        {
            for (EntityLivingBase entitylivingbase : list)
            {
                double d0 = this.getDistanceSqToEntity(entitylivingbase);

                if (d0 < 16.0D)
                {
                    entityareaeffectcloud.setPosition(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ);
                    break;
                }
            }
        }

        this.worldObj.playEvent(2006, new BlockPos(this.posX, this.posY, this.posZ), 0);
        this.worldObj.spawnEntityInWorld(entityareaeffectcloud);
        this.setDead();
    }
}
项目:ExpandedRailsMod    文件:EntityDragonFireball.java   
/**
 * Called when this EntityFireball hits a block or entity.
 */
protected void onImpact(RayTraceResult result)
{
    if (!this.worldObj.isRemote)
    {
        List<EntityLivingBase> list = this.worldObj.<EntityLivingBase>getEntitiesWithinAABB(EntityLivingBase.class, this.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D));
        EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.worldObj, this.posX, this.posY, this.posZ);
        entityareaeffectcloud.setOwner(this.shootingEntity);
        entityareaeffectcloud.setParticle(EnumParticleTypes.DRAGON_BREATH);
        entityareaeffectcloud.setRadius(3.0F);
        entityareaeffectcloud.setDuration(2400);
        entityareaeffectcloud.setRadiusPerTick((7.0F - entityareaeffectcloud.getRadius()) / (float)entityareaeffectcloud.getDuration());
        entityareaeffectcloud.addEffect(new PotionEffect(MobEffects.INSTANT_DAMAGE, 1, 1));

        if (!list.isEmpty())
        {
            for (EntityLivingBase entitylivingbase : list)
            {
                double d0 = this.getDistanceSqToEntity(entitylivingbase);

                if (d0 < 16.0D)
                {
                    entityareaeffectcloud.setPosition(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ);
                    break;
                }
            }
        }

        this.worldObj.playEvent(2006, new BlockPos(this.posX, this.posY, this.posZ), 0);
        this.worldObj.spawnEntityInWorld(entityareaeffectcloud);
        this.setDead();
    }
}
项目:Backmemed    文件:PhaseSittingFlaming.java   
/**
 * Gives the phase a chance to update its status.
 * Called by dragon's onLivingUpdate. Only used when !worldObj.isRemote.
 */
public void doLocalUpdate()
{
    ++this.flameTicks;

    if (this.flameTicks >= 200)
    {
        if (this.flameCount >= 4)
        {
            this.dragon.getPhaseManager().setPhase(PhaseList.TAKEOFF);
        }
        else
        {
            this.dragon.getPhaseManager().setPhase(PhaseList.SITTING_SCANNING);
        }
    }
    else if (this.flameTicks == 10)
    {
        Vec3d vec3d = (new Vec3d(this.dragon.dragonPartHead.posX - this.dragon.posX, 0.0D, this.dragon.dragonPartHead.posZ - this.dragon.posZ)).normalize();
        float f = 5.0F;
        double d0 = this.dragon.dragonPartHead.posX + vec3d.xCoord * 5.0D / 2.0D;
        double d1 = this.dragon.dragonPartHead.posZ + vec3d.zCoord * 5.0D / 2.0D;
        double d2 = this.dragon.dragonPartHead.posY + (double)(this.dragon.dragonPartHead.height / 2.0F);
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.floor(d0), MathHelper.floor(d2), MathHelper.floor(d1));

        while (this.dragon.world.isAirBlock(blockpos$mutableblockpos))
        {
            --d2;
            blockpos$mutableblockpos.setPos(MathHelper.floor(d0), MathHelper.floor(d2), MathHelper.floor(d1));
        }

        d2 = (double)(MathHelper.floor(d2) + 1);
        this.areaEffectCloud = new EntityAreaEffectCloud(this.dragon.world, d0, d2, d1);
        this.areaEffectCloud.setOwner(this.dragon);
        this.areaEffectCloud.setRadius(5.0F);
        this.areaEffectCloud.setDuration(200);
        this.areaEffectCloud.setParticle(EnumParticleTypes.DRAGON_BREATH);
        this.areaEffectCloud.addEffect(new PotionEffect(MobEffects.INSTANT_DAMAGE));
        this.dragon.world.spawnEntityInWorld(this.areaEffectCloud);
    }
}
项目:Backmemed    文件:ItemGlassBottle.java   
public ActionResult<ItemStack> onItemRightClick(World itemStackIn, EntityPlayer worldIn, EnumHand playerIn)
{
    List<EntityAreaEffectCloud> list = itemStackIn.<EntityAreaEffectCloud>getEntitiesWithinAABB(EntityAreaEffectCloud.class, worldIn.getEntityBoundingBox().expandXyz(2.0D), new Predicate<EntityAreaEffectCloud>()
    {
        public boolean apply(@Nullable EntityAreaEffectCloud p_apply_1_)
        {
            return p_apply_1_ != null && p_apply_1_.isEntityAlive() && p_apply_1_.getOwner() instanceof EntityDragon;
        }
    });
    ItemStack itemstack = worldIn.getHeldItem(playerIn);

    if (!list.isEmpty())
    {
        EntityAreaEffectCloud entityareaeffectcloud = (EntityAreaEffectCloud)list.get(0);
        entityareaeffectcloud.setRadius(entityareaeffectcloud.getRadius() - 0.5F);
        itemStackIn.playSound((EntityPlayer)null, worldIn.posX, worldIn.posY, worldIn.posZ, SoundEvents.ITEM_BOTTLE_FILL_DRAGONBREATH, SoundCategory.NEUTRAL, 1.0F, 1.0F);
        return new ActionResult(EnumActionResult.SUCCESS, this.turnBottleIntoItem(itemstack, worldIn, new ItemStack(Items.DRAGON_BREATH)));
    }
    else
    {
        RayTraceResult raytraceresult = this.rayTrace(itemStackIn, worldIn, true);

        if (raytraceresult == null)
        {
            return new ActionResult(EnumActionResult.PASS, itemstack);
        }
        else
        {
            if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK)
            {
                BlockPos blockpos = raytraceresult.getBlockPos();

                if (!itemStackIn.isBlockModifiable(worldIn, blockpos) || !worldIn.canPlayerEdit(blockpos.offset(raytraceresult.sideHit), raytraceresult.sideHit, itemstack))
                {
                    return new ActionResult(EnumActionResult.PASS, itemstack);
                }

                if (itemStackIn.getBlockState(blockpos).getMaterial() == Material.WATER)
                {
                    itemStackIn.playSound(worldIn, worldIn.posX, worldIn.posY, worldIn.posZ, SoundEvents.ITEM_BOTTLE_FILL, SoundCategory.NEUTRAL, 1.0F, 1.0F);
                    return new ActionResult(EnumActionResult.SUCCESS, this.turnBottleIntoItem(itemstack, worldIn, PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER)));
                }
            }

            return new ActionResult(EnumActionResult.PASS, itemstack);
        }
    }
}
项目:CustomWorldGen    文件:PhaseSittingFlaming.java   
/**
 * Gives the phase a chance to update its status.
 * Called by dragon's onLivingUpdate. Only used when !worldObj.isRemote.
 */
public void doLocalUpdate()
{
    ++this.flameTicks;

    if (this.flameTicks >= 200)
    {
        if (this.flameCount >= 4)
        {
            this.dragon.getPhaseManager().setPhase(PhaseList.TAKEOFF);
        }
        else
        {
            this.dragon.getPhaseManager().setPhase(PhaseList.SITTING_SCANNING);
        }
    }
    else if (this.flameTicks == 10)
    {
        Vec3d vec3d = (new Vec3d(this.dragon.dragonPartHead.posX - this.dragon.posX, 0.0D, this.dragon.dragonPartHead.posZ - this.dragon.posZ)).normalize();
        float f = 5.0F;
        double d0 = this.dragon.dragonPartHead.posX + vec3d.xCoord * 5.0D / 2.0D;
        double d1 = this.dragon.dragonPartHead.posZ + vec3d.zCoord * 5.0D / 2.0D;
        double d2 = this.dragon.dragonPartHead.posY + (double)(this.dragon.dragonPartHead.height / 2.0F);
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.floor_double(d0), MathHelper.floor_double(d2), MathHelper.floor_double(d1));

        while (this.dragon.worldObj.isAirBlock(blockpos$mutableblockpos) && d2 >= 0) //Forge: Fix infinite loop if ground is missing.
        {
            --d2;
            blockpos$mutableblockpos.setPos(MathHelper.floor_double(d0), MathHelper.floor_double(d2), MathHelper.floor_double(d1));
        }

        d2 = (double)(MathHelper.floor_double(d2) + 1);
        this.areaEffectCloud = new EntityAreaEffectCloud(this.dragon.worldObj, d0, d2, d1);
        this.areaEffectCloud.setOwner(this.dragon);
        this.areaEffectCloud.setRadius(5.0F);
        this.areaEffectCloud.setDuration(200);
        this.areaEffectCloud.setParticle(EnumParticleTypes.DRAGON_BREATH);
        this.areaEffectCloud.addEffect(new PotionEffect(MobEffects.INSTANT_DAMAGE));
        this.dragon.worldObj.spawnEntityInWorld(this.areaEffectCloud);
    }
}
项目:CustomWorldGen    文件:ItemGlassBottle.java   
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
{
    List<EntityAreaEffectCloud> list = worldIn.<EntityAreaEffectCloud>getEntitiesWithinAABB(EntityAreaEffectCloud.class, playerIn.getEntityBoundingBox().expandXyz(2.0D), new Predicate<EntityAreaEffectCloud>()
    {
        public boolean apply(@Nullable EntityAreaEffectCloud p_apply_1_)
        {
            return p_apply_1_ != null && p_apply_1_.isEntityAlive() && p_apply_1_.getOwner() instanceof EntityDragon;
        }
    });

    if (!list.isEmpty())
    {
        EntityAreaEffectCloud entityareaeffectcloud = (EntityAreaEffectCloud)list.get(0);
        entityareaeffectcloud.setRadius(entityareaeffectcloud.getRadius() - 0.5F);
        worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ITEM_BOTTLE_FILL_DRAGONBREATH, SoundCategory.NEUTRAL, 1.0F, 1.0F);
        return new ActionResult(EnumActionResult.SUCCESS, this.turnBottleIntoItem(itemStackIn, playerIn, new ItemStack(Items.DRAGON_BREATH)));
    }
    else
    {
        RayTraceResult raytraceresult = this.rayTrace(worldIn, playerIn, true);

        if (raytraceresult == null)
        {
            return new ActionResult(EnumActionResult.PASS, itemStackIn);
        }
        else
        {
            if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK)
            {
                BlockPos blockpos = raytraceresult.getBlockPos();

                if (!worldIn.isBlockModifiable(playerIn, blockpos) || !playerIn.canPlayerEdit(blockpos.offset(raytraceresult.sideHit), raytraceresult.sideHit, itemStackIn))
                {
                    return new ActionResult(EnumActionResult.PASS, itemStackIn);
                }

                if (worldIn.getBlockState(blockpos).getMaterial() == Material.WATER)
                {
                    worldIn.playSound(playerIn, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ITEM_BOTTLE_FILL, SoundCategory.NEUTRAL, 1.0F, 1.0F);
                    return new ActionResult(EnumActionResult.SUCCESS, this.turnBottleIntoItem(itemStackIn, playerIn, new ItemStack(Items.POTIONITEM)));
                }
            }

            return new ActionResult(EnumActionResult.PASS, itemStackIn);
        }
    }
}
项目:CustomWorldGen    文件:RenderManager.java   
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn)
{
    this.renderEngine = renderEngineIn;
    this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this));
    this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this));
    this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F));
    this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F));
    this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F));
    this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F));
    this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F));
    this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F));
    this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this));
    this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this));
    this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this));
    this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this));
    this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this));
    this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this));
    this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this));
    this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this));
    this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this));
    this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this));
    this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F));
    this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this));
    this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F));
    this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this));
    this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F));
    this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this));
    this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this));
    this.entityRenderMap.put(EntityBat.class, new RenderBat(this));
    this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this));
    this.entityRenderMap.put(EntityShulker.class, new RenderShulker(this, new ModelShulker()));
    this.entityRenderMap.put(EntityPolarBear.class, new RenderPolarBear(this, new ModelPolarBear(), 0.7F));
    this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this));
    this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
    this.entityRenderMap.put(EntityWither.class, new RenderWither(this));
    this.entityRenderMap.put(Entity.class, new RenderEntity(this));
    this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this));
    this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn));
    this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this));
    this.entityRenderMap.put(EntityTippedArrow.class, new RenderTippedArrow(this));
    this.entityRenderMap.put(EntitySpectralArrow.class, new RenderSpectralArrow(this));
    this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.SNOWBALL, itemRendererIn));
    this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ENDER_PEARL, itemRendererIn));
    this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ENDER_EYE, itemRendererIn));
    this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.EGG, itemRendererIn));
    this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn));
    this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.EXPERIENCE_BOTTLE, itemRendererIn));
    this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.FIREWORKS, itemRendererIn));
    this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
    this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
    this.entityRenderMap.put(EntityDragonFireball.class, new RenderDragonFireball(this));
    this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this));
    this.entityRenderMap.put(EntityShulkerBullet.class, new RenderShulkerBullet(this));
    this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn));
    this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this));
    this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
    this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this));
    this.entityRenderMap.put(EntityArmorStand.class, new RenderArmorStand(this));
    this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
    this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
    this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this));
    this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this));
    this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this));
    this.entityRenderMap.put(EntityAreaEffectCloud.class, new RenderAreaEffectCloud(this));
    this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F));
    this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this));
    this.playerRenderer = new RenderPlayer(this);
    this.skinMap.put("default", this.playerRenderer);
    this.skinMap.put("slim", new RenderPlayer(this, true));
    net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(this, this.entityRenderMap);
}
项目:CustomWorldGen    文件:RenderAreaEffectCloud.java   
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityAreaEffectCloud entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
项目:CustomWorldGen    文件:RenderAreaEffectCloud.java   
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityAreaEffectCloud entity)
{
    return null;
}
项目:ExpandedRailsMod    文件:PhaseSittingFlaming.java   
/**
 * Gives the phase a chance to update its status.
 * Called by dragon's onLivingUpdate. Only used when !worldObj.isRemote.
 */
public void doLocalUpdate()
{
    ++this.flameTicks;

    if (this.flameTicks >= 200)
    {
        if (this.flameCount >= 4)
        {
            this.dragon.getPhaseManager().setPhase(PhaseList.TAKEOFF);
        }
        else
        {
            this.dragon.getPhaseManager().setPhase(PhaseList.SITTING_SCANNING);
        }
    }
    else if (this.flameTicks == 10)
    {
        Vec3d vec3d = (new Vec3d(this.dragon.dragonPartHead.posX - this.dragon.posX, 0.0D, this.dragon.dragonPartHead.posZ - this.dragon.posZ)).normalize();
        float f = 5.0F;
        double d0 = this.dragon.dragonPartHead.posX + vec3d.xCoord * 5.0D / 2.0D;
        double d1 = this.dragon.dragonPartHead.posZ + vec3d.zCoord * 5.0D / 2.0D;
        double d2 = this.dragon.dragonPartHead.posY + (double)(this.dragon.dragonPartHead.height / 2.0F);
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.floor_double(d0), MathHelper.floor_double(d2), MathHelper.floor_double(d1));

        while (this.dragon.worldObj.isAirBlock(blockpos$mutableblockpos))
        {
            --d2;
            blockpos$mutableblockpos.setPos(MathHelper.floor_double(d0), MathHelper.floor_double(d2), MathHelper.floor_double(d1));
        }

        d2 = (double)(MathHelper.floor_double(d2) + 1);
        this.areaEffectCloud = new EntityAreaEffectCloud(this.dragon.worldObj, d0, d2, d1);
        this.areaEffectCloud.setOwner(this.dragon);
        this.areaEffectCloud.setRadius(5.0F);
        this.areaEffectCloud.setDuration(200);
        this.areaEffectCloud.setParticle(EnumParticleTypes.DRAGON_BREATH);
        this.areaEffectCloud.addEffect(new PotionEffect(MobEffects.INSTANT_DAMAGE));
        this.dragon.worldObj.spawnEntityInWorld(this.areaEffectCloud);
    }
}
项目:ExpandedRailsMod    文件:ItemGlassBottle.java   
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
{
    List<EntityAreaEffectCloud> list = worldIn.<EntityAreaEffectCloud>getEntitiesWithinAABB(EntityAreaEffectCloud.class, playerIn.getEntityBoundingBox().expandXyz(2.0D), new Predicate<EntityAreaEffectCloud>()
    {
        public boolean apply(@Nullable EntityAreaEffectCloud p_apply_1_)
        {
            return p_apply_1_ != null && p_apply_1_.isEntityAlive() && p_apply_1_.getOwner() instanceof EntityDragon;
        }
    });

    if (!list.isEmpty())
    {
        EntityAreaEffectCloud entityareaeffectcloud = (EntityAreaEffectCloud)list.get(0);
        entityareaeffectcloud.setRadius(entityareaeffectcloud.getRadius() - 0.5F);
        worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ITEM_BOTTLE_FILL_DRAGONBREATH, SoundCategory.NEUTRAL, 1.0F, 1.0F);
        return new ActionResult(EnumActionResult.SUCCESS, this.turnBottleIntoItem(itemStackIn, playerIn, new ItemStack(Items.DRAGON_BREATH)));
    }
    else
    {
        RayTraceResult raytraceresult = this.rayTrace(worldIn, playerIn, true);

        if (raytraceresult == null)
        {
            return new ActionResult(EnumActionResult.PASS, itemStackIn);
        }
        else
        {
            if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK)
            {
                BlockPos blockpos = raytraceresult.getBlockPos();

                if (!worldIn.isBlockModifiable(playerIn, blockpos) || !playerIn.canPlayerEdit(blockpos.offset(raytraceresult.sideHit), raytraceresult.sideHit, itemStackIn))
                {
                    return new ActionResult(EnumActionResult.PASS, itemStackIn);
                }

                if (worldIn.getBlockState(blockpos).getMaterial() == Material.WATER)
                {
                    worldIn.playSound(playerIn, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ITEM_BOTTLE_FILL, SoundCategory.NEUTRAL, 1.0F, 1.0F);
                    return new ActionResult(EnumActionResult.SUCCESS, this.turnBottleIntoItem(itemStackIn, playerIn, new ItemStack(Items.POTIONITEM)));
                }
            }

            return new ActionResult(EnumActionResult.PASS, itemStackIn);
        }
    }
}
项目:ExpandedRailsMod    文件:RenderManager.java   
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn)
{
    this.renderEngine = renderEngineIn;
    this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this));
    this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this));
    this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F));
    this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F));
    this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F));
    this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F));
    this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F));
    this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F));
    this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this));
    this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this));
    this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this));
    this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this));
    this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this));
    this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this));
    this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this));
    this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this));
    this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this));
    this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this));
    this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F));
    this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this));
    this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F));
    this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this));
    this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F));
    this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this));
    this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this));
    this.entityRenderMap.put(EntityBat.class, new RenderBat(this));
    this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this));
    this.entityRenderMap.put(EntityShulker.class, new RenderShulker(this, new ModelShulker()));
    this.entityRenderMap.put(EntityPolarBear.class, new RenderPolarBear(this, new ModelPolarBear(), 0.7F));
    this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this));
    this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
    this.entityRenderMap.put(EntityWither.class, new RenderWither(this));
    this.entityRenderMap.put(Entity.class, new RenderEntity(this));
    this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this));
    this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn));
    this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this));
    this.entityRenderMap.put(EntityTippedArrow.class, new RenderTippedArrow(this));
    this.entityRenderMap.put(EntitySpectralArrow.class, new RenderSpectralArrow(this));
    this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.SNOWBALL, itemRendererIn));
    this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ENDER_PEARL, itemRendererIn));
    this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ENDER_EYE, itemRendererIn));
    this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.EGG, itemRendererIn));
    this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn));
    this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.EXPERIENCE_BOTTLE, itemRendererIn));
    this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.FIREWORKS, itemRendererIn));
    this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
    this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
    this.entityRenderMap.put(EntityDragonFireball.class, new RenderDragonFireball(this));
    this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this));
    this.entityRenderMap.put(EntityShulkerBullet.class, new RenderShulkerBullet(this));
    this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn));
    this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this));
    this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
    this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this));
    this.entityRenderMap.put(EntityArmorStand.class, new RenderArmorStand(this));
    this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
    this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
    this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this));
    this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this));
    this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this));
    this.entityRenderMap.put(EntityAreaEffectCloud.class, new RenderAreaEffectCloud(this));
    this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F));
    this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this));
    this.playerRenderer = new RenderPlayer(this);
    this.skinMap.put("default", this.playerRenderer);
    this.skinMap.put("slim", new RenderPlayer(this, true));
    net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(this, this.entityRenderMap);
}
项目:ExpandedRailsMod    文件:RenderAreaEffectCloud.java   
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityAreaEffectCloud entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
项目:ExpandedRailsMod    文件:RenderAreaEffectCloud.java   
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityAreaEffectCloud entity)
{
    return null;
}
项目:AbyssalCraft    文件:EntityDreadedCharge.java   
@Override
protected void onImpact(RayTraceResult movingObject)
{
    if (ticksExisted > 10)
    {
        if(!world.isRemote)
            for(int x = getPosition().getX() -4; x < getPosition().getX() + 4; x++)
                for(int z = getPosition().getZ() - 4; z < getPosition().getZ() + 4; z++)
                    if(!(world.getBiome(new BlockPos(x, 0, z)) instanceof IDreadlandsBiome))
                    {
                        Biome b = ACBiomes.dreadlands;
                        Chunk c = world.getChunkFromBlockCoords(getPosition());
                        c.getBiomeArray()[(z & 0xF) << 4 | x & 0xF] = (byte)Biome.getIdForBiome(b);
                        c.setModified(true);
                        PacketDispatcher.sendToDimension(new CleansingRitualMessage(x, z, Biome.getIdForBiome(b)), world.provider.getDimension());
                    }

        if (movingObject.entityHit != null) if (shootingEntity instanceof EntityLivingBase)
        {
            shootingEntity.attackEntityAsMob(movingObject.entityHit);
            movingObject.entityHit.hurtResistantTime = 0;
        }

        List<EntityLivingBase> list = world.getEntitiesWithinAABB(EntityLivingBase.class, getEntityBoundingBox().grow(8.0D));
        EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(world, posX, posY, posZ);
        //     entityareaeffectcloud.setOwner((EntityFriendlyCreature)this.shootingEntity);
        entityareaeffectcloud.setParticle(EnumParticleTypes.FLAME);
        entityareaeffectcloud.addEffect(new PotionEffect(AbyssalCraftAPI.dread_plague, 400));
        entityareaeffectcloud.setRadius(2.0F);
        entityareaeffectcloud.setDuration(200 + rand.nextInt(200));
        entityareaeffectcloud.setRadiusPerTick((3F - entityareaeffectcloud.getRadius()) / entityareaeffectcloud.getDuration());

        if (!list.isEmpty()) for (EntityLivingBase entitylivingbase : list)
        {
            double d0 = getDistanceSqToEntity(entitylivingbase);

            if (shootingEntity != null && d0 < 64.0D) entityareaeffectcloud.setPosition(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ);
        }

        for (int k = 0; k < 200; ++k)
        {
            float f2 = rand.nextFloat() * 4.0F;
            float f3 = rand.nextFloat() * ((float)Math.PI * 2F);
            double d3 = MathHelper.cos(f3) * f2;
            double d4 = 0.01D + rand.nextDouble() * 0.5D;
            double d5 = MathHelper.sin(f3) * f2;
            world.spawnParticle(EnumParticleTypes.FLAME, getPosition().getX() + d3 * 0.1D, getPosition().getY() + 0.3D, getPosition().getZ() + d5 * 0.1D, d3 * f2, d4, d5 * f2, new int[0]);
        }

        world.playSound((EntityPlayer)null, getPosition(), SoundEvents.ENTITY_ENDERDRAGON_FIREBALL_EPLD, SoundCategory.MASTER, 1.0F, world.rand.nextFloat() * 0.1F + 0.9F);

        if (!world.isRemote) world.spawnEntity(entityareaeffectcloud);
        world.newExplosion(this, posX, posY + 1.0D, posZ, 3.0F, false, false);
        setDead();
    }
}