clientbound_packets.clj

Bowmap · bowmap.git · Tickets

Branches > main > 12be7f8 > files / src / net / bowmap / server / protocol / clientbound_packets.clj

(ns net.bowmap.server.protocol.clientbound-packets
  (:require
   [net.bowmap.server.protocol.types :as t]
   [net.bowmap.server.protocol.writers :refer :all]
   [net.bowmap.server.protocol.phase :as phase]))

(defn ? [_] (throw (Exception. "Error while encoding packet: no packet definition for that packet id")))

(def clientbound-packets
  "Map of connection phases to pairs of [clientbound-packet-id writer]"
  {::phase/status
   [::status-response [::t/status-response status-response->]
    ::pong-response [::t/timestamp long->]]
   ::phase/login
   [::disconnect ?
    ::encryption-request ?
    ::login-success ?
    ::set-compression ?
    ::login-plugin-request ?
    ::cookie-request ?]
   ::phase/config
   [::cookie-request ?
    ::plugin-message ?
    ::disconnect ?
    ::finish-config ?
    ::keep-alive ?
    ::ping ?
    ::reset-chat ?
    ::registry-data ?
    ::remove-resource-pack ?
    ::add-resource-pack ?
    ::store-cookie ?
    ::transfer ?
    ::feature-flags ?
    ::update-tags ?
    ::known-packs ?
    ::custom-report-details ?
    ::server-links ?
    ::clear-dialog ?
    ::show-dialog ?
    ::code-of-conduct ?]
   ::phase/play
   [::bundle-delimiter ?
    ::spawn-entity ?
    ::entity-animation ?
    ::award-statistics ?
    ::acknowledge-block-change ?
    ::set-block-destroy-stage ?
    ::block-entity-data ?
    ::block-action ?
    ::block-update ?
    ::boss-bar ?
    ::change-difficulty ?
    ::chunk-batch-finished ?
    ::chunk-batch-start ?
    ::chunk-biomes ?
    ::clear-titles ?
    ::command-suggestions-response ?
    ::commands ?
    ::close-container ?
    ::set-container-content ?
    ::set-container-property ?
    ::set-container-slot ?
    ::cookie-request ?
    ::set-cooldown ?
    ::chat-suggestions ?
    ::plugin-message ?
    ::damage-event ?
    ::debug-block-value ?
    ::debug-chunk-value ?
    ::debug-entity-value ?
    ::debug-event ?
    ::debug-sample ?
    ::delete-message ?
    ::disconnect ?
    ::disguised-chat-message ?
    ::entity-event ?
    ::teleport-entity ?
    ::explosion ?
    ::unload-chunk ?
    ::game-event ?
    ::game-rule-values ?
    ::game-test-highlight-position ?
    ::open-horse-screen ?
    ::hurt-animation ?
    ::initialize-world-border ?
    ::keep-alive ?
    ::chunk-data-and-update-light ?
    ::world-event ?
    ::particle ?
    ::update-light ?
    ::login ?
    ::low-disk-space-warning ?
    ::map-data ?
    ::merchant-offers ?
    ::update-entity-position ?
    ::update-entity-position-and-rotation ?
    ::move-minecart-along-track ?
    ::update-entity-rotation ?
    ::move-vehicle ?
    ::open-book ?
    ::open-screen ?
    ::open-sign-editor ?
    ::ping ?
    ::pong-response ?
    ::place-ghost-recipe ?
    ::player-abilities ?
    ::player-chat-message ?
    ::end-combat ?
    ::enter-combat ?
    ::combat-death ?
    ::player-info-remove ?
    ::player-info-update ?
    ::look-at ?
    ::synchronize-player-position ?
    ::player-rotation ?
    ::recipe-book-add ?
    ::recipe-book-remove ?
    ::recipe-book-settings ?
    ::remove-entities ?
    ::remove-entity-effect ?
    ::reset-score ?
    ::remove-resource-pack ?
    ::add-resource-pack ?
    ::respawn ?
    ::set-head-rotation ?
    ::update-section-blocks ?
    ::select-advancements-tab ?
    ::server-data ?
    ::set-action-bar-text ?
    ::set-border-center ?
    ::set-border-lerp-size ?
    ::set-border-size ?
    ::set-border-warning-delay ?
    ::set-border-warning-distance ?
    ::set-camera ?
    ::set-center-chunk ?
    ::set-render-distance ?
    ::set-cursor-item ?
    ::set-default-spawn-position ?
    ::display-objective ?
    ::set-entity-metadata ?
    ::link-entities ?
    ::set-entity-velocity ?
    ::set-equipment ?
    ::set-experience ?
    ::set-health ?
    ::set-held-item ?
    ::update-objectives ?
    ::set-passengers ?
    ::set-player-inventory-slot ?
    ::update-teams ?
    ::update-score ?
    ::set-simulation-distance ?
    ::set-subtitle-text ?
    ::update-time ?
    ::set-title-text ?
    ::set-title-animation-times ?
    ::entity-sound-effect ?
    ::sound-effect ?
    ::start-configuration ?
    ::stop-sound ?
    ::store-cookie ?
    ::system-chat-message ?
    ::set-tab-list-header-and-footer ?
    ::tag-query-response ?
    ::pickup-item ?
    ::synchronize-vehicle-position ?
    ::test-instance-block-status ?
    ::set-ticking-state ?
    ::step-tick ?
    ::transfer ?
    ::update-advancements ?
    ::update-attributes ?
    ::entity-effect ?
    ::update-recipes ?
    ::update-tags ?
    ::projectile-power ?
    ::custom-report-details ?
    ::server-links ?
    ::waypoint ?
    ::clear-dialog ?
    ::show-dialog-play ?]})