use of com.irtimaled.bbor.client.events.AddBoundingBoxReceived in project BoundingBoxOutlineReloaded by irtimaled.
the class AddBoundingBox method getEvent.
public static AddBoundingBoxReceived getEvent(PayloadReader reader, String name) {
DimensionId dimensionId = getDimensionId(reader, name);
AbstractBoundingBox key = BoundingBoxDeserializer.deserialize(reader);
if (key == null)
return null;
Set<AbstractBoundingBox> boundingBoxes = new HashSet<>();
while (reader.isReadable()) {
AbstractBoundingBox boundingBox = BoundingBoxDeserializer.deserialize(reader);
boundingBoxes.add(boundingBox);
}
if (boundingBoxes.size() == 0)
boundingBoxes.add(key);
return new AddBoundingBoxReceived(dimensionId, key, boundingBoxes);
}
Aggregations