SportBukkit icon indicating copy to clipboard operation
SportBukkit copied to clipboard

playEffect is broken

Open socram8888 opened this issue 11 years ago • 4 comments

Somehow, the following code works correctly on Bukkit, and not on SportBukkit:

world.playEffect(entity.getLocation(), org.bukkit.Effect.SMOKE, 1);

The effect should have a different direction based on the last parameter. SportBukkit is ignoring it.

I've also notified some useless code whose purpose I don't understand:

            StringBuilder particleFullName = new StringBuilder();
            particleFullName.append(effect.getName());

            if (effect.getData() != null && (effect.getData().equals(Material.class) || effect.getData().equals(MaterialData.class))) {
                particleFullName.append('_').append(id);
            }

            if (effect.getData() != null && effect.getData().equals(MaterialData.class)) {
                particleFullName.append('_').append(data);
            }

            packet = new PacketPlayOutWorldParticles(effect.getName(), (float)location.getX(), (float)location.getY(), (float)location.getZ(), offsetX, offsetY, offsetZ, particleCount, radius);
        }

What is the purpouse of particleFullName? Is it something from an older version which is not needed anymore, or is the PacketPlayOutWorldParticles call incorrect and you've forgot to pass the particleFullName parameter?

socram8888 avatar Jun 12 '14 17:06 socram8888

That whole patch is super sketchy and should probably be redone

tonybruess avatar Jun 12 '14 21:06 tonybruess

This bug still affects real1.8 branch. As of now, effects which take block type or block metadata aren't working anymore.

socram8888 avatar May 01 '15 15:05 socram8888

As of 1.8.7 this is still an issue, if you try to player.PlayEffect / world.PlayEffect with tile break, the client in range of the particle will get kicked from the server, because as http://wiki.vg/Protocol#Particle says, the last field should be 2, 1 or 0, and sportbukkit seems always to be sending 4, and cause a index out of bounds exception on the client

image

Pablete1234 avatar Feb 08 '16 17:02 Pablete1234

I have no clue what's wrong with the particle code, but I probably won't touch it until after 1.9, at the earliest. An upstream fix would be ideal, since that seems to be where the problem is.

jedediah avatar Feb 08 '16 18:02 jedediah