Search in sources :

Example 1 with EntityFlicker

use of am2.entities.EntityFlicker in project ArsMagica2 by Mithion.

the class TileEntityFlickerLure method updateEntity.

@Override
public void updateEntity() {
    super.updateEntity();
    if (worldObj.isRemote)
        return;
    if (worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) {
        if (worldObj.rand.nextDouble() < 0.005f && PowerNodeRegistry.For(worldObj).checkPower(this, 100)) {
            EntityFlicker flicker = new EntityFlicker(worldObj);
            flicker.setPosition(xCoord + 0.5f, yCoord + 1.5f, zCoord + 0.5f);
            worldObj.spawnEntityInWorld(flicker);
            PowerNodeRegistry.For(worldObj).consumePower(this, PowerNodeRegistry.For(worldObj).getHighestPowerType(this), 100);
        }
    }
}
Also used : EntityFlicker(am2.entities.EntityFlicker)

Example 2 with EntityFlicker

use of am2.entities.EntityFlicker in project ArsMagica2 by Mithion.

the class GuiArcaneCompendium method renderEntityIntoUI.

private void renderEntityIntoUI() {
    Render render = (Render) RenderManager.instance.entityRenderMap.get(entryEntity.getClass());
    if (render != null) {
        GL11.glPushMatrix();
        if (entryEntity instanceof IArsMagicaBoss) {
            float scaleFactorX = (1 / entryEntity.width);
            float scaleFactorY = (2 / entryEntity.height);
            GL11.glScalef(scaleFactorX, scaleFactorY, scaleFactorX);
        } else if (entryEntity instanceof EntityFlicker) {
            GL11.glTranslatef(0, 1.3f, 0);
        }
        GL11.glRotatef(curRotationH, 0, 1, 0);
        //entity, x, y, z, yaw, partialtick
        render.doRender(entryEntity, 0, 0, 0, 90, 0);
        GL11.glPopMatrix();
    }
}
Also used : Render(net.minecraft.client.renderer.entity.Render) IArsMagicaBoss(am2.bosses.IArsMagicaBoss) EntityFlicker(am2.entities.EntityFlicker)

Example 3 with EntityFlicker

use of am2.entities.EntityFlicker in project ArsMagica2 by Mithion.

the class AMEventHandler method onEndermanTeleport.

@SubscribeEvent
public void onEndermanTeleport(EnderTeleportEvent event) {
    EntityLivingBase ent = event.entityLiving;
    ArrayList<Long> keystoneKeys = KeystoneUtilities.instance.GetKeysInInvenory(ent);
    TileEntityAstralBarrier blockingBarrier = DimensionUtilities.GetBlockingAstralBarrier(event.entityLiving.worldObj, (int) event.targetX, (int) event.targetY, (int) event.targetZ, keystoneKeys);
    if (ent.isPotionActive(BuffList.astralDistortion.id) || blockingBarrier != null) {
        event.setCanceled(true);
        if (blockingBarrier != null) {
            blockingBarrier.onEntityBlocked(ent);
        }
        return;
    }
    if (!ent.worldObj.isRemote && ent instanceof EntityEnderman && ent.worldObj.rand.nextDouble() < 0.01f) {
        EntityFlicker flicker = new EntityFlicker(ent.worldObj);
        flicker.setPosition(ent.posX, ent.posY, ent.posZ);
        flicker.setFlickerType(Affinity.ENDER);
        ent.worldObj.spawnEntityInWorld(flicker);
    }
}
Also used : TileEntityAstralBarrier(am2.blocks.tileentities.TileEntityAstralBarrier) EntityFlicker(am2.entities.EntityFlicker) EntityEnderman(net.minecraft.entity.monster.EntityEnderman) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Example 4 with EntityFlicker

use of am2.entities.EntityFlicker in project ArsMagica2 by Mithion.

the class ModelFlicker method render.

@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    super.render(entity, f, f1, f2, f3, f4, f5);
    Affinity aff = ((EntityFlicker) entity).getFlickerAffinity();
    GL11.glPushMatrix();
    GL11.glColor3f(((aff.color >> 16) & 0xFF) / 255.0f, ((aff.color >> 8) & 0xFF) / 255.0f, (aff.color & 0xFF) / 255.0f);
    GL11.glTranslatef(-0.05f, 1.3f, -0.05f);
    GL11.glRotatef(-entity.rotationPitch, 1, 0, 0);
    GL11.glScalef(0.5f, 0.5f, 0.5f);
    Body.render(f5);
    Head.render(f5);
    RightArm.render(f5);
    LeftArm.render(f5);
    LegBase.render(f5);
    RightHorn.render(f5);
    LeftHorn.render(f5);
    GL11.glPopMatrix();
}
Also used : Affinity(am2.api.spell.enums.Affinity) EntityFlicker(am2.entities.EntityFlicker)

Aggregations

EntityFlicker (am2.entities.EntityFlicker)4 Affinity (am2.api.spell.enums.Affinity)1 TileEntityAstralBarrier (am2.blocks.tileentities.TileEntityAstralBarrier)1 IArsMagicaBoss (am2.bosses.IArsMagicaBoss)1 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 Render (net.minecraft.client.renderer.entity.Render)1 EntityEnderman (net.minecraft.entity.monster.EntityEnderman)1