SpectatorPlus

SpectatorPlus

34.1k Downloads

Collisions no longer removed for spectators

AmauryCarrade opened this issue · 7 comments

commented

The collisions are no longer removed for spectators if the server is running Minecraft 1.9+ (tested with Minecraft 1.9.2, latest Spigot build).

I only seen this bug with animals, but I suppose the problem is the same with players—a potentially big issue because with Minecraft 1.9, players can push themselves so spectators would be able to push players on a cliff or similar.

commented

Version 1.8 Spigot or Bukkit? All versions?

commented

Aha! The setCollidesWithEntities method we use is deprecated. We should be using this instead: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#setCollidable(boolean)

commented

It happens in servers running 1.8 as well. And the spectator wouldn't be able to push players, but yes vice-versa

commented

@pgmann 1.8.8 Spigot

commented

Hmm, I can't seem to get the Reflection API to work... Can you test it please @AmauryCarrade?

commented
player.setCollidable(collides); //works on spigot-api 1.9(.4)
Reflection.call(player.getClass(), player, "setCollidable", collides); //doesn't work
commented

“Doesn't works” means?

The API guess native data types (like boolean instead of Boolean in the signature) sometimes wrongly; in this case you have to use the Java refection APIs directly, currently at least.