Unable to place a block if a spectator is occupying the block
AmauryCarrade opened this issue · 14 comments
All is in the title. When a spectator is somewhere, he is invisible, without any hit-box, but we can't place a block on its location.
This can be fixed by, e.g., moving the spectator on the closest player (the one who placed the block, because there is no hit-box and the spectator can be there) if a player try to place a block somewhere and that placement is blocked by a spectator.
Hi, thanks for this idea. My problem is because although the player is invisible to players not spectating there is still an actual player there. I want to avoid teleportation as much as possible but I was aware of this bug and I think I have a solution, I just need time to implement it. Thanks!
Ah, that's interesting. But no, it's not closed yet...
If a spectator stands in between two blocks they may not be detected as blocking the block's placement. That needs fixed first.
I'll work on it soon, I'm testing the NPC fix I added at the moment to make sure it works
Why avoid teleportation? Couldn't you just teleport the player by 1 block
relative to his own location? You could use a simple for loop to verify
that nearby blocks are unoccupied.
What solution did you have in mind? I'm curious :D
Why avoid teleportation? Couldn't you just teleport the player by 1 block relative to his own location?
You could use a simple for loop to verify that nearby blocks are unoccupied.
Or teleport the spectator to the player who attempted to place a block. Because there is a place here, and — thanks to the absence of hitbox — this will not cause any problem.
What solution did you have in mind? I'm curious :D
The same :p .
Well, I have a feeling a lot of the problems with spectating will be fixed in some way for Mojang's own /gamemode spec. Hopefully that'll be added into Bukkit soon.
That said, a simple teleport might be the easiest option.... But we can't assume a teleport up 1 will be ok. What if the block was placed just below the roof?
You really don't like the idea of teleporting the spectator to the player who placed the block? :D
There isn't any check needed with this option.
Well... Actually, I suppose that would work pretty well, the more I think
about it!
I think I've fixed it, please come help me test @AmauryCarrade, if possible :)
Sorry, I'm not available currently...
Tomorrow, near 18:00 UTC, I will be available.