registry.clj

Branches > main > 435b219 > files / src / net / bowmap / network / registry.clj

(ns net.bowmap.network.registry
  (:require
   [clojure.set :as set]
   [net.bowmap.network.chunk :as chunk]))

(def null-sound {:sound_id "bowmap:null"})

(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"
                    "spear"]]

  (def registries {"worldgen/biome" {"plains" {:has_precipitation false
                                               :temperature 1.0
                                               :temperature_modifier "none"
                                               :downfall 1.0
                                               :effects {:fog_color 880000
                                                         :water_color 880000 ;8364543
                                                         :water_fog_color 880000
                                                         :sky_color 880000}}}

                   "damage_type" (zipmap damage-types (repeat {:exhaustion 0x0
                                                               :message_id "onFire"
                                                               :scaling "never"}))

                   "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 1.0
                                              :attributes {}
                                              :coordinate_scale 1.0
                                              :has_ceiling false
                                              :has_ender_dragon_fight false
                                              :has_skylight true
                                              :height chunk/world-height
                                              :logical_height chunk/world-height
                                              :infiniburn "#minecraft:infiniburn_overworld"
                                              :min_y 0
                                              :monster_spawn_block_light_limit 0
                                              :monster_spawn_light_level 0}}

                   "cat_variant" {"cats" {:asset_id "null"
                                          :baby_asset_id "null"
                                          :spawn_conditions []}}

                   "chicken_variant" {"temperate" {:asset_id "null"
                                                   :baby_asset_id "null"
                                                   :model "normal"
                                                   :spawn_conditions []}
                                      "cold" {:asset_id "null"
                                              :baby_asset_id "null"
                                              :model "normal"
                                              :spawn_conditions []}
                                      "warm" {:asset_id "null"
                                              :baby_asset_id "null"
                                              :model "normal"
                                              :spawn_conditions []}}

                   "cow_variant" {"cow" {:asset_id "null"
                                         :baby_asset_id "null"
                                         :model "normal"
                                         :spawn_conditions []}}

                   "frog_variant" {"frog" {:asset_id "null"
                                           :spawn_condition []}}

                   "pig_variant" {"pig" {:asset_id "null"
                                         :baby_asset_id "null"
                                         :model "normal"
                                         :spawn_conditions []}}

                   "wolf_variant" {"wolf" {:assets {:angry "null"
                                                    :tame "null"
                                                    :wild "null"}
                                           :baby_assets {:angry "null"
                                                         :tame "null"
                                                         :wild "null"}
                                           :spawn_conditions []}}

                   "painting_variant" {"painting" {:asset_id "painting"
                                                   :height 1
                                                   :width 1
                                                   :title "Fred"
                                                   :author "Lucy"}}

                   "cat_sound_variant" {"cat" {:adult_sounds {:ambient_sound null-sound
                                                              :beg_for_food_sound null-sound
                                                              :death_sound null-sound
                                                              :eat_sound null-sound
                                                              :hiss_sound null-sound
                                                              :hurt_sound null-sound
                                                              :purr_sound null-sound
                                                              :purreow_sound null-sound
                                                              :stray_ambient_sound null-sound}
                                               :baby_sounds {:ambient_sound null-sound
                                                             :beg_for_food_sound null-sound
                                                             :death_sound null-sound
                                                             :eat_sound null-sound
                                                             :hiss_sound null-sound
                                                             :hurt_sound null-sound
                                                             :purr_sound null-sound
                                                             :purreow_sound null-sound
                                                             :stray_ambient_sound null-sound}}}

                   "chicken_sound_variant" {"chicken" {:adult_sounds {:ambient_sound null-sound
                                                                      :death_sound null-sound
                                                                      :hurt_sound null-sound
                                                                      :step_sound null-sound}
                                                       :baby_sounds {:ambient_sound null-sound
                                                                     :death_sound null-sound
                                                                     :hurt_sound null-sound
                                                                     :step_sound null-sound}}}
                   "cow_sound_variant" {"cow" {:ambient_sound null-sound
                                               :death_sound null-sound
                                               :hurt_sound null-sound
                                               :step_sound null-sound}}
                   "pig_sound_variant" {"pig" {:adult_sounds {:ambient_sound null-sound
                                                              :death_sound null-sound
                                                              :eat_sound null-sound
                                                              :hurt_sound null-sound
                                                              :step_sound null-sound}
                                               :baby_sounds {:ambient_sound null-sound
                                                             :death_sound null-sound
                                                             :eat_sound null-sound
                                                             :hurt_sound null-sound
                                                             :step_sound null-sound}}}


                   "zombie_nautilus_variant" {"warm" {:asset_id "null"
                                                      :spawn_conditions []}}

                   "jukebox_song" {"5" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "creator_music_box" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "11" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "13" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "blocks" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "bounce" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "cat" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "chirp" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "creator" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "far" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "lava_chicken" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "mall" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "mellohi" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "otherside" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "pigstep" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "precipice" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "relic" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "stal" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "strad" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "tears" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "wait" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}
                                   "ward" {:comparator_output 1 :description {:translate "bowmap.null"} :length_in_seconds 1.0 :sound_event null-sound}}

                   "instrument" {"ponder_goat_horn" {:description {:translate "bowmap.null"}
                                                     :range 1.0,
                                                     :sound_event null-sound
                                                     :use_duration 1.0}}


                   "wolf_sound_variant" {"angry" {:adult_sounds {:ambient_sound null-sound
                                                                 :death_sound null-sound
                                                                 :growl_sound null-sound
                                                                 :hurt_sound null-sound
                                                                 :pant_sound null-sound
                                                                 :step_sound null-sound
                                                                 :whine_sound null-sound}
                                                  :baby_sounds {:ambient_sound null-sound
                                                                :death_sound null-sound
                                                                :growl_sound null-sound
                                                                :hurt_sound null-sound
                                                                :pant_sound null-sound
                                                                :step_sound null-sound
                                                                :whine_sound null-sound}}}}))

(def registry-ids->values (update-vals registries #(zipmap (range) (keys %))))
(def registry-values->ids (update-vals registry-ids->values set/map-invert))