use of com.bergerkiller.bukkit.common.nbt.CommonTagCompound in project BKCommonLib by bergerhealer.
the class PacketTest method testBlockStateChangePacket.
@Test
public void testBlockStateChangePacket() {
CommonTagCompound metadata = new CommonTagCompound();
metadata.putValue("Text1", "a");
metadata.putValue("Text2", "b");
metadata.putValue("Text3", "c");
metadata.putValue("Text4", "d");
PacketPlayOutTileEntityDataHandle packet = PacketPlayOutTileEntityDataHandle.createNew(IntVector3.of(1, 2, 3), BlockStateType.SIGN, metadata.clone());
assertEquals(IntVector3.of(1, 2, 3), packet.getPosition());
assertEquals(BlockStateType.SIGN, packet.getType());
assertEquals(metadata, packet.getData());
}
use of com.bergerkiller.bukkit.common.nbt.CommonTagCompound in project BKCommonLib by bergerhealer.
the class ItemMaterialTest method testItemTag.
@Test
public void testItemTag() {
ItemStack item = ItemUtil.createItem(getFirst("OAK_PLANKS", "LEGACY_WOOD"), 1);
assertNull(ItemUtil.getMetaTag(item));
CommonTagCompound tag = ItemUtil.getMetaTag(item, true);
assertNotNull(tag);
tag.putValue("test", "awesome!");
tag = ItemUtil.getMetaTag(item);
assertNotNull(tag);
assertTrue(tag.containsKey("test"));
assertEquals("awesome!", tag.getValue("test"));
}
Aggregations