use of com.minecolonies.api.colony.workorders.IWorkOrderView in project minecolonies by Minecolonies.
the class ColonyView method handleColonyViewWorkOrderMessage.
/**
* Update a ColonyView's workOrders given a network data ColonyView update packet. This uses a full-replacement - workOrders do not get updated and are instead overwritten.
*
* @param buf Network data.
* @return null == no response.
*/
@Override
@Nullable
public IMessage handleColonyViewWorkOrderMessage(final PacketBuffer buf) {
workOrders.clear();
final int amount = buf.readInt();
for (int i = 0; i < amount; i++) {
@Nullable final IWorkOrderView workOrder = AbstractWorkOrder.createWorkOrderView(buf);
if (workOrder != null) {
workOrders.put(workOrder.getId(), workOrder);
}
}
return null;
}
Aggregations