SpectatorPlus

SpectatorPlus

34.1k Downloads

Unable to place a block if a spectator is occupying the block

AmauryCarrade opened this issue · 14 comments

commented

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.

commented

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!

commented

Is this closed? Cf. b69e25d, c57d6c1.

By the way, you should mention the issues in the commit to reference them (put « #2 » in the commit). And you can close a commit by writing « Closed #2 » or « Fixed #2 » in the commit :) . Cf. this help page.

commented

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.

commented

What's up on this issue?

commented

I'll work on it soon, I'm testing the NPC fix I added at the moment to make sure it works

commented

OK, thanks for your answer :-) .

commented

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

commented

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 .

commented

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?

commented

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.

commented

Well... Actually, I suppose that would work pretty well, the more I think
about it!

commented

I think I've fixed it, please come help me test @AmauryCarrade, if possible :)

commented

Sorry, I'm not available currently...
Tomorrow, near 18:00 UTC, I will be available.

commented

What about now? Are you available to help test?