Search in sources :

Example 1 with EffectRenderer

use of net.minecraft.client.particle.EffectRenderer in project ICBM-Classic by BuiltBrokenModding.

the class ClientProxy method getEntityFXs.

@Override
public List<Entity> getEntityFXs() {
    if (!this.disableReflectionFX) {
        try {
            EffectRenderer renderer = Minecraft.getMinecraft().effectRenderer;
            List[] fxLayers = (List[]) ReflectionHelper.getPrivateValue(EffectRenderer.class, renderer, 2);
            return fxLayers[0];
        } catch (Exception e) {
            ICBMClassic.INSTANCE.logger().error("Failed to use refection on entity effects.", e);
            this.disableReflectionFX = true;
        }
    }
    return null;
}
Also used : EffectRenderer(net.minecraft.client.particle.EffectRenderer) List(java.util.List)

Example 2 with EffectRenderer

use of net.minecraft.client.particle.EffectRenderer in project BetterRain by OreCruncher.

the class DamageEffectHandler method handleEvent.

@SideOnly(Side.CLIENT)
public static void handleEvent(final HealthData data) {
    if (!ModOptions.enableDamagePopoffs)
        return;
    // Don't show the players pop-offs
    if (EnvironState.isPlayer(data.entityId))
        return;
    // Don't want to display if too far away.
    final double distance = EnvironState.distanceToPlayer(data.posX, data.posY, data.posZ);
    if (distance >= DISTANCE_THRESHOLD_SQ)
        return;
    final World world = EnvironState.getWorld();
    final EffectRenderer renderer = Minecraft.getMinecraft().effectRenderer;
    EntityFX fx;
    if (data.isCritical) {
        fx = new EntityCriticalPopOffFX(world, data.posX, data.posY, data.posZ);
        renderer.addEffect(fx);
    }
    if (data.amount > 0) {
        fx = new EntityDamagePopOffFX(world, data.posX, data.posY, data.posZ, data.amount);
    } else {
        fx = new EntityHealPopOffFX(world, data.posX, data.posY, data.posZ, MathHelper.abs_int(data.amount));
    }
    renderer.addEffect(fx);
}
Also used : EntityCriticalPopOffFX(org.blockartistry.mod.DynSurround.client.fx.particle.EntityCriticalPopOffFX) EffectRenderer(net.minecraft.client.particle.EffectRenderer) EntityHealPopOffFX(org.blockartistry.mod.DynSurround.client.fx.particle.EntityHealPopOffFX) EntityFX(net.minecraft.client.particle.EntityFX) EntityDamagePopOffFX(org.blockartistry.mod.DynSurround.client.fx.particle.EntityDamagePopOffFX) World(net.minecraft.world.World) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 3 with EffectRenderer

use of net.minecraft.client.particle.EffectRenderer in project BetterStorage by copygirl.

the class PacketPresentOpen method handle.

@Override
public void handle(EntityPlayer player) {
    TileEntityPresent present = WorldUtils.get(player.worldObj, x, y, z, TileEntityPresent.class);
    EffectRenderer effRender = Minecraft.getMinecraft().effectRenderer;
    if (present != null)
        for (int side = 0; side < 6; side++) for (int i = 0; i < (destroy ? 2 : 20); i++) if (destroy)
            effRender.addBlockDestroyEffects(x, y, z, present.getBlockType(), present.getBlockMetadata());
        else
            effRender.addBlockHitEffects(x, y, z, side);
}
Also used : TileEntityPresent(net.mcft.copy.betterstorage.tile.entity.TileEntityPresent) EffectRenderer(net.minecraft.client.particle.EffectRenderer)

Aggregations

EffectRenderer (net.minecraft.client.particle.EffectRenderer)3 List (java.util.List)1 TileEntityPresent (net.mcft.copy.betterstorage.tile.entity.TileEntityPresent)1 EntityFX (net.minecraft.client.particle.EntityFX)1 World (net.minecraft.world.World)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1 EntityCriticalPopOffFX (org.blockartistry.mod.DynSurround.client.fx.particle.EntityCriticalPopOffFX)1 EntityDamagePopOffFX (org.blockartistry.mod.DynSurround.client.fx.particle.EntityDamagePopOffFX)1 EntityHealPopOffFX (org.blockartistry.mod.DynSurround.client.fx.particle.EntityHealPopOffFX)1