registry.clj
Branches > main > e8f7a9b > files / src / net / bowmap / protocol / registry.clj
(ns net.bowmap.protocol.registry
(:require
[clojure.set :as set]
[net.bowmap.protocol.chunk :as chunk]))
(def world-dimension "world")
(let [null-sound {:sound_id "bowmap:null"}
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"]
trim-materials ["amethyst" "copper" "diamond" "emerald" "gold" "iron" "lapis" "netherite" "quartz" "redstone" "resin"]
jukebox-sounds ["chirp" "creator_music_box" "mellohi" "otherside" "far" "lava_chicken" "blocks" "creator" "stal" "5"
"pigstep" "wait" "13" "tears" "bounce" "precipice" "strad" "relic" "11" "ward" "mall" "cat"]]
(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" (zipmap trim-materials
(repeat {:asset_name "null"
:description {:color "#000000" :translate "bowmap.null"}}))
"dimension_type" {world-dimension {: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 "#bowmap:infiniburn"
: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" (zipmap jukebox-sounds
(repeat {: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 tags
; Tags don't currently support values cause I haven't needed them
; They'd otherwise be {:tag [values]}
{"block" ["bowmap:infiniburn"]
"damage_type" ["is_fire"
"is_explosion"
"bypasses_shield"]
"banner_pattern" ["pattern_item/bordure_indented"
"pattern_item/creeper"
"pattern_item/field_masoned"
"pattern_item/flow"
"pattern_item/flower"
"pattern_item/globe"
"pattern_item/guster"
"pattern_item/mojang"
"pattern_item/piglin"
"pattern_item/skull"]})
(def registry-ids->values (update-vals registries #(zipmap (range) (keys %))))
(def registry-values->ids (update-vals registry-ids->values set/map-invert))
(def world-dimension-id (req! (req! registry-values->ids "worldgen/biome") "plains"))