Initial commit
This commit is contained in:
commit
d9b73ab727
46 changed files with 5124 additions and 0 deletions
30
src/main/java/ed/tr7zw/changeme/nbtapi/NBTChunk.java
Normal file
30
src/main/java/ed/tr7zw/changeme/nbtapi/NBTChunk.java
Normal file
|
@ -0,0 +1,30 @@
|
|||
package ed.tr7zw.changeme.nbtapi;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
|
||||
import de.tr7zw.annotations.FAUtil;
|
||||
import ed.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
|
||||
import ed.tr7zw.changeme.nbtapi.utils.annotations.AvailableSince;
|
||||
import ed.tr7zw.changeme.nbtapi.utils.annotations.CheckUtil;
|
||||
|
||||
public class NBTChunk {
|
||||
|
||||
private final Chunk chunk;
|
||||
|
||||
public NBTChunk(Chunk chunk) {
|
||||
this.chunk = chunk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the NBTCompound used by spigots PersistentDataAPI. This method is only
|
||||
* available for 1.16.4+!
|
||||
*
|
||||
* @return NBTCompound containing the data of the PersistentDataAPI
|
||||
*/
|
||||
@AvailableSince(version = MinecraftVersion.MC1_16_R3)
|
||||
public NBTCompound getPersistentDataContainer() {
|
||||
FAUtil.check(this::getPersistentDataContainer, CheckUtil::isAvaliable);
|
||||
return new NBTPersistentDataContainer(chunk.getPersistentDataContainer());
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue