diff --git a/src/main/java/electroblob/wizardry/util/ParticleBuilder.java b/src/main/java/electroblob/wizardry/util/ParticleBuilder.java index a4ea6725..06f1313b 100644 --- a/src/main/java/electroblob/wizardry/util/ParticleBuilder.java +++ b/src/main/java/electroblob/wizardry/util/ParticleBuilder.java @@ -17,7 +17,8 @@ import net.minecraft.world.World; * types in wizardry made the method overloads in the proxies very cumbersome and inevitably resulted in redundant * parameters, which made the code messy and hard to read. Those methods have now been removed. *
- * It also goes without saying that this class should only ever be used client-side. + * It also goes without saying that this class should only ever be used client-side. Attempting to spawn particles + * on the server side will not work and will print a warning to the console. *
* {@link ParticleBuilder#instance} retrieves the static instance of the particle builder. Use * {@link ParticleBuilder#particle(Type)} to start building a particle, or alternatively use the static @@ -335,6 +336,14 @@ public final class ParticleBuilder { if(y < 0 && entity == null) Wizardry.logger.warn("Spawning particle below y = 0 - are you sure the position/entity" + "has been set correctly?"); + if(!world.isRemote){ + Wizardry.logger.warn("ParticleBuilder.spawn(...) called on the server side! ParticleBuilder has prevented a" + + "server crash, but calling it on the server will do nothing. Consider adding a world.isRemote check."); + // Must stop here because the line after this if statement would crash the server! + reset(); + return; + } + electroblob.wizardry.client.particle.ParticleWizardry particle = Wizardry.proxy.createParticle(type, world, x, y, z); if(particle == null){