Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 18:40:05 +01:00
fix: move main-thread call to be implementation from WorldWrapper (#1991)
- Fixes #1990
Dieser Commit ist enthalten in:
Ursprung
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
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren