Java Code Examples for net.minecraft.entity.boss.EntityDragon

The following are top voted examples for showing how to use net.minecraft.entity.boss.EntityDragon. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: MakeClayValuableAgain   File: ClayProgressionImprovements.java   View source code 6 votes vote down vote up
@SubscribeEvent
public void dropClay(LivingDropsEvent event) {
    EntityLivingBase deadEntity = event.getEntityLiving();
    World world = deadEntity.getEntityWorld();
    BlockPos position = deadEntity.getPosition();
    double x = position.getX();
    double y = position.getY();
    double z = position.getZ();
    if (deadEntity instanceof EntityWitherSkeleton) {
        if (world.rand.nextInt(10) == 5) {
            event.getDrops().add(new EntityItem(world, x, y, z, new ItemStack(Items.CLAY_BALL)));
        }
    } else if (deadEntity instanceof EntityDragon || deadEntity instanceof EntityWither) {
        event.getDrops().add(new EntityItem(world, x, y, z, new ItemStack(Items.CLAY_BALL)));
    }
}
 
Example 2
Project: DecompiledMinecraft   File: BiomeEndDecorator.java   View source code 6 votes vote down vote up
protected void genDecorations(BiomeGenBase biomeGenBaseIn)
{
    this.generateOres();

    if (this.randomGenerator.nextInt(5) == 0)
    {
        int i = this.randomGenerator.nextInt(16) + 8;
        int j = this.randomGenerator.nextInt(16) + 8;
        this.spikeGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(i, 0, j)));
    }

    if (this.field_180294_c.getX() == 0 && this.field_180294_c.getZ() == 0)
    {
        EntityDragon entitydragon = new EntityDragon(this.currentWorld);
        entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F);
        this.currentWorld.spawnEntityInWorld(entitydragon);
    }
}
 
Example 3
Project: DecompiledMinecraft   File: BiomeEndDecorator.java   View source code 6 votes vote down vote up
protected void genDecorations(BiomeGenBase biomeGenBaseIn)
{
    this.generateOres();

    if (this.randomGenerator.nextInt(5) == 0)
    {
        int i = this.randomGenerator.nextInt(16) + 8;
        int j = this.randomGenerator.nextInt(16) + 8;
        this.spikeGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(i, 0, j)));
    }

    if (this.field_180294_c.getX() == 0 && this.field_180294_c.getZ() == 0)
    {
        EntityDragon entitydragon = new EntityDragon(this.currentWorld);
        entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F);
        this.currentWorld.spawnEntityInWorld(entitydragon);
    }
}
 
Example 4
Project: DecompiledMinecraft   File: RenderDragon.java   View source code 6 votes vote down vote up
protected void rotateCorpse(EntityDragon bat, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    float f = (float)bat.getMovementOffsets(7, partialTicks)[0];
    float f1 = (float)(bat.getMovementOffsets(5, partialTicks)[1] - bat.getMovementOffsets(10, partialTicks)[1]);
    GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, 1.0F);

    if (bat.deathTime > 0)
    {
        float f2 = ((float)bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
        f2 = MathHelper.sqrt_float(f2);

        if (f2 > 1.0F)
        {
            f2 = 1.0F;
        }

        GlStateManager.rotate(f2 * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F);
    }
}
 
Example 5
Project: DecompiledMinecraft   File: LayerEnderDragonEyes.java   View source code 6 votes vote down vote up
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    this.dragonRenderer.bindTexture(TEXTURE);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthFunc(514);
    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.dragonRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.dragonRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.depthFunc(515);
}
 
Example 6
Project: BaseClient   File: BiomeEndDecorator.java   View source code 6 votes vote down vote up
protected void genDecorations(BiomeGenBase biomeGenBaseIn)
{
    this.generateOres();

    if (this.randomGenerator.nextInt(5) == 0)
    {
        int i = this.randomGenerator.nextInt(16) + 8;
        int j = this.randomGenerator.nextInt(16) + 8;
        this.spikeGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(i, 0, j)));
    }

    if (this.field_180294_c.getX() == 0 && this.field_180294_c.getZ() == 0)
    {
        EntityDragon entitydragon = new EntityDragon(this.currentWorld);
        entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F);
        this.currentWorld.spawnEntityInWorld(entitydragon);
    }
}
 
Example 7
Project: BaseClient   File: RenderDragon.java   View source code 6 votes vote down vote up
protected void rotateCorpse(EntityDragon bat, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    float f = (float)bat.getMovementOffsets(7, partialTicks)[0];
    float f1 = (float)(bat.getMovementOffsets(5, partialTicks)[1] - bat.getMovementOffsets(10, partialTicks)[1]);
    GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, 1.0F);

    if (bat.deathTime > 0)
    {
        float f2 = ((float)bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
        f2 = MathHelper.sqrt_float(f2);

        if (f2 > 1.0F)
        {
            f2 = 1.0F;
        }

        GlStateManager.rotate(f2 * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F);
    }
}
 
Example 8
Project: BaseClient   File: LayerEnderDragonEyes.java   View source code 6 votes vote down vote up
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    this.dragonRenderer.bindTexture(TEXTURE);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthFunc(514);
    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.dragonRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.dragonRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.depthFunc(515);
}
 
Example 9
Project: BaseClient   File: RenderDragon.java   View source code 6 votes vote down vote up
protected void rotateCorpse(EntityDragon bat, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    float f = (float)bat.getMovementOffsets(7, partialTicks)[0];
    float f1 = (float)(bat.getMovementOffsets(5, partialTicks)[1] - bat.getMovementOffsets(10, partialTicks)[1]);
    GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, 1.0F);

    if (bat.deathTime > 0)
    {
        float f2 = ((float)bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
        f2 = MathHelper.sqrt_float(f2);

        if (f2 > 1.0F)
        {
            f2 = 1.0F;
        }

        GlStateManager.rotate(f2 * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F);
    }
}
 
Example 10
Project: BaseClient   File: LayerEnderDragonEyes.java   View source code 6 votes vote down vote up
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    this.dragonRenderer.bindTexture(TEXTURE);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthFunc(514);
    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.dragonRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.dragonRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.depthFunc(515);
}
 
Example 11
Project: CustomWorldGen   File: LayerEnderDragonEyes.java   View source code 6 votes vote down vote up
public void doRenderLayer(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.dragonRenderer.bindTexture(TEXTURE);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
    GlStateManager.disableLighting();
    GlStateManager.depthFunc(514);
    int i = 61680;
    int j = 61680;
    int k = 0;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.dragonRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    this.dragonRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.depthFunc(515);
}
 
Example 12
Project: Backmemed   File: DragonFightManager.java   View source code 6 votes vote down vote up
public void processDragonDeath(EntityDragon dragon)
{
    if (dragon.getUniqueID().equals(this.dragonUniqueId))
    {
        this.bossInfo.setPercent(0.0F);
        this.bossInfo.setVisible(false);
        this.generatePortal(true);
        this.spawnNewGateway();

        if (!this.previouslyKilled)
        {
            this.world.setBlockState(this.world.getHeight(WorldGenEndPodium.END_PODIUM_LOCATION), Blocks.DRAGON_EGG.getDefaultState());
        }

        this.previouslyKilled = true;
        this.dragonKilled = true;
    }
}
 
Example 13
Project: Backmemed   File: DragonFightManager.java   View source code 6 votes vote down vote up
public void onCrystalDestroyed(EntityEnderCrystal crystal, DamageSource dmgSrc)
{
    if (this.respawnState != null && this.crystals.contains(crystal))
    {
        LOGGER.debug("Aborting respawn sequence");
        this.respawnState = null;
        this.respawnStateTicks = 0;
        this.resetSpikeCrystals();
        this.generatePortal(true);
    }
    else
    {
        this.findAliveCrystals();
        Entity entity = this.world.getEntityFromUuid(this.dragonUniqueId);

        if (entity instanceof EntityDragon)
        {
            ((EntityDragon)entity).onCrystalDestroyed(crystal, new BlockPos(crystal), dmgSrc);
        }
    }
}
 
Example 14
Project: Backmemed   File: PhaseManager.java   View source code 6 votes vote down vote up
public void setPhase(PhaseList<?> phaseIn)
{
    if (this.phase == null || phaseIn != this.phase.getPhaseList())
    {
        if (this.phase != null)
        {
            this.phase.removeAreaEffect();
        }

        this.phase = this.getPhase(phaseIn);

        if (!this.dragon.world.isRemote)
        {
            this.dragon.getDataManager().set(EntityDragon.PHASE, Integer.valueOf(phaseIn.getId()));
        }

        LOGGER.debug("Dragon is now in phase {} on the {}", new Object[] {phaseIn, this.dragon.world.isRemote ? "client" : "server"});
        this.phase.initPhase();
    }
}
 
Example 15
Project: Backmemed   File: RenderDragon.java   View source code 6 votes vote down vote up
protected void rotateCorpse(EntityDragon entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    float f = (float)entityLiving.getMovementOffsets(7, partialTicks)[0];
    float f1 = (float)(entityLiving.getMovementOffsets(5, partialTicks)[1] - entityLiving.getMovementOffsets(10, partialTicks)[1]);
    GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, 1.0F);

    if (entityLiving.deathTime > 0)
    {
        float f2 = ((float)entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
        f2 = MathHelper.sqrt(f2);

        if (f2 > 1.0F)
        {
            f2 = 1.0F;
        }

        GlStateManager.rotate(f2 * this.getDeathMaxRotation(entityLiving), 0.0F, 0.0F, 1.0F);
    }
}
 
Example 16
Project: CustomWorldGen   File: DragonFightManager.java   View source code 6 votes vote down vote up
public void processDragonDeath(EntityDragon dragon)
{
    if (dragon.getUniqueID().equals(this.dragonUniqueId))
    {
        this.bossInfo.setPercent(0.0F);
        this.bossInfo.setVisible(false);
        this.generatePortal(true);
        this.spawnNewGateway();

        if (!this.previouslyKilled)
        {
            this.world.setBlockState(this.world.getHeight(WorldGenEndPodium.END_PODIUM_LOCATION), Blocks.DRAGON_EGG.getDefaultState());
        }

        this.previouslyKilled = true;
        this.dragonKilled = true;
    }
}
 
Example 17
Project: CustomWorldGen   File: DragonFightManager.java   View source code 6 votes vote down vote up
public void onCrystalDestroyed(EntityEnderCrystal crystal, DamageSource dmgSrc)
{
    if (this.respawnState != null && this.crystals.contains(crystal))
    {
        LOGGER.debug("Aborting respawn sequence");
        this.respawnState = null;
        this.respawnStateTicks = 0;
        this.resetSpikeCrystals();
        this.generatePortal(true);
    }
    else
    {
        this.findAliveCrystals();
        Entity entity = this.world.getEntityFromUuid(this.dragonUniqueId);

        if (entity instanceof EntityDragon)
        {
            ((EntityDragon)entity).onCrystalDestroyed(crystal, new BlockPos(crystal), dmgSrc);
        }
    }
}
 
Example 18
Project: CustomWorldGen   File: PhaseManager.java   View source code 6 votes vote down vote up
public void setPhase(PhaseList<?> phaseIn)
{
    if (this.phase == null || phaseIn != this.phase.getPhaseList())
    {
        if (this.phase != null)
        {
            this.phase.removeAreaEffect();
        }

        this.phase = this.getPhase(phaseIn);

        if (!this.dragon.worldObj.isRemote)
        {
            this.dragon.getDataManager().set(EntityDragon.PHASE, Integer.valueOf(phaseIn.getId()));
        }

        LOGGER.debug("Dragon is now in phase {} on the {}", new Object[] {phaseIn, this.dragon.worldObj.isRemote ? "client" : "server"});
        this.phase.initPhase();
    }
}
 
Example 19
Project: CustomWorldGen   File: RenderDragon.java   View source code 6 votes vote down vote up
protected void rotateCorpse(EntityDragon entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    float f = (float)entityLiving.getMovementOffsets(7, partialTicks)[0];
    float f1 = (float)(entityLiving.getMovementOffsets(5, partialTicks)[1] - entityLiving.getMovementOffsets(10, partialTicks)[1]);
    GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, 1.0F);

    if (entityLiving.deathTime > 0)
    {
        float f2 = ((float)entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
        f2 = MathHelper.sqrt_float(f2);

        if (f2 > 1.0F)
        {
            f2 = 1.0F;
        }

        GlStateManager.rotate(f2 * this.getDeathMaxRotation(entityLiving), 0.0F, 0.0F, 1.0F);
    }
}
 
Example 20
Project: ClientAPI   File: EntityFilters.java   View source code 5 votes vote down vote up
/**
 * Checks if the specified entity is a hostile
 *
 * @param e The entity
 * @return Whether or not the entity is a hostile
 */
public static boolean isHostile(Entity e) {
    if (e instanceof EntityPigZombie)
        return isAngry((EntityPigZombie) e);

    if (e instanceof EntityIronGolem)
        return isAngry((EntityIronGolem) e);

    if (e instanceof EntityPolarBear)
        return isAngry((EntityPolarBear) e);

    if (e instanceof EntityMob)
        return true;

    if (e instanceof EntitySlime)
        return true;

    if (e instanceof EntityShulker)
        return true;

    if (e instanceof EntityGhast)
        return true;

    if (e instanceof EntityDragon)
        return true;

    return false;
}
 
Example 21
Project: Uranium   File: ActivationRange.java   View source code 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 22
Project: DecompiledMinecraft   File: RenderDragon.java   View source code 5 votes vote down vote up
/**
 * Renders the model in RenderLiving
 */
protected void renderModel(EntityDragon entitylivingbaseIn, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        float f = (float)entitylivingbaseIn.deathTicks / 200.0F;
        GlStateManager.depthFunc(515);
        GlStateManager.enableAlpha();
        GlStateManager.alphaFunc(516, f);
        this.bindTexture(enderDragonExplodingTextures);
        this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
        GlStateManager.alphaFunc(516, 0.1F);
        GlStateManager.depthFunc(514);
    }

    this.bindEntityTexture(entitylivingbaseIn);
    this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);

    if (entitylivingbaseIn.hurtTime > 0)
    {
        GlStateManager.depthFunc(514);
        GlStateManager.disableTexture2D();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(770, 771);
        GlStateManager.color(1.0F, 0.0F, 0.0F, 0.5F);
        this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
        GlStateManager.enableTexture2D();
        GlStateManager.disableBlend();
        GlStateManager.depthFunc(515);
    }
}
 
Example 23
Project: DecompiledMinecraft   File: RenderDragon.java   View source code 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityDragon entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    BossStatus.setBossStatus(entity, false);
    super.doRender(entity, x, y, z, entityYaw, partialTicks);

    if (entity.healingEnderCrystal != null)
    {
        this.drawRechargeRay(entity, x, y, z, partialTicks);
    }
}
 
Example 24
Project: BaseClient   File: RenderDragon.java   View source code 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityDragon entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    BossStatus.setBossStatus(entity, false);
    super.doRender(entity, x, y, z, entityYaw, partialTicks);

    if (entity.healingEnderCrystal != null)
    {
        this.drawRechargeRay(entity, x, y, z, partialTicks);
    }
}
 
Example 25
Project: CustomWorldGen   File: RenderDragon.java   View source code 5 votes vote down vote up
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityDragon entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    super.doRender(entity, x, y, z, entityYaw, partialTicks);

    if (entity.healingEnderCrystal != null)
    {
        this.bindTexture(ENDERCRYSTAL_BEAM_TEXTURES);
        float f = MathHelper.sin(((float)entity.healingEnderCrystal.ticksExisted + partialTicks) * 0.2F) / 2.0F + 0.5F;
        f = (f * f + f) * 0.2F;
        renderCrystalBeams(x, y, z, partialTicks, entity.posX + (entity.prevPosX - entity.posX) * (double)(1.0F - partialTicks), entity.posY + (entity.prevPosY - entity.posY) * (double)(1.0F - partialTicks), entity.posZ + (entity.prevPosZ - entity.posZ) * (double)(1.0F - partialTicks), entity.ticksExisted, entity.healingEnderCrystal.posX, (double)f + entity.healingEnderCrystal.posY, entity.healingEnderCrystal.posZ);
    }
}
 
Example 26
Project: BaseClient   File: RenderDragon.java   View source code 5 votes vote down vote up
/**
 * Renders the model in RenderLiving
 */
protected void renderModel(EntityDragon entitylivingbaseIn, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        float f = (float)entitylivingbaseIn.deathTicks / 200.0F;
        GlStateManager.depthFunc(515);
        GlStateManager.enableAlpha();
        GlStateManager.alphaFunc(516, f);
        this.bindTexture(enderDragonExplodingTextures);
        this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
        GlStateManager.alphaFunc(516, 0.1F);
        GlStateManager.depthFunc(514);
    }

    this.bindEntityTexture(entitylivingbaseIn);
    this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);

    if (entitylivingbaseIn.hurtTime > 0)
    {
        GlStateManager.depthFunc(514);
        GlStateManager.disableTexture2D();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(770, 771);
        GlStateManager.color(1.0F, 0.0F, 0.0F, 0.5F);
        this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
        GlStateManager.enableTexture2D();
        GlStateManager.disableBlend();
        GlStateManager.depthFunc(515);
    }
}
 
Example 27
Project: BaseClient   File: RenderDragon.java   View source code 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityDragon entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    BossStatus.setBossStatus(entity, false);
    super.doRender(entity, x, y, z, entityYaw, partialTicks);

    if (entity.healingEnderCrystal != null)
    {
        this.drawRechargeRay(entity, x, y, z, partialTicks);
    }
}
 
Example 28
Project: EndermanEvolution   File: EntityUtils.java   View source code 5 votes vote down vote up
public static ItemStack getSkullDrop(EntityLivingBase entity) {
	if (entity instanceof EntitySkeleton) {
		return new ItemStack(Items.SKULL, 1, 0);
	}
	if (entity instanceof EntityWitherSkeleton) {
		return new ItemStack(Items.SKULL, 1, 1);
	}
	if (entity instanceof EntityZombie) {
		return new ItemStack(Items.SKULL, 1, 2);
	}
	if (entity instanceof EntityCreeper) {
		return new ItemStack(Items.SKULL, 1, 4);
	}
	if (entity instanceof EntityPlayer) {
		ItemStack head = new ItemStack(Items.SKULL, 1, 3);
		NBTTagCompound nametag = new NBTTagCompound();
		nametag.setString("SkullOwner", entity.getDisplayName().getFormattedText());
		head.setTagCompound(nametag);
		return head;
	}
	if (entity instanceof EntityDragon) {
		return new ItemStack(Items.SKULL, 1, 5);
	}
	if (entity instanceof EntityEnderman) {
		if (entity instanceof EntityEvolvedEnderman) {
			return new ItemStack(ModItems.SKULL_EVOLVED_ENDERMAN);
		}
		return new ItemStack(ModItems.SKULL_ENDERMAN);
	}
	if (entity instanceof EntityFrienderman) {
		return new ItemStack(ModItems.SKULL_FRIENDERMAN);
	}
	return null;
}
 
Example 29
Project: Backmemed   File: DragonFightManager.java   View source code 5 votes vote down vote up
private void spawnDragon()
{
    this.world.getChunkFromBlockCoords(new BlockPos(0, 128, 0));
    EntityDragon entitydragon = new EntityDragon(this.world);
    entitydragon.getPhaseManager().setPhase(PhaseList.HOLDING_PATTERN);
    entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.world.rand.nextFloat() * 360.0F, 0.0F);
    this.world.spawnEntityInWorld(entitydragon);
    this.dragonUniqueId = entitydragon.getUniqueID();
}
 
Example 30
Project: Backmemed   File: DragonFightManager.java   View source code 5 votes vote down vote up
public void dragonUpdate(EntityDragon dragonIn)
{
    if (dragonIn.getUniqueID().equals(this.dragonUniqueId))
    {
        this.bossInfo.setPercent(dragonIn.getHealth() / dragonIn.getMaxHealth());
        this.ticksSinceDragonSeen = 0;

        if (dragonIn.hasCustomName())
        {
            this.bossInfo.setName(dragonIn.getDisplayName());
        }
    }
}
 
Example 31
Project: Backmemed   File: EntityEnderCrystal.java   View source code 5 votes vote down vote up
/**
 * Called when the entity is attacked.
 */
public boolean attackEntityFrom(DamageSource source, float amount)
{
    if (this.isEntityInvulnerable(source))
    {
        return false;
    }
    else if (source.getEntity() instanceof EntityDragon)
    {
        return false;
    }
    else
    {
        if (!this.isDead && !this.world.isRemote)
        {
            this.setDead();

            if (!this.world.isRemote)
            {
                this.world.createExplosion((Entity)null, this.posX, this.posY, this.posZ, 6.0F, true);
                this.onCrystalDestroyed(source);
            }
        }

        return true;
    }
}
 
Example 32
Project: Backmemed   File: PhaseList.java   View source code 5 votes vote down vote up
public IPhase createPhase(EntityDragon dragon)
{
    try
    {
        Constructor <? extends IPhase > constructor = this.getConstructor();
        return (IPhase)constructor.newInstance(new Object[] {dragon});
    }
    catch (Exception exception)
    {
        throw new Error(exception);
    }
}
 
Example 33
Project: Backmemed   File: RenderDragon.java   View source code 5 votes vote down vote up
/**
 * Renders the model in RenderLiving
 */
protected void renderModel(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        float f = (float)entitylivingbaseIn.deathTicks / 200.0F;
        GlStateManager.depthFunc(515);
        GlStateManager.enableAlpha();
        GlStateManager.alphaFunc(516, f);
        this.bindTexture(DRAGON_EXPLODING_TEXTURES);
        this.mainModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
        GlStateManager.alphaFunc(516, 0.1F);
        GlStateManager.depthFunc(514);
    }

    this.bindEntityTexture(entitylivingbaseIn);
    this.mainModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);

    if (entitylivingbaseIn.hurtTime > 0)
    {
        GlStateManager.depthFunc(514);
        GlStateManager.disableTexture2D();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 0.0F, 0.0F, 0.5F);
        this.mainModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
        GlStateManager.enableTexture2D();
        GlStateManager.disableBlend();
        GlStateManager.depthFunc(515);
    }
}
 
Example 34
Project: Backmemed   File: RenderDragon.java   View source code 5 votes vote down vote up
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityDragon entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    super.doRender(entity, x, y, z, entityYaw, partialTicks);

    if (entity.healingEnderCrystal != null)
    {
        this.bindTexture(ENDERCRYSTAL_BEAM_TEXTURES);
        float f = MathHelper.sin(((float)entity.healingEnderCrystal.ticksExisted + partialTicks) * 0.2F) / 2.0F + 0.5F;
        f = (f * f + f) * 0.2F;
        renderCrystalBeams(x, y, z, partialTicks, entity.posX + (entity.prevPosX - entity.posX) * (double)(1.0F - partialTicks), entity.posY + (entity.prevPosY - entity.posY) * (double)(1.0F - partialTicks), entity.posZ + (entity.prevPosZ - entity.posZ) * (double)(1.0F - partialTicks), entity.ticksExisted, entity.healingEnderCrystal.posX, (double)f + entity.healingEnderCrystal.posY, entity.healingEnderCrystal.posZ);
    }
}
 
Example 35
Project: Backmemed   File: LayerEnderDragonEyes.java   View source code 5 votes vote down vote up
public void doRenderLayer(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.dragonRenderer.bindTexture(TEXTURE);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
    GlStateManager.disableLighting();
    GlStateManager.depthFunc(514);
    int i = 61680;
    int j = 61680;
    int k = 0;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    Minecraft.getMinecraft().entityRenderer.func_191514_d(true);

    if (Config.isShaders())
    {
        Shaders.beginSpiderEyes();
    }

    Config.getRenderGlobal().renderOverlayEyes = true;
    this.dragonRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    Config.getRenderGlobal().renderOverlayEyes = false;
    Minecraft.getMinecraft().entityRenderer.func_191514_d(false);
    this.dragonRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.depthFunc(515);
}
 
Example 36
Project: IceMod   File: IceLands.java   View source code 5 votes vote down vote up
public IceLands(int par1)
{
    super(par1);
    
    this.setBiomeName("Icelands");
    
    this.topBlock = (byte)IceMod.IcyOre.blockID;
    this.fillerBlock = (byte)Block.ice.blockID;
    
    this.theBiomeDecorator.bigMushroomsPerChunk = 10;
    this.theBiomeDecorator.treesPerChunk = 5;
    this.theBiomeDecorator.clayPerChunk  = 3;
    this.theBiomeDecorator.reedsPerChunk = 1;

    this.spawnableMonsterList.add(new SpawnListEntry(EntitySnowman.class, 25, 4, 8));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 25, 4, 8));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityDragon.class, 1, 1, 1));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityIronGolem.class, 1, 1, 1));
    
    this.setMinMaxHeight(0.1F, 0.5F);
    //mnmx
    this.setTemperatureRainfall(0.7F, 0.2F);
   
}
 
Example 37
Project: CustomWorldGen   File: DragonFightManager.java   View source code 5 votes vote down vote up
private void spawnDragon()
{
    this.world.getChunkFromBlockCoords(new BlockPos(0, 128, 0));
    EntityDragon entitydragon = new EntityDragon(this.world);
    entitydragon.getPhaseManager().setPhase(PhaseList.HOLDING_PATTERN);
    entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.world.rand.nextFloat() * 360.0F, 0.0F);
    this.world.spawnEntityInWorld(entitydragon);
    this.dragonUniqueId = entitydragon.getUniqueID();
}
 
Example 38
Project: CustomWorldGen   File: DragonFightManager.java   View source code 5 votes vote down vote up
public void dragonUpdate(EntityDragon dragonIn)
{
    if (dragonIn.getUniqueID().equals(this.dragonUniqueId))
    {
        this.bossInfo.setPercent(dragonIn.getHealth() / dragonIn.getMaxHealth());
        this.ticksSinceDragonSeen = 0;
    }
}
 
Example 39
Project: CustomWorldGen   File: EntityEnderCrystal.java   View source code 5 votes vote down vote up
/**
 * Called when the entity is attacked.
 */
public boolean attackEntityFrom(DamageSource source, float amount)
{
    if (this.isEntityInvulnerable(source))
    {
        return false;
    }
    else if (source.getEntity() instanceof EntityDragon)
    {
        return false;
    }
    else
    {
        if (!this.isDead && !this.worldObj.isRemote)
        {
            this.setDead();

            if (!this.worldObj.isRemote)
            {
                this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, 6.0F, true);
                this.onCrystalDestroyed(source);
            }
        }

        return true;
    }
}
 
Example 40
Project: CustomWorldGen   File: PhaseList.java   View source code 5 votes vote down vote up
public IPhase createPhase(EntityDragon dragon)
{
    try
    {
        Constructor <? extends IPhase > constructor = this.getConstructor();
        return (IPhase)constructor.newInstance(new Object[] {dragon});
    }
    catch (Exception exception)
    {
        throw new Error(exception);
    }
}