Initial commit

This commit is contained in:
DavidOnTop 2024-02-09 10:35:21 +01:00
commit d9b73ab727
No known key found for this signature in database
GPG key ID: FAB914DDC2F180EB
46 changed files with 5124 additions and 0 deletions

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