Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ExplosionCustom implements Runnable {
- public final static double sqrt3 = Math.sqrt(3);
- public static boolean busyLock = false;
- List<Thread> waitingThreads = new Vector<Thread>();
- public static void doExplosion(final Entity exploder,final double r0,final boolean drop, final String type){
- System.out.println("Starting Explosion");
- final double A = 5*100; //This is a constant that corresponds to blast strength.
- final double B = 1; //This corresponds to strength of blast at max range. 1 means will damage leaves.
- final World worldObj = exploder.worldObj;
- final int rMax = Math.min((int)(Math.sqrt(A*r0/B)),128); //Maximium radius of damage (r0*A/B, 1/E)
- int realRMax = (int)(Math.sqrt(A*r0/B));
- System.out.println("Max Radius "+rMax);
- final int x0 = (int) exploder.posX;
- final int y0 = (int) exploder.posY;
- final int z0 = (int) exploder.posZ;
- final double[] centreD = {exploder.posX,exploder.posZ,exploder.posY};
- EntityExplosionFireball fireball = new EntityExplosionFireball(exploder.worldObj,centreD,r0);
- exploder.worldObj.spawnEntityInWorld(fireball);
- //*
- new Thread( new Runnable(){public void run(){
- sphereSmartV2(exploder,r0, drop, A, B, rMax);
- System.out.println("Finished Explosion");
- }} ).start();
- }
Advertisement
Add Comment
Please, Sign In to add comment