Fix particles for 1.8, fixes #718

This commit is contained in:
BuildTools 2019-03-02 23:13:58 -05:00
parent bf2b1dd98d
commit 0146ce1f41
4 changed files with 4 additions and 3 deletions

View File

@ -27,7 +27,7 @@ public abstract class ParticleProvider {
String packageName = ParticleProvider.class.getPackage().getName(); String packageName = ParticleProvider.class.getPackage().getName();
String internalsName = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; String internalsName = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
if (internalsName.startsWith("v1_8_R")) { if (internalsName.startsWith("v1_8_R")) {
loaded = (ParticleProvider) Class.forName(packageName + "." + internalsName).newInstance(); loaded = (ParticleProvider) Class.forName(packageName + ".ParticleProvider_" + internalsName).newInstance();
} else { } else {
loaded = new ParticleProvider_Bukkit(); loaded = new ParticleProvider_Bukkit();
} }
@ -121,7 +121,8 @@ public abstract class ParticleProvider {
if (particle.getVector() != null) { if (particle.getVector() != null) {
pos.add(particle.getVector()); pos.add(particle.getVector());
} }
loaded.spawnParticle(player, pos, loaded.getParticleMap().get(particle), particle.getOffsetX(), particle.getOffsetY(), particle.getOffsetZ(), particle.getSpeed(), particle.getCount(), null); loaded.spawnParticle(player, pos,
loaded.getParticleMap().get(particle),
particle.getOffsetX(), particle.getOffsetY(), particle.getOffsetZ(), particle.getSpeed(), particle.getCount(), null);
} }
} }