registry.clj

Branches > main > 9000abb > files / src / net / bowmap / network / packets / registry.clj

(ns net.bowmap.network.packets.registry
  (:require
   [net.bowmap.network.packet :as pk]
   [net.bowmap.network.packets.clientbound :as clientbound]
   [net.bowmap.network.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)})}))