@Override
 public BlockFamily deserialize(EntityData.Value value) {
   if (value.getStringCount() > 0) {
     return blockManager.getBlockFamily(value.getString(0));
   }
   return null;
 }
 @Override
 public List<BlockFamily> deserializeCollection(EntityData.Value value) {
   List<BlockFamily> result = Lists.newArrayListWithCapacity(value.getStringCount());
   for (String item : value.getStringList()) {
     result.add(blockManager.getBlockFamily(item));
   }
   return result;
 }
示例#3
0
 @Override
 public T deserialize(EntityData.Value value) {
   if (value.getStringCount() > 0) {
     Asset asset = Assets.resolve(type, value.getString(0));
     if (asset != null && assetClass.isAssignableFrom(asset.getClass())) {
       return assetClass.cast(asset);
     }
   }
   return null;
 }
示例#4
0
 @Override
 public List<T> deserializeCollection(EntityData.Value value) {
   List<T> result = Lists.newArrayListWithCapacity(value.getStringCount());
   for (String item : value.getStringList()) {
     Asset asset = Assets.resolve(type, item);
     if (asset != null && assetClass.isAssignableFrom(asset.getClass())) {
       result.add(assetClass.cast(asset));
     }
   }
   return result;
 }