Hopeful fix for rare errors where location world somehow changes in the middle of trying to show a smoke effect

This commit is contained in:
Brettflan 2012-02-22 23:52:38 -06:00
parent 02fa6ab2c1
commit 3ff3e61dd9

View File

@ -34,7 +34,7 @@ public class SmokeUtil
public static void spawnSingle(Location location, int direction) public static void spawnSingle(Location location, int direction)
{ {
if (location == null) return; if (location == null) return;
location.getWorld().playEffect(location, Effect.SMOKE, direction); location.getWorld().playEffect(location.clone(), Effect.SMOKE, direction);
} }
public static void spawnSingle(Location location) public static void spawnSingle(Location location)
@ -70,7 +70,7 @@ public class SmokeUtil
int singles = (int) Math.floor(thickness*9); int singles = (int) Math.floor(thickness*9);
for (int i = 0; i < singles; i++) for (int i = 0; i < singles; i++)
{ {
spawnSingleRandom(location); spawnSingleRandom(location.clone());
} }
} }