package de.tr7zw.changeme.nbtapi;

import org.bukkit.block.Block;

import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;

public class NBTBlock {

	private final Block block;
	private final NBTChunk nbtChunk;
	
	public NBTBlock(Block block) {
		this.block = block;
		if(!MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_16_R3)) {
			throw new NbtApiException("NBTBlock is only working for 1.16.4+!");
		}
		nbtChunk = new NBTChunk(block.getChunk());
	}
	
	
	public NBTCompound getData() {
		return nbtChunk.getPersistentDataContainer().getOrCreateCompound("blocks").getOrCreateCompound(block.getX() + "_" + block.getY() + "_" + block.getZ());
	}


}

@@ -117,16 +117,399 @@
 rsion;%0A%0A
+/**%0A * Helper class to store NBT data to Block Locations. Use getData() to get the%0A * NBT instance. Important notes:%0A * %0A * - Non BlockEntities can not have NBT data. This stores the data to the chunk%0A * instead!%0A * %0A * - The data is really just on the location. If the block gets%0A * broken/changed/explodes/moved etc, the data is still on that location!%0A * %0A * @author tr7zw%0A *%0A */%0A
 public c
@@ -525,17 +525,20 @@
 lock %7B%0A%0A
-%09
+    
 private 
@@ -556,17 +556,20 @@
  block;%0A
-%09
+    
 private 
@@ -593,19 +593,21 @@
 tChunk;%0A
-%09%0A%09
+%0A    
 public N
@@ -629,18 +629,24 @@
 lock) %7B%0A
-%09%09
+        
 this.blo
@@ -661,12 +661,19 @@
 ck;%0A
-%09%09
+        
 if
+ 
 (!Mi
@@ -739,11 +739,20 @@
 ) %7B%0A
-%09%09%09
+            
 thro
@@ -819,14 +819,26 @@
 %22);%0A
-%09%09%7D%0A%09%09
+        %7D%0A        
 nbtC
@@ -880,16 +880,19 @@
 ));%0A
-%09%7D%0A%09%0A%09%0A%09
+    %7D%0A%0A    
 publ
@@ -922,10 +922,16 @@
 ) %7B%0A
-%09%09
+        
 retu
@@ -1000,16 +1000,33 @@
 blocks%22)
+%0A                
 .getOrCr
@@ -1099,11 +1099,13 @@
 ));%0A
-%09%7D%0A
+    %7D
 %0A%0A%7D%0A

Add some javadoc to NBTBlock