mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-16 17:16:11 +00:00
fix: move main-thread call to be implementation from WorldWrapper (#1991)
- Fixes #1990
This commit is contained in:
parent
bf28ab47b8
commit
0d112b2913
@ -144,7 +144,7 @@ public class BukkitWorld extends AbstractWorld {
|
||||
public List<com.sk89q.worldedit.entity.Entity> getEntities(Region region) {
|
||||
World world = getWorld();
|
||||
|
||||
List<Entity> ents = world.getEntities();
|
||||
List<Entity> ents = TaskManager.taskManager().sync(world::getEntities);
|
||||
List<com.sk89q.worldedit.entity.Entity> entities = new ArrayList<>();
|
||||
for (Entity ent : ents) {
|
||||
if (region.contains(BukkitAdapter.asBlockVector(ent.getLocation()))) {
|
||||
@ -157,7 +157,9 @@ public class BukkitWorld extends AbstractWorld {
|
||||
@Override
|
||||
public List<com.sk89q.worldedit.entity.Entity> getEntities() {
|
||||
List<com.sk89q.worldedit.entity.Entity> list = new ArrayList<>();
|
||||
for (Entity entity : getWorld().getEntities()) {
|
||||
|
||||
List<Entity> ents = TaskManager.taskManager().sync(getWorld()::getEntities);
|
||||
for (Entity entity : ents) {
|
||||
list.add(BukkitAdapter.adapt(entity));
|
||||
}
|
||||
return list;
|
||||
|
@ -320,12 +320,12 @@ public class WorldWrapper extends AbstractWorld {
|
||||
|
||||
@Override
|
||||
public List<? extends Entity> getEntities(Region region) {
|
||||
return TaskManager.taskManager().sync(() -> parent.getEntities(region));
|
||||
return parent.getEntities(region);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Entity> getEntities() {
|
||||
return TaskManager.taskManager().sync(parent::getEntities);
|
||||
return parent.getEntities();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user