use of micdoodle8.mods.galacticraft.planets.mars.client.fx.EntityCryoFX in project Galacticraft by micdoodle8.
the class AsteroidsModuleClient method spawnParticle.
@Override
public void spawnParticle(String particleID, Vector3 position, Vector3 motion, Object... extraData) {
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc != null && mc.getRenderViewEntity() != null && mc.effectRenderer != null) {
double dX = mc.getRenderViewEntity().posX - position.x;
double dY = mc.getRenderViewEntity().posY - position.y;
double dZ = mc.getRenderViewEntity().posZ - position.z;
EntityFX particle = null;
double viewDistance = 64.0D;
if (dX * dX + dY * dY + dZ * dZ < viewDistance * viewDistance) {
if (particleID.equals("portalBlue")) {
particle = new EntityFXTeleport(mc.theWorld, position, motion, (TileEntityShortRangeTelepad) extraData[0], (Boolean) extraData[1]);
} else if (particleID.equals("cryoFreeze")) {
particle = new EntityCryoFX(mc.theWorld, position, motion);
}
}
if (particle != null) {
particle.prevPosX = particle.posX;
particle.prevPosY = particle.posY;
particle.prevPosZ = particle.posZ;
mc.effectRenderer.addEffect(particle);
}
}
}
Aggregations