6bcddb0
Branches > main > 6bcddb0 > files
Add text component spec
Commit: 6bcddb03b2d85d501d2af5e68c85ac9cc34e6219
Parent: 2c5e1ba
1 changed file:
src/net/bowmap/server/protocol/component.clj view file
@@ -0,0 +1,16 @@+(ns net.bowmap.server.protocol.component+ "The subset of the protocol text component format used by this server.+ See https://minecraft.wiki/w/Text_component_format for the full format."+ (:require+ [clojure.spec.alpha :as s]))++(s/def ::type #{"text" #_"translatable" #_"score" #_"selector" #_"keybind" #_"nbt"})+(s/def ::text string?)++(s/def ::color #(re-matches #"#[0-9a-fA-F]{6}" %))+(s/def ::extra (s/* ::component))++(s/def ::component (s/keys :opt-un [::type ::text #_::translate #_::score #_::selector #_::keybind #_::nbt+ ::extra+ ::color #_::font #_::bold #_::italic #_::underlined #_::strikethrough #_::obfuscated #_::shadow_color+ #_::insertion #_::click_event #_::hover_event]))