Package com.comphenix.protocol.wrappers

Examples of com.comphenix.protocol.wrappers.WrappedDataWatcher


  @Test
  public void testGetDataWatcherModifier() {
    PacketContainer mobSpawnPacket = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY_LIVING);
    StructureModifier<WrappedDataWatcher> watcherAccessor = mobSpawnPacket.getDataWatcherModifier();
       
    WrappedDataWatcher dataWatcher = new WrappedDataWatcher();
    dataWatcher.setObject(1, 100);
    dataWatcher.setObject(2, 125);
   
    assertNull(watcherAccessor.read(0));
   
    // Insert and read back
    watcherAccessor.write(0, dataWatcher);
View Full Code Here


    StructureModifier<List<WrappedWatchableObject>> watchableAccessor =
        entityMetadata.getWatchableCollectionModifier();
   
    assertNull(watchableAccessor.read(0));
   
    WrappedDataWatcher watcher = new WrappedDataWatcher();
    watcher.setObject(1, 10);
    watcher.setObject(8, 10);
   
    List<WrappedWatchableObject> list = watcher.getWatchableObjects();
   
    // Insert and read back
    watchableAccessor.write(0, list);
    assertEquals(list, watchableAccessor.read(0));
  }
View Full Code Here

TOP

Related Classes of com.comphenix.protocol.wrappers.WrappedDataWatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.