#1279: Back Particle by a minecraft registry
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -121,7 +121,12 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
|
||||
|
||||
@Override
|
||||
public <T> void setParticle(Particle particle, T data) {
|
||||
getHandle().setParticle(CraftParticle.toNMS(particle, data));
|
||||
particle = CraftParticle.convertLegacy(particle);
|
||||
data = CraftParticle.convertLegacy(data);
|
||||
if (data != null) {
|
||||
Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType());
|
||||
}
|
||||
getHandle().setParticle(CraftParticle.createParticleParam(particle, data));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2080,10 +2080,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) {
|
||||
particle = CraftParticle.convertLegacy(particle);
|
||||
data = CraftParticle.convertLegacy(data);
|
||||
if (data != null) {
|
||||
Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType());
|
||||
}
|
||||
PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(CraftParticle.toNMS(particle, data), true, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count);
|
||||
PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(CraftParticle.createParticleParam(particle, data), true, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count);
|
||||
getHandle().connection.send(packetplayoutworldparticles);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user