Skip to content

Commit 19d7eae

Browse files
committed
Version for 1.21.6
1 parent 7c63b0d commit 19d7eae

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package world.bentobox.boxed.nms.v1_21_6_R0_1_SNAPSHOT;
2+
3+
import org.bukkit.Location;
4+
import org.bukkit.block.Block;
5+
import org.bukkit.craftbukkit.v1_21_R5.CraftWorld;
6+
7+
import net.minecraft.core.BlockPosition;
8+
import net.minecraft.world.level.block.entity.TileEntity;
9+
import world.bentobox.boxed.nms.AbstractMetaData;
10+
11+
public class GetMetaData extends AbstractMetaData {
12+
13+
@Override
14+
public String nmsData(Block block) {
15+
Location w = block.getLocation();
16+
CraftWorld cw = (CraftWorld) w.getWorld(); // CraftWorld is NMS one
17+
// for 1.13+ (we have use WorldServer)
18+
TileEntity te = cw.getHandle().c_(new BlockPosition(w.getBlockX(), w.getBlockY(), w.getBlockZ()));
19+
return getData(te, "getUpdatePacket", "tag");
20+
}
21+
22+
}

0 commit comments

Comments
 (0)