mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-27 13:15:55 +01:00
Resolve particle effects correctly on MC 1.8.8, fixes #1231
This commit is contained in:
parent
06fa805a3c
commit
77bc015340
@ -12,10 +12,6 @@
|
||||
|
||||
package me.blackvein.quests.particle;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public enum PreBuiltParticle {
|
||||
@ -33,12 +29,6 @@ public enum PreBuiltParticle {
|
||||
SPLASH("splash", 0, 0, 0, 1, 4, new Vector(0, .5, 0)),
|
||||
SMOKE("smoke", 0, 1, 0, 1, 20);
|
||||
|
||||
private static Map<String, PreBuiltParticle> FROM_IDENTIFIER = new HashMap<>();
|
||||
|
||||
static {
|
||||
Stream.of(values()).forEach(p -> FROM_IDENTIFIER.put(p.identifier, p));
|
||||
}
|
||||
|
||||
private String identifier;
|
||||
private float offsetX, offsetY, offsetZ, speed;
|
||||
private int count;
|
||||
@ -99,6 +89,6 @@ public enum PreBuiltParticle {
|
||||
* @return the PreBuiltParticle represented by the specified identifier
|
||||
*/
|
||||
public static PreBuiltParticle fromIdentifier(String identifier) {
|
||||
return FROM_IDENTIFIER.get(identifier);
|
||||
return valueOf(identifier);
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,11 @@ public class NpcEffectThread implements Runnable {
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
Location eyeLoc = npc.getEntity().getLocation();
|
||||
eyeLoc.setY(eyeLoc.getY() + 2);
|
||||
try {
|
||||
ParticleProvider.sendToPlayer(player, eyeLoc, effectType.toUpperCase());
|
||||
} catch (NoClassDefFoundError e) {
|
||||
// Unsupported Minecraft version
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user