mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 03:26:44 +01:00
Fixed crashing when loaded on a server
This commit is contained in:
parent
f47ad82999
commit
e6f8bb47dd
4 changed files with 14 additions and 6 deletions
|
@ -125,8 +125,10 @@ public class Unicopia implements IGuiHandler {
|
|||
.listenFor(MsgPlayerCapabilities.class)
|
||||
.listenFor(MsgPlayerAbility.class);
|
||||
|
||||
MAGIC_PARTICLE = Particles.instance().registerParticle(new EntityMagicFX.Factory());
|
||||
RAIN_PARTICLE = Particles.instance().registerParticle(new EntityRaindropFX.Factory());
|
||||
if (event.getSide().isClient()) {
|
||||
MAGIC_PARTICLE = Particles.instance().registerParticle(new EntityMagicFX.Factory());
|
||||
RAIN_PARTICLE = Particles.instance().registerParticle(new EntityRaindropFX.Factory());
|
||||
}
|
||||
|
||||
PowersRegistry.instance().init();
|
||||
|
||||
|
|
|
@ -102,7 +102,10 @@ public class PowerGrow implements IPower<Location> {
|
|||
@Override
|
||||
public void preApply(IPlayer player) {
|
||||
player.addExertion(3);
|
||||
IPower.spawnParticles(Unicopia.MAGIC_PARTICLE, player, 1);
|
||||
|
||||
if (player.getWorld().isRemote) {
|
||||
IPower.spawnParticles(Unicopia.MAGIC_PARTICLE, player, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -157,11 +157,15 @@ public class PowerTeleport implements IPower<Location> {
|
|||
public void preApply(IPlayer player) {
|
||||
player.addExertion(3);
|
||||
|
||||
IPower.spawnParticles(Unicopia.MAGIC_PARTICLE, player, 5);
|
||||
if (player.getWorld().isRemote) {
|
||||
IPower.spawnParticles(Unicopia.MAGIC_PARTICLE, player, 5);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postApply(IPlayer player) {
|
||||
IPower.spawnParticles(Unicopia.MAGIC_PARTICLE, player, 5);
|
||||
if (player.getWorld().isRemote) {
|
||||
IPower.spawnParticles(Unicopia.MAGIC_PARTICLE, player, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ public class SpellShield extends AbstractSpell {
|
|||
}
|
||||
|
||||
protected void spawnParticles(ICaster<?> source, int strength) {
|
||||
|
||||
source.spawnParticles(new Sphere(true, strength), strength * 6, pos -> {
|
||||
Particles.instance().spawnParticle(Unicopia.MAGIC_PARTICLE, false, pos.x, pos.y, pos.z, 0, 0, 0);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue