registry.clj

Branches > main > 7568602 > files / src / net / bowmap / protocol / packet / registry.clj

(ns net.bowmap.protocol.packet.registry
  (:require
   [net.bowmap.protocol.packet :as pk]
   [net.bowmap.protocol.packet.clientbound :as clientbound]
   [net.bowmap.protocol.registry :as reg]))

; Not in love with this...
(defn registry-packets []
  (for [[registry-id entries] reg/registries]
    {::pk/id ::clientbound/registry-data
     ::reg/id registry-id
     ::reg/entries (for [[value] (sort-by val (req! reg/registry-values->ids registry-id))]
                     {::reg/entry-id value
                      ::reg/entry-data (entries value)})}))