mirror of
https://github.com/Anime-Game-Servers/Grasscutter-Quests.git
synced 2024-11-23 04:29:42 +00:00
Implement Hartie suggestions
This commit is contained in:
parent
978ee9c940
commit
e05bb01e0c
@ -10,6 +10,7 @@ import org.anime_game_servers.multi_proto.gi.messages.scene.entity.SceneEntityIn
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
public class EntityRegion extends GameEntity{
|
||||
@ -72,6 +73,16 @@ public class EntityRegion extends GameEntity{
|
||||
this.entityLeave = false;
|
||||
this.leftEntities.clear();
|
||||
}
|
||||
|
||||
public void clearDeadEntities() {
|
||||
entities.removeAll(entities.stream()
|
||||
.filter(entity -> this.getScene().getEntityById(entity.id) == null)
|
||||
.collect(Collectors.toSet()));
|
||||
notContainEntities.removeAll(notContainEntities.stream()
|
||||
.filter(entity -> this.getScene().getEntityById(entity.id) == null)
|
||||
.collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
@Override public Int2FloatMap getFightProperties() {return null;}
|
||||
|
||||
@Override public Position getPosition() {return position;}
|
||||
|
@ -570,6 +570,7 @@ public class SceneScriptManager {
|
||||
|
||||
for (var region : this.regions.values()) {
|
||||
val metaRegion = region.getMetaRegion();
|
||||
region.clearDeadEntities();
|
||||
|
||||
getScene().getEntities().values().stream()
|
||||
.filter(e -> e.getEntityType() == EntityType.Avatar)
|
||||
|
Loading…
Reference in New Issue
Block a user