forked from PaperMC/PaperLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPaperEnvironment.java
40 lines (33 loc) · 1.37 KB
/
PaperEnvironment.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
package io.papermc.lib.environments;
import io.papermc.lib.features.asyncchunks.AsyncChunksPaper_13;
import io.papermc.lib.features.asyncchunks.AsyncChunksPaper_9_12;
import io.papermc.lib.features.asyncteleport.AsyncTeleportPaper;
import io.papermc.lib.features.blockstatesnapshot.BlockStateSnapshotOptionalSnapshots;
import io.papermc.lib.features.chunkisgenerated.ChunkIsGeneratedApiExists;
import io.papermc.lib.features.profilesupport.ProfileSupportPaper;
public class PaperEnvironment extends SpigotEnvironment {
public PaperEnvironment() {
super();
if (isVersion(13, 1)) {
asyncChunksHandler = new AsyncChunksPaper_13();
asyncTeleportHandler = new AsyncTeleportPaper();
} else if (isVersion(9) && !isVersion(13)) {
asyncChunksHandler = new AsyncChunksPaper_9_12();
asyncTeleportHandler = new AsyncTeleportPaper();
}
if (isVersion(12)) {
// Paper added this API in 1.12 with same signature spigot did in 1.13
isGeneratedHandler = new ChunkIsGeneratedApiExists();
blockStateSnapshotHandler = new BlockStateSnapshotOptionalSnapshots();
profileSupportHandler = new ProfileSupportPaper();
}
}
@Override
public String getName() {
return "Paper";
}
@Override
public boolean isPaper() {
return true;
}
}