@Override public void spawnParticle(String fxName, double posX, double posY, double posZ, double velX, double velY, double velZ) { World clientWorld = ForgeMod.proxy.getClientWorld(); if (clientWorld == null) { ModLoader.log().info( "Mad Particle: Could not spawn particle because client world was null!" ); return; } if (fxName.equals( "splash" )) { EntityFX someParticle = new EntitySplashFX( clientWorld, posX, posY, posZ, velX, velY, velZ ); Minecraft.getMinecraft().effectRenderer.addEffect( someParticle ); } else { // Normal minecraft particle system ignores velocity completely. clientWorld.spawnParticle( fxName, posX, posY, posZ, 0.0D, 0.0D, 0.0D ); } }
@SideOnly(Side.CLIENT) private void doTheThing(double x, double y, double z, double radius, int xzquality, int rarity, int element){ Random r = new Random(); for(int t = 0; t < 360; t++){ if((t % xzquality == 0) && (r.nextInt(rarity) == 0)){ double spawnX = x + (radius * Math.cos(Math.toRadians(t))); double spawnY = y; double spawnZ = z + (radius * Math.sin(Math.toRadians(t))); if(element == 0){ if(r.nextInt(2) == 0){ Minecraft.getMinecraft().effectRenderer.addEffect(new EntityCloudFX(Minecraft.getMinecraft().theWorld, spawnX, spawnY, spawnZ, 0, 0, 0)); } else{ Minecraft.getMinecraft().effectRenderer.addEffect(new EntitySmokeFX(Minecraft.getMinecraft().theWorld, spawnX, spawnY, spawnZ, 0, 0, 0)); } } if(element == 1){ if(r.nextInt(7) == 0){ Minecraft.getMinecraft().effectRenderer.addEffect(new EntityAvatarBubbleFX(Minecraft.getMinecraft().theWorld, spawnX, spawnY, spawnZ, 0, 0, 0)); } else{ Minecraft.getMinecraft().effectRenderer.addEffect(new EntitySplashFX(Minecraft.getMinecraft().theWorld, spawnX, spawnY, spawnZ, 0, 0, 0)); } } if(element == 2) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(Minecraft.getMinecraft().theWorld, spawnX, spawnY, spawnZ, 0, 0, 0)); } } }