Skip to content
Permalink
Browse files

Erase the chair entity if the player is missing.

  • Loading branch information...
me4502 committed Aug 24, 2016
1 parent 0f5194c commit dc58bfa98a7bdba196bc292f9db90ef199d96062
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/java/com/sk89q/craftbook/mechanics/Chair.java
@@ -265,7 +265,9 @@ public void run() {
for (Map.Entry<String, ChairData> pl : chairs.entrySet()) {
Player p = Bukkit.getPlayerExact(pl.getKey());
if (p == null || p.isDead()) {
chairs.remove(pl.getKey());
ChairData data = chairs.remove(pl.getKey());
if (data != null && data.chairEntity != null)
data.chairEntity.remove();
continue;
}

5 comments on commit dc58bfa

@mibby

This comment has been minimized.

Copy link

replied Aug 28, 2016

@me4502 I assume previous entities prior to this commit won't be removed? Apparently chairs using armorstands sometimes leaves the armorstand behind when you destroy them. The armorstand is invisible and has no gravity so it just stays there forever, unable to be destroyed.

@me4502

This comment has been minimized.

Copy link
Member Author

replied Aug 28, 2016

Currently it doesn't destroy prior ones sorry, I can't really just make it destroy the armour stands as a lot of servers use invisible gravity-less armour stands for other things

@mibby

This comment has been minimized.

Copy link

replied Aug 28, 2016

Hm, alright. Going to be tricky finding all the invisible gravity-less stands created globally. :P Hopefully there isn't too many that would cause performance problems.

@ryantheleach

This comment has been minimized.

Copy link

replied Aug 30, 2016

You could possibly use entity selectors to make it somewhat easier.

@mibby

This comment has been minimized.

Copy link

replied Aug 30, 2016

Large community + large world = time consuming. Would rather not have to go chunk-by-chunk to delete invisible, grav-less armor stands. And even more so, would rather not start wiping all armor stands globally since they are used in other things. :P I'll just let it be and hope there aren't too many congested somewhere that would cause performance degradation.

Please sign in to comment.
You can’t perform that action at this time.