-
-
Notifications
You must be signed in to change notification settings - Fork 204
/
NullExtent.java
386 lines (317 loc) · 9.51 KB
/
NullExtent.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
package com.fastasyncworldedit.core.extent;
import com.fastasyncworldedit.core.FaweCache;
import com.fastasyncworldedit.core.extent.processor.ProcessorScope;
import com.fastasyncworldedit.core.function.generator.GenBase;
import com.fastasyncworldedit.core.function.generator.Resource;
import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.fastasyncworldedit.core.limit.FaweLimit;
import com.fastasyncworldedit.core.queue.IBatchProcessor;
import com.fastasyncworldedit.core.queue.IChunk;
import com.fastasyncworldedit.core.queue.IChunkGet;
import com.fastasyncworldedit.core.queue.IChunkSet;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.util.Countable;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Future;
//todo This should be removed in favor of com.sk89q.worldedit.extent.NullExtent
public final class NullExtent extends FaweRegionExtent implements IBatchProcessor {
private final FaweException reason;
/**
* Create a new instance.
*
* @param extent the extent
*/
public NullExtent(Extent extent, Component failReason) {
this(extent, new FaweException(failReason));
}
public NullExtent(Extent extent, FaweException exception) {
super(extent, FaweLimit.MAX);
this.reason = exception;
}
public NullExtent() {
this(new com.sk89q.worldedit.extent.NullExtent(), FaweCache.MANUAL);
}
@Override
public BlockVector3 getMinimumPoint() {
return BlockVector3.ZERO;
}
@Override
public BlockVector3 getMaximumPoint() {
return BlockVector3.ZERO;
}
@Override
public List<Entity> getEntities(Region region) {
throw reason;
}
@Override
public List<Entity> getEntities() {
throw reason;
}
@Nullable
@Override
public Entity createEntity(Location arg0, BaseEntity arg1) {
throw reason;
}
@Nullable
@Override
public Entity createEntity(Location arg0, BaseEntity arg1, UUID arg2) {
throw reason;
}
@Override
public BlockState getBlock(BlockVector3 position) {
throw reason;
}
@Override
public BlockState getBlock(int x, int y, int z) {
throw reason;
}
@Override
public BaseBlock getFullBlock(BlockVector3 position) {
throw reason;
}
@Override
public BaseBlock getFullBlock(int x, int y, int z) {
throw reason;
}
@Override
public BiomeType getBiome(BlockVector3 position) {
throw reason;
}
@Override
public BiomeType getBiomeType(int x, int y, int z) {
throw reason;
}
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 position, B block) throws WorldEditException {
throw reason;
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block)
throws WorldEditException {
throw reason;
}
@Override
public ResettableExtent setExtent(Extent extent) {
throw reason;
}
@Override
public boolean setTile(int x, int y, int z, CompoundTag tile) throws WorldEditException {
throw reason;
}
@Override
public boolean setBiome(BlockVector3 position, BiomeType biome) {
throw reason;
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
throw reason;
}
@Override
public boolean isQueueEnabled() {
throw reason;
}
@Override
public void enableQueue() {
throw reason;
}
@Override
public void disableQueue() {
throw reason;
}
@Override
public boolean isWorld() {
throw reason;
}
@Override
public boolean regenerateChunk(int x, int z, @Nullable BiomeType type, @Nullable Long seed) {
throw reason;
}
@Override
public int getHighestTerrainBlock(int x, int z, int minY, int maxY) {
throw reason;
}
@Override
public int getHighestTerrainBlock(int x, int z, int minY, int maxY, Mask filter) {
throw reason;
}
@Override
public boolean contains(int x, int z) {
throw reason;
}
@Override
public boolean contains(int x, int y, int z) {
throw reason;
}
@Override
public Collection<Region> getRegions() {
throw reason;
}
@Nullable
@Override
public Operation commit() {
return null;
}
@Override
public boolean cancel() {
throw reason;
}
@Override
public int getMaxY() {
throw reason;
}
@Override
public int getMinY() {
throw reason;
}
@Override
public Extent addProcessor(final IBatchProcessor processor) {
return this;
}
@Override
public Extent addPostProcessor(final IBatchProcessor processor) {
return this;
}
@Override
public BlockArrayClipboard lazyCopy(Region region) {
throw reason;
}
@Override
public int countBlocks(Region region, Set<BaseBlock> searchBlocks) {
throw reason;
}
@Override
public int countBlocks(Region region, Mask searchMask) {
throw reason;
}
@Override
public <B extends BlockStateHolder<B>> int setBlocks(Region region, B block) throws MaxChangedBlocksException {
throw reason;
}
@Override
public int setBlocks(Region region, Pattern pattern) throws MaxChangedBlocksException {
throw reason;
}
@Override
public <B extends BlockStateHolder<B>> int replaceBlocks(Region region, Set<BaseBlock> filter, B replacement) throws
MaxChangedBlocksException {
throw reason;
}
@Override
public int replaceBlocks(Region region, Set<BaseBlock> filter, Pattern pattern) throws MaxChangedBlocksException {
throw reason;
}
@Override
public int replaceBlocks(Region region, Mask mask, Pattern pattern) throws MaxChangedBlocksException {
throw reason;
}
@Override
public int center(Region region, Pattern pattern) throws MaxChangedBlocksException {
throw reason;
}
@Override
public int setBlocks(Set<BlockVector3> vset, Pattern pattern) {
throw reason;
}
@Override
public int getNearestSurfaceLayer(int x, int z, int y, int minY, int maxY) {
throw reason;
}
@Override
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, Mask mask) {
throw reason;
}
@Override
public int getNearestSurfaceTerrainBlock(
int x,
int z,
int y,
int minY,
int maxY,
int failedMin,
int failedMax,
boolean ignoreAir
) {
throw reason;
}
@Override
public void addCaves(Region region) throws WorldEditException {
throw reason;
}
@Override
public void generate(Region region, GenBase gen) throws WorldEditException {
throw reason;
}
@Override
public void addSchems(Region region, Mask mask, List<ClipboardHolder> clipboards, int rarity, boolean rotate) throws
WorldEditException {
throw reason;
}
@Override
public void spawnResource(Region region, Resource gen, int rarity, int frequency) throws WorldEditException {
throw reason;
}
@Override
public void addOre(Region region, Mask mask, Pattern material, int size, int frequency, int rarity, int minY, int maxY) throws
WorldEditException {
throw reason;
}
@Override
public void addOres(Region region, Mask mask) throws WorldEditException {
throw reason;
}
@Override
public List<Countable<BlockType>> getBlockDistribution(Region region) {
throw reason;
}
@Override
public List<Countable<BlockState>> getBlockDistributionWithData(Region region) {
throw reason;
}
@Override
public IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set) {
throw reason;
}
@Override
public Future<?> postProcessSet(IChunk chunk, IChunkGet get, IChunkSet set) {
throw reason;
}
@Override
public void postProcess(IChunk chunk, IChunkGet get, IChunkSet set) {
throw reason;
}
@Override
public boolean processGet(int chunkX, int chunkZ) {
throw reason;
}
@Override
public Extent construct(Extent child) {
throw reason;
}
@Override
public ProcessorScope getScope() {
throw reason;
}
}