This repository has been archived on 2025-05-08. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
RePlace/src/main/java/ed/tr7zw/changeme/nbtapi/NBTChunk.java
2024-05-04 16:07:12 +02:00

30 lines
850 B
Java
Executable file

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());
}
}