Last active
April 8, 2020 11:19
-
-
Save DarkSeraphim/8bff47989adaa6498e07a118691864e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Particles { | |
static Particles LT9 = new ParticlesLT9(); | |
static Particles GE9 = new ParticlesGE9(); | |
void summonParticles(Player p, String particles); | |
private static Particles getParticles() { | |
return getVersionNumber() < 9 ? LE9 : GE9; | |
} | |
static void summonParticles(Player p, String particles) { | |
getParticles().summonParticles(p, particles); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ParticlesGE9 implements Particles { | |
@Override | |
public void summonParticles(Player p, String particles) { | |
p.spawnParticle(XParticle.getParticle(particles), p.getLocation(), 20, 2D, 2D, 2D, 0.2D); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ParticlesLT9 implements Particles { | |
@Override | |
public void summonParticles(Player p, String particles) { | |
ParticleEffect.fromName(particles).display(2F, 2F, 2F, 0.2F, 25, p.getLocation(), 12D); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment