mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Implement missing AsyncChunk#getTileEntities
This commit is contained in:
parent
6e49427b26
commit
71059505d1
@ -6,6 +6,7 @@ import com.boydti.fawe.util.TaskManager;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -14,6 +15,8 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class AsyncChunk implements Chunk {
|
||||
@ -120,6 +123,16 @@ public class AsyncChunk implements Chunk {
|
||||
return TaskManager.IMP.sync(() -> world.getChunkAt(x, z).getTileEntities(useSnapshot));
|
||||
}
|
||||
|
||||
@NotNull @Override
|
||||
public Collection<BlockState> getTileEntities(@NotNull Predicate<Block> blockPredicate,
|
||||
boolean useSnapshot) {
|
||||
if (!isLoaded()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return TaskManager.IMP.sync(() -> world.getChunkAt(x, z)
|
||||
.getTileEntities(blockPredicate, useSnapshot));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLoaded() {
|
||||
return world.isChunkLoaded(x, z);
|
||||
|
Loading…
Reference in New Issue
Block a user