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;
}
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);
}
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);
}
Aggregations