registry.clj
Branches > client-handling-rewrite > 9ccccc9 > files / src / net / bowmap / packet / registry.clj
(ns net.bowmap.packet.registry
(:require
[net.bowmap.packet.chunk :as chunk]
[net.bowmap.packet :as pk]
[net.bowmap.packet.client :as cp]))
;; 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"]]
(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"}))
"dimension_type" {"world" {:has_skylight 1
:has_ceiling 0
:ultrawarm 0
:natural 1
:coordinate_scale 1.0
:bed_works 1
:respawn_anchor_works 1
:min_y 0
: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}}
"cat_variant" {"cats" {:asset_id "cat"
:spawn_condition []}}
"chicken_variant" {"chicken" {:asset_id "chicken"
:model "normal"
:spawn_condition []}}
"cow_variant" {"cow" {:asset_id "cow"
:model "normal"
:spawn_condition []}}
"frog_variant" {"frog" {:asset_id "frog"
:spawn_condition []}}
"pig_variant" {"pig" {:asset_id "pig"
:model "normal"
:spawn_condition []}}
"wolf_variant" {"wolf" {:asset_id "wolf"
:assets {:angry "minecraft:angry"
:tame "minecraft:tame"
:wild "minecraft:wild"}
:spawn_condition []}}
"painting_variant" {"painting" {:asset_id "painting"
:height 1
:width 1
:title "Fred"
:author "Lucy"}}
"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"}}]))
;; Make a map of ids -> order
#_(defn registry-id
"Function to get the ordered numerical id from a given registry id"
[id])
;; TODO this shouldn't be here :p
(def registry-packets
(for [[id m] (partition 2 registries)]
{::pk/id ::cp/registry-data
:registry-id id
:entries (for [[entry-id data] m]
{:id entry-id
:data data})}))