-
-
Notifications
You must be signed in to change notification settings - Fork 204
/
SingleRegionExtent.java
65 lines (52 loc) · 1.87 KB
/
SingleRegionExtent.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.fastasyncworldedit.core.extent;
import com.fastasyncworldedit.core.limit.FaweLimit;
import com.fastasyncworldedit.core.queue.IChunk;
import com.fastasyncworldedit.core.queue.IChunkGet;
import com.fastasyncworldedit.core.queue.IChunkSet;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.regions.Region;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.Future;
public final class SingleRegionExtent extends FaweRegionExtent {
private final Region region;
/**
* Create a new instance.
*
* @param extent the extent
*/
public SingleRegionExtent(Extent extent, FaweLimit limit, Region region) {
super(extent, limit);
this.region = region;
}
@Override
public boolean contains(int x, int y, int z) {
return region.contains(x, y, z);
}
@Override
public boolean contains(int x, int z) {
return region.contains(x, z);
}
@Override
public Collection<Region> getRegions() {
return Collections.singletonList(region);
}
@Override
public IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set) {
return region.processSet(chunk, get, set);
}
@Override
public Future<?> postProcessSet(IChunk chunk, IChunkGet get, IChunkSet set) {
// Most likely will do nothing, but perhaps people will find some fun way of using this via API (though doubtful)
return region.postProcessSet(chunk, get, set);
}
@Override
public void postProcess(IChunk chunk, IChunkGet get, IChunkSet set) {
// Most likely will do nothing, but perhaps people will find some fun way of using this via API (though doubtful)
region.postProcess(chunk, get, set);
}
@Override
public boolean processGet(int chunkX, int chunkZ) {
return region.containsChunk(chunkX, chunkZ);
}
}