예제 #1
0
 @Override
 public SpoutClientWorld getWorld(UUID uid) {
   SpoutClientWorld world = activeWorld.get();
   if (world != null && world.getUID().equals(uid)) {
     return world;
   } else {
     return null;
   }
 }
예제 #2
0
  @Override
  public SpoutClientWorld getWorld(String name, boolean exact) {
    SpoutClientWorld world = activeWorld.get();
    if (world == null) {
      return null;
    }

    if ((exact && world.getName().equals(name)) || world.getName().startsWith(name)) {
      return world;
    } else {
      return null;
    }
  }
예제 #3
0
  @Override
  public SpoutClientWorld worldChanged(String name, UUID uuid, byte[] data) {
    SpoutClientWorld world = new SpoutClientWorld(name, uuid, this, getEngineItemMap());

    SerializableMap map = world.getComponentHolder().getData();
    try {
      map.deserialize(data);
    } catch (IOException e) {
      throw new RuntimeException("Unable to deserialize data", e);
    }

    SpoutClientWorld oldWorld = activeWorld.getAndSet(world);
    if (oldWorld != null) {
      oldWorld.unload(false);
    }
    return world;
  }