Permalink
Browse files

Added the code for NoLagg

  • Loading branch information...
1 parent e60660f commit bbfb4520cdc96cf4c5bffcf6e7e86c8dd9c166e4 @snowleo committed Dec 15, 2011
@@ -36,6 +36,7 @@
private final static int MAX_PARTICLES = 200;
private transient ParticleStorage storage;
private transient Set<String> worlds = Collections.emptySet();
+ private transient boolean spawning = false;
@Override
public void onDisable()
@@ -169,4 +170,16 @@ public boolean isWorldEnabled(final World world)
{
return worlds.isEmpty() || worlds.contains(world.getName());
}
+
+ @Override
+ public boolean isSpawning()
+ {
+ return spawning;
+ }
+
+ @Override
+ public void setSpawning(boolean spawning)
+ {
+ this.spawning = spawning;
+ }
}
@@ -26,4 +26,8 @@
ParticleStorage getStorage();
boolean isWorldEnabled(World world);
+
+ boolean isSpawning();
+
+ void setSpawning(boolean set);
}
@@ -82,7 +82,9 @@ else if (rand > (99 - type.getBoneChance()))
mat = type.getParticleMaterial();
stack = new ItemStack(mat, 1);
}
+ plugin.setSpawning(true);
item = loc.getWorld().dropItemNaturally(loc, stack);
+ plugin.setSpawning(false);
plugin.getStorage().addParticleItem(((CraftItem)item).getUniqueId(), this);
state = State.SPAWNED;
scheduler.scheduleSyncDelayedTask(plugin, this, lifetime);

0 comments on commit bbfb452

Please sign in to comment.