6b44ab5

Branches > main > 6b44ab5 > files / src / net / bowmap / network / registry.clj

Registry updates and friends

Grahp, 2026-08-18

Commit: 6b44ab5469d87e9a0b53974c8e2e22fa2fc24040
Parent: 1e5053c

4 changed files:

src/net/bowmap/network/handle.clj modified (view file)

@@ -59,12 +59,39 @@          ;; TODO also probably good to unbundle this          :known-packs [{:namespace "minecraft"                         :id "core"-                        :version "1.12.11"}]})+                        :version "26.2"}]})   (assoc client ::state/connection-state ::state/config))  (defmethod handler ::serverbound/known-packs [client a pk]   (doseq [pk (registry/registry-packets)]     (send a client/send-clientbound-packet pk))++  (send a client/send-clientbound-packet {::pk/id ::clientbound/update-tags+                                          :tagged-registries [{:registry "minecraft:block"+                                                               :tags [{:tag-name "minecraft:infiniburn_overworld"+                                                                       :entries []}]}]})+  (send a client/send-clientbound-packet {::pk/id ::clientbound/update-tags+                                          :tagged-registries [{:registry "minecraft:damage_type"+                                                               :tags [{:tag-name "minecraft:is_fire"+                                                                       :entries []}+                                                                      {:tag-name "minecraft:is_explosion"+                                                                       :entries []}+                                                                      {:tag-name "minecraft:bypasses_shield"+                                                                       :entries []}]}]})+  (send a client/send-clientbound-packet {::pk/id ::clientbound/update-tags+                                          :tagged-registries [{:registry "minecraft:banner_pattern"+                                                               :tags [{:tag-name "minecraft:pattern_item/bordure_indented" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/creeper" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/field_masoned" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/flow" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/flower" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/globe" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/guster" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/mojang" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/piglin" :entries []}+                                                                      {:tag-name "minecraft:pattern_item/skull" :entries []}]}]})++   (send a client/send-clientbound-packet {::pk/id ::clientbound/finish-config})   client) @@ -112,6 +139,7 @@          :has-death-location? false          :portal-cooldown 10          :sea-level 60+         :online-mode? false          :enforce-secure-chat? true})    (send a client/send-clientbound-packet

src/net/bowmap/network/packets/clientbound.clj modified (view file)

@@ -85,6 +85,7 @@     ::explosion     ::unload-chunk     ::game-event+    ::game-rule-values     ::game-test-highlight-position     ::open-horse-screen     ::hurt-animation@@ -95,6 +96,7 @@     ::particle     ::update-light     ::login+    ::low-disk-space-warning     ::map-data     ::merchant-offers     ::update-entity-position@@ -221,6 +223,7 @@             :death-location (context-optional-> position->)             :portal-cooldown varint->             :sea-level varint->+            :online-mode? boolean->             :enforce-secure-chat? boolean->]    ;; And others too but we don't talk about those    ::game-event [:event (enum-> byte-> {3 :set-gamemode 13 :wait-for-chunks})@@ -243,7 +246,10 @@                                                      [:relative-x :relative-y :relative-z                                                       :relative-yaw :relative-pitch                                                       :relative-velocity-x :relative-velocity-y :relative-velocity-z-                                                      :rotate-velocity])]})+                                                      :rotate-velocity])]+   ::update-tags [:tagged-registries (list-> [:registry identifier->+                                              :tags (list-> [:tag-name identifier->+                                                             :entries (list-> varint->)])])]})  (defn build-packet-id-index   "Builds a map of connection states and message ids to packet ids.

src/net/bowmap/network/packets/serverbound.clj modified (view file)

@@ -33,6 +33,7 @@     ::accept-code-of-conduct]    ::state/play    [::confirm-teleportation+    ::attack     ::query-block-entity-tag     ::bundle-item-selected     ::change-difficulty@@ -88,6 +89,7 @@     ::program-command-block     ::program-command-block-minecart     ::set-creative-mode-slot+    ::set-game-rules     ::program-jigsaw-block     ::program-structure-block     ::set-test-block

src/net/bowmap/network/registry.clj modified (view file)

@@ -1,14 +1,14 @@ (ns net.bowmap.network.registry   (:require-   [net.bowmap.network.chunk :as chunk]-   [net.bowmap.network.packet :as pk]))+   [net.bowmap.network.chunk :as chunk]))  ;; Some way to keep track of order of these things and make that clear... ;; Probably a map of id -> order? ;; So maybe this needs to be a macro or something idk (let [damage-types ["cactus" "campfire" "cramming" "dragon_breath" "drown" "dry_out" "ender_pearl" "fall" "out_of_world"                     "fly_into_wall" "freeze" "generic" "generic_kill" "hot_floor" "in_fire" "in_wall" "lava"-                    "lightning_bolt" "magic" "on_fire" "outside_border" "stalagmite" "starve" "sweet_berry_bush" "wither"]]+                    "lightning_bolt" "magic" "on_fire" "outside_border" "stalagmite" "starve" "sweet_berry_bush" "wither"+                    "spear"]]    (def registries ["worldgen/biome" {"plains" {:has_precipitation false                                                :temperature 1.0@@ -23,47 +23,100 @@                                                                :message_id "onFire"                                                                :scaling "never"})) -                   "dimension_type" {"world" {:has_skylight 1-                                              :has_ceiling 0-                                              :ultrawarm 0-                                              :natural 1+                   ;"timeline" {"villager_schedule" {:clock "minecraft:overworld"+                   ;                                 :period_ticks 24000+                   ;                                 :tracks {"minecraft:gameplay/baby_villager_activity" {:keyframes [{:ticks 10 :value "minecraft:idle"}]}}}}+                   ;+                   ; "tags/timeline" {"universal" {:values ["minecraft:villager_schedule"]}+                   ;                  "in_overworld" {:values ["#minecraft:universal"]}}++                   ;"world_clock" {"overworld" {}}++                   "trim_material" {"amethyst" {:asset_name "null"+                                                :description {:color "#000000" :translate "bowmap.null"}}+                                    "copper" {:asset_name "null"+                                              :description {:color "#000000" :translate "bowmap.null"}}+                                    "diamond" {:asset_name "null"+                                               :description {:color "#000000" :translate "bowmap.null"}}+                                    "emerald" {:asset_name "null"+                                               :description {:color "#000000" :translate "bowmap.null"}}+                                    "gold" {:asset_name "null"+                                            :description {:color "#000000" :translate "bowmap.null"}}+                                    "iron" {:asset_name "null"+                                            :description {:color "#000000" :translate "bowmap.null"}}+                                    "lapis" {:asset_name "null"+                                             :description {:color "#000000" :translate "bowmap.null"}}+                                    "netherite" {:asset_name "null"+                                                 :description {:color "#000000" :translate "bowmap.null"}}+                                    "quartz" {:asset_name "null"+                                              :description {:color "#000000" :translate "bowmap.null"}}+                                    "redstone" {:asset_name "null"+                                                :description {:color "#000000" :translate "bowmap.null"}}+                                    "resin" {:asset_name "null"+                                             :description {:color "#000000" :translate "bowmap.null"}}}++                   "dimension_type" {"world" {:ambient_light 0.0+                                              :attributes {:minecraft:audio/ambient_sounds {}+                                                           :minecraft:audio/background_music {}+                                                           :minecraft:gameplay/bed_rule+                                                           {:can_set_spawn "always",+                                                            :can_sleep "when_dark",+                                                            :error_message {:translate "block.minecraft.bed.no_sleep"}}+                                                           :minecraft:gameplay/nether_portal_spawns_piglin true+                                                           :minecraft:gameplay/respawn_anchor_works false+                                                           :minecraft:visual/ambient_light_color "#0a0a0a"+                                                           :minecraft:visual/cloud_color "#ccffffff"+                                                           :minecraft:visual/cloud_height 192.33+                                                           :minecraft:visual/fog_color "#c0d8ff"+                                                           :minecraft:visual/sky_color "#78a7ff"}                                               :coordinate_scale 1.0-                                              :bed_works 1-                                              :respawn_anchor_works 1-                                              :min_y 0+                                              :has_ceiling false+                                              :has_ender_dragon_fight false+                                              :has_skylight true                                               :height chunk/world-height                                               :logical_height chunk/world-height-                                              :infiniburn "#"-                                              :effects "minecraft:overworld"-                                              :ambient_light 0.0-                                              :piglin_safe 0-                                              :has_raids 0-                                              :monster_spawn_light_level 8-                                              :monster_spawn_block_light_limit 8}}+                                              :infiniburn "#minecraft:infiniburn_overworld"+                                              :min_y 0+                                              :monster_spawn_block_light_limit 0+                                              :monster_spawn_light_level 0}}                     "cat_variant" {"cats" {:asset_id "cat"-                                          :spawn_condition []}}+                                          :baby_asset_id "cat"+                                          :spawn_conditions []}} -                   "chicken_variant" {"chicken" {:asset_id "chicken"-                                                 :model "normal"-                                                 :spawn_condition []}}+                   "chicken_variant" {"temperate" {:asset_id "chicken"+                                                   :baby_asset_id "chicken"+                                                   :model "normal"+                                                   :spawn_conditions []}+                                      "cold" {:asset_id "chicken"+                                              :baby_asset_id "chicken"+                                              :model "normal"+                                              :spawn_conditions []}+                                      "warm" {:asset_id "chicken"+                                              :baby_asset_id "chicken"+                                              :model "normal"+                                              :spawn_conditions []}}                     "cow_variant" {"cow" {:asset_id "cow"+                                         :baby_asset_id "cow"                                          :model "normal"-                                         :spawn_condition []}}+                                         :spawn_conditions []}}                     "frog_variant" {"frog" {:asset_id "frog"                                            :spawn_condition []}}                     "pig_variant" {"pig" {:asset_id "pig"+                                         :baby_asset_id "pig"                                          :model "normal"-                                         :spawn_condition []}}+                                         :spawn_conditions []}} -                   "wolf_variant" {"wolf" {:asset_id "wolf"-                                           :assets {:angry "minecraft:angry"+                   "wolf_variant" {"wolf" {:assets {:angry "minecraft:angry"                                                     :tame "minecraft:tame"                                                     :wild "minecraft:wild"}-                                           :spawn_condition []}}+                                           :baby_assets {:angry "minecraft:angry"+                                                         :tame "minecraft:tame"+                                                         :wild "minecraft:wild"}+                                           :spawn_conditions []}}                     "painting_variant" {"painting" {:asset_id "painting"                                                    :height 1@@ -71,15 +124,95 @@                                                    :title "Fred"                                                    :author "Lucy"}} +                   "cat_sound_variant" {"cat" {:adult_sounds {:ambient_sound "minecraft:entity.cat.ambient"+                                                              :beg_for_food_sound "minecraft:entity.cat.ambient"+                                                              :death_sound "minecraft:entity.cat.ambient"+                                                              :eat_sound "minecraft:entity.cat.ambient"+                                                              :hiss_sound "minecraft:entity.cat.ambient"+                                                              :hurt_sound "minecraft:entity.cat.ambient"+                                                              :purr_sound "minecraft:entity.cat.ambient"+                                                              :purreow_sound "minecraft:entity.cat.ambient"+                                                              :stray_ambient_sound "minecraft:entity.cat.ambient"}+                                               :baby_sounds {:ambient_sound "minecraft:entity.cat.ambient"+                                                             :beg_for_food_sound "minecraft:entity.cat.ambient"+                                                             :death_sound "minecraft:entity.cat.ambient"+                                                             :eat_sound "minecraft:entity.cat.ambient"+                                                             :hiss_sound "minecraft:entity.cat.ambient"+                                                             :hurt_sound "minecraft:entity.cat.ambient"+                                                             :purr_sound "minecraft:entity.cat.ambient"+                                                             :purreow_sound "minecraft:entity.cat.ambient"+                                                             :stray_ambient_sound "minecraft:entity.cat.ambient"}}}++                   "chicken_sound_variant" {"chicken" {:adult_sounds {:ambient_sound "minecraft:entity.chicken.ambient"+                                                                      :death_sound "minecraft:entity.chicken.ambient"+                                                                      :hurt_sound "minecraft:entity.chicken.ambient"+                                                                      :step_sound "minecraft:entity.chicken.ambient"}+                                                       :baby_sounds {:ambient_sound "minecraft:entity.chicken.ambient"+                                                                     :death_sound "minecraft:entity.chicken.ambient"+                                                                     :hurt_sound "minecraft:entity.chicken.ambient"+                                                                     :step_sound "minecraft:entity.chicken.ambient"}}}+                   "cow_sound_variant" {"cow" {:ambient_sound "minecraft:entity.cow.ambient"+                                               :death_sound "minecraft:entity.cow.ambient"+                                               :hurt_sound "minecraft:entity.cow.ambient"+                                               :step_sound "minecraft:entity.cow.ambient"}}+                   "pig_sound_variant" {"pig" {:adult_sounds {:ambient_sound "minecraft:entity.pig.ambient"+                                                              :death_sound "minecraft:entity.pig.ambient"+                                                              :eat_sound "minecraft:entity.pig.ambient"+                                                              :hurt_sound "minecraft:entity.pig.ambient"+                                                              :step_sound "minecraft:entity.pig.ambient"}+                                               :baby_sounds {:ambient_sound "minecraft:entity.pig.ambient"+                                                             :death_sound "minecraft:entity.pig.ambient"+                                                             :eat_sound "minecraft:entity.pig.ambient"+                                                             :hurt_sound "minecraft:entity.pig.ambient"+                                                             :step_sound "minecraft:entity.pig.ambient"}}}++                    "zombie_nautilus_variant" {"warm" {:asset_id "minecraft:entity/nautilus/zombie_nautilus"                                                       :spawn_conditions []}} -                   "wolf_sound_variant" {"wolf_sound" {:ambient_sound "minecraft:entity.wolf.ambient"-                                                       :death_sound "minecraft:entity.wolf.ambient"-                                                       :growl_sound "minecraft:entity.wolf.ambient"-                                                       :hurt_sound "minecraft:entity.wolf.ambient"-                                                       :pant_sound "minecraft:entity.wolf.ambient"-                                                       :whine_sound "minecraft:entity.wolf.ambient"}}]))+                   "jukebox_song" {"5" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "creator_music_box" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "11" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "13" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "blocks" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "bounce" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "cat" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "chirp" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "creator" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "far" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "lava_chicken" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "mall" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "mellohi" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "otherside" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "pigstep" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "precipice" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "relic" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "stal" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "strad" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "tears" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "wait" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}+                                   "ward" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event "minecraft:music_disc.5"}}++                   "instrument" {"ponder_goat_horn" {:description {:translate "bowmap.null"}+                                                     :range 1.0,+                                                     :sound_event "minecraft:block.note_block.harp"+                                                     :use_duration 1.0}}+++                   "wolf_sound_variant" {"angry" {:adult_sounds {:ambient_sound "minecraft:entity.wolf.ambient"+                                                                 :death_sound "minecraft:entity.wolf.ambient"+                                                                 :growl_sound "minecraft:entity.wolf.ambient"+                                                                 :hurt_sound "minecraft:entity.wolf.ambient"+                                                                 :pant_sound "minecraft:entity.wolf.ambient"+                                                                 :step_sound "minecraft:entity.wolf.ambient"+                                                                 :whine_sound "minecraft:entity.wolf.ambient"}+                                                  :baby_sounds {:ambient_sound "minecraft:entity.wolf.ambient"+                                                                :death_sound "minecraft:entity.wolf.ambient"+                                                                :growl_sound "minecraft:entity.wolf.ambient"+                                                                :hurt_sound "minecraft:entity.wolf.ambient"+                                                                :pant_sound "minecraft:entity.wolf.ambient"+                                                                :step_sound "minecraft:entity.wolf.ambient"+                                                                :whine_sound "minecraft:entity.wolf.ambient"}}}]))  ;; Make a map of ids -> order ; This probably has to be per-client since different clients could have different registries