mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Control flow improvements.
This commit is contained in:
parent
eacd147694
commit
878c26a8f0
@ -1297,12 +1297,14 @@ public void simulateBlockMine(Vector pt) {
|
|||||||
public LocalEntity[] getEntities(Region region) {
|
public LocalEntity[] getEntities(Region region) {
|
||||||
List<BukkitEntity> entities = new ArrayList<BukkitEntity>();
|
List<BukkitEntity> entities = new ArrayList<BukkitEntity>();
|
||||||
for (Vector2D pt : region.getChunks()) {
|
for (Vector2D pt : region.getChunks()) {
|
||||||
if (world.isChunkLoaded(pt.getBlockX(), pt.getBlockZ())) {
|
if (!world.isChunkLoaded(pt.getBlockX(), pt.getBlockZ())) {
|
||||||
Entity[] ents = world.getChunkAt(pt.getBlockX(), pt.getBlockZ()).getEntities();
|
continue;
|
||||||
for (Entity ent : ents) {
|
}
|
||||||
if (region.contains(BukkitUtil.toVector(ent.getLocation()))) {
|
|
||||||
entities.add(BukkitUtil.toLocalEntity(ent));
|
final Entity[] ents = world.getChunkAt(pt.getBlockX(), pt.getBlockZ()).getEntities();
|
||||||
}
|
for (Entity ent : ents) {
|
||||||
|
if (region.contains(BukkitUtil.toVector(ent.getLocation()))) {
|
||||||
|
entities.add(BukkitUtil.toLocalEntity(ent));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user