Mark entities as invalid when they get despawned. Addresses BUKKIT-810
Dieser Commit ist enthalten in:
Ursprung
f5b6abfae1
Commit
a21f038fc3
@ -143,6 +143,7 @@ public abstract class Entity {
|
||||
public boolean cd;
|
||||
public boolean ce;
|
||||
public UUID uniqueId = UUID.randomUUID(); // CraftBukkit
|
||||
public boolean valid = true; // CraftBukkit
|
||||
|
||||
public Entity(World world) {
|
||||
this.id = entityCount++;
|
||||
|
@ -929,6 +929,8 @@ public class World implements IBlockAccess {
|
||||
for (int i = 0; i < this.u.size(); ++i) {
|
||||
((IWorldAccess) this.u.get(i)).b(entity);
|
||||
}
|
||||
|
||||
entity.valid = false; // CraftBukkit
|
||||
}
|
||||
|
||||
public void kill(Entity entity) {
|
||||
|
@ -212,6 +212,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
return !entity.isAlive();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return entity.isAlive() && entity.valid;
|
||||
}
|
||||
|
||||
public Server getServer() {
|
||||
return server;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren