Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

playEffect is broken #88

Open
socram8888 opened this issue Jun 12, 2014 · 4 comments
Open

playEffect is broken #88

socram8888 opened this issue Jun 12, 2014 · 4 comments

Comments

@socram8888
Copy link
Contributor

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?

@tonybruess
Copy link
Member

That whole patch is super sketchy and should probably be redone

@socram8888
Copy link
Contributor Author

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

@Pablete1234
Copy link
Member

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

@jedediah
Copy link
Member

jedediah commented Feb 8, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants