├── .changeset ├── config.json ├── smooth-dogs-clean.md └── strange-ears-stare.md ├── .editorconfig ├── .gitattributes ├── .github ├── common │ └── install │ │ └── action.yml └── workflows │ ├── docs.yml │ ├── lint.yml │ └── release.yml ├── .gitignore ├── .husky ├── commit-msg └── pre-commit ├── .npmrc ├── .nvmrc ├── .renovaterc ├── .vscode ├── extensions.json ├── serenity.code-workspace └── settings.json ├── .yarn └── releases │ └── yarn-4.5.3.cjs ├── .yarnrc.yml ├── LICENSE ├── README.md ├── bundle ├── README.md ├── index.ts └── modules │ ├── binarystream.ts │ ├── core.ts │ ├── data.ts │ ├── emitter.ts │ ├── index.ts │ ├── leveldb.ts │ ├── logger.ts │ ├── nbt.ts │ ├── plugins.ts │ ├── protocol.ts │ └── raknet.ts ├── commitlint.config.js ├── devapp ├── LICENSE ├── eslint.config.mjs ├── package.json ├── src │ └── index.ts ├── tsconfig.json └── tsup.config.ts ├── docs └── custom-block │ ├── README.md │ └── code.ts ├── package.json ├── packages ├── core │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── eslint.config.mjs │ ├── package.json │ ├── src │ │ ├── block │ │ │ ├── block.ts │ │ │ ├── container.ts │ │ │ ├── identity │ │ │ │ ├── collection.ts │ │ │ │ ├── components │ │ │ │ │ ├── collision-box.ts │ │ │ │ │ ├── component.ts │ │ │ │ │ ├── crafting-table.ts │ │ │ │ │ ├── destructible-by-mining.ts │ │ │ │ │ ├── display-name.ts │ │ │ │ │ ├── friction.ts │ │ │ │ │ ├── geometry.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interactable.ts │ │ │ │ │ ├── light-emission.ts │ │ │ │ │ ├── material-instances.ts │ │ │ │ │ ├── selection-box.ts │ │ │ │ │ └── transformation.ts │ │ │ │ ├── custom.ts │ │ │ │ ├── drops.ts │ │ │ │ ├── index.ts │ │ │ │ ├── permutation.ts │ │ │ │ └── type.ts │ │ │ ├── index.ts │ │ │ ├── maps │ │ │ │ ├── index.ts │ │ │ │ └── nbt-map.ts │ │ │ ├── palette.ts │ │ │ └── traits │ │ │ │ ├── button.ts │ │ │ │ ├── cardinal-direction.ts │ │ │ │ ├── command-block.ts │ │ │ │ ├── crafting-table.ts │ │ │ │ ├── direction.ts │ │ │ │ ├── facing-direction.ts │ │ │ │ ├── index.ts │ │ │ │ ├── inventory.ts │ │ │ │ ├── open-bit.ts │ │ │ │ ├── pillar-axis.ts │ │ │ │ ├── torch-direction.ts │ │ │ │ ├── trait.ts │ │ │ │ ├── upper-block-bit.ts │ │ │ │ ├── upside-down-bit.ts │ │ │ │ ├── vertical-half.ts │ │ │ │ └── weirdo-direction.ts │ │ ├── commands │ │ │ ├── command.ts │ │ │ ├── common │ │ │ │ ├── about.ts │ │ │ │ └── index.ts │ │ │ ├── console.ts │ │ │ ├── enums │ │ │ │ ├── custom │ │ │ │ │ ├── ability.ts │ │ │ │ │ ├── block.ts │ │ │ │ │ ├── boolean.ts │ │ │ │ │ ├── custom.ts │ │ │ │ │ ├── enchantments.ts │ │ │ │ │ ├── entity-trait.ts │ │ │ │ │ ├── entity.ts │ │ │ │ │ ├── gamemode.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── item.ts │ │ │ │ │ ├── permissions.ts │ │ │ │ │ ├── soft.ts │ │ │ │ │ ├── tag.ts │ │ │ │ │ ├── time-operation.ts │ │ │ │ │ ├── trait-action.ts │ │ │ │ │ └── world.ts │ │ │ │ ├── enum.ts │ │ │ │ ├── index.ts │ │ │ │ └── valid │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── integer.ts │ │ │ │ │ ├── json.ts │ │ │ │ │ ├── position.ts │ │ │ │ │ ├── string.ts │ │ │ │ │ ├── target.ts │ │ │ │ │ └── valid.ts │ │ │ ├── execution-state.ts │ │ │ ├── index.ts │ │ │ ├── operator │ │ │ │ ├── ability.ts │ │ │ │ ├── clear.ts │ │ │ │ ├── deop.ts │ │ │ │ ├── enchant.ts │ │ │ │ ├── entity-traits.ts │ │ │ │ ├── fill.ts │ │ │ │ ├── gamemode.ts │ │ │ │ ├── give.ts │ │ │ │ ├── index.ts │ │ │ │ ├── kick.ts │ │ │ │ ├── kill.ts │ │ │ │ ├── op.ts │ │ │ │ ├── permissions.ts │ │ │ │ ├── save.ts │ │ │ │ ├── setblock.ts │ │ │ │ ├── spawnpoint.ts │ │ │ │ ├── stop.ts │ │ │ │ ├── summon.ts │ │ │ │ ├── tag.ts │ │ │ │ ├── time.ts │ │ │ │ ├── tp.ts │ │ │ │ ├── transfer.ts │ │ │ │ └── world.ts │ │ │ ├── palette.ts │ │ │ └── registry.ts │ │ ├── constants │ │ │ ├── block.ts │ │ │ ├── index.ts │ │ │ ├── player.ts │ │ │ └── world.ts │ │ ├── container.ts │ │ ├── effect │ │ │ ├── effects │ │ │ │ ├── blindness.ts │ │ │ │ ├── darkness.ts │ │ │ │ ├── effect.ts │ │ │ │ ├── fatal-poison.ts │ │ │ │ ├── index.ts │ │ │ │ ├── instant-damage.ts │ │ │ │ ├── instant-health.ts │ │ │ │ ├── invisibility.ts │ │ │ │ ├── nauseas.ts │ │ │ │ ├── night-vision.ts │ │ │ │ ├── poison.ts │ │ │ │ ├── regeneration.ts │ │ │ │ ├── slowness.ts │ │ │ │ ├── speed.ts │ │ │ │ ├── water-breathing.ts │ │ │ │ └── wither.ts │ │ │ ├── index.ts │ │ │ └── pallete.ts │ │ ├── entity │ │ │ ├── container.ts │ │ │ ├── entity.ts │ │ │ ├── identity │ │ │ │ ├── custom.ts │ │ │ │ ├── index.ts │ │ │ │ ├── properties │ │ │ │ │ ├── boolean.ts │ │ │ │ │ ├── enum.ts │ │ │ │ │ ├── float.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── int.ts │ │ │ │ │ └── property.ts │ │ │ │ ├── registry.ts │ │ │ │ └── type.ts │ │ │ ├── index.ts │ │ │ ├── input-info.ts │ │ │ ├── maps │ │ │ │ ├── ability-map.ts │ │ │ │ ├── actor-flag-map.ts │ │ │ │ ├── attribute-map.ts │ │ │ │ ├── index.ts │ │ │ │ ├── metadata-map.ts │ │ │ │ └── shared-properties.ts │ │ │ ├── palette.ts │ │ │ ├── player.ts │ │ │ ├── screen-display.ts │ │ │ ├── system-info.ts │ │ │ └── traits │ │ │ │ ├── air-supply.ts │ │ │ │ ├── attribute │ │ │ │ ├── attribute.ts │ │ │ │ ├── health.ts │ │ │ │ ├── index.ts │ │ │ │ └── movement.ts │ │ │ │ ├── collision.ts │ │ │ │ ├── effects.ts │ │ │ │ ├── equipment.ts │ │ │ │ ├── gravity.ts │ │ │ │ ├── index.ts │ │ │ │ ├── inventory.ts │ │ │ │ ├── item-stack.ts │ │ │ │ ├── look-at-player.ts │ │ │ │ ├── npc.ts │ │ │ │ ├── physics.ts │ │ │ │ ├── player │ │ │ │ ├── chunk-rendering.ts │ │ │ │ ├── combat.ts │ │ │ │ ├── command-executor.ts │ │ │ │ ├── crafting-input.ts │ │ │ │ ├── cursor.ts │ │ │ │ ├── entity-rendering.ts │ │ │ │ ├── hunger.ts │ │ │ │ ├── index.ts │ │ │ │ ├── player-list.ts │ │ │ │ └── trait.ts │ │ │ │ ├── rideable │ │ │ │ ├── index.ts │ │ │ │ ├── rideable.ts │ │ │ │ ├── riding.ts │ │ │ │ └── seat.ts │ │ │ │ ├── trait.ts │ │ │ │ └── visibility.ts │ │ ├── enums │ │ │ ├── block-identifier.ts │ │ │ ├── block-tool-type.ts │ │ │ ├── cardinal-direction.ts │ │ │ ├── entity-identifier.ts │ │ │ ├── entity-interact-method.ts │ │ │ ├── facing-direction.ts │ │ │ ├── index.ts │ │ │ ├── item-category.ts │ │ │ ├── item-group.ts │ │ │ ├── item-identifier.ts │ │ │ ├── item-lock-mode.ts │ │ │ ├── item-wearable-tier.ts │ │ │ ├── network-bound.ts │ │ │ ├── server-event.ts │ │ │ ├── server-state.ts │ │ │ ├── time-of-day.ts │ │ │ ├── tool-tier.ts │ │ │ ├── tool-type.ts │ │ │ ├── torch-direction.ts │ │ │ └── world-event.ts │ │ ├── events │ │ │ ├── block-permutation-update.ts │ │ │ ├── block-update.ts │ │ │ ├── chunk-ready.ts │ │ │ ├── effect-add.ts │ │ │ ├── effect-remove.ts │ │ │ ├── entity-attribute-update.ts │ │ │ ├── entity-despawned.ts │ │ │ ├── entity-die.ts │ │ │ ├── entity-dimension-change.ts │ │ │ ├── entity-drop-item.ts │ │ │ ├── entity-flag-update.ts │ │ │ ├── entity-health-changed.ts │ │ │ ├── entity-hit.ts │ │ │ ├── entity-hurt.ts │ │ │ ├── entity-metadata-update.ts │ │ │ ├── entity-spawned.ts │ │ │ ├── event-signal.ts │ │ │ ├── gamemode-change.ts │ │ │ ├── index.ts │ │ │ ├── player-ability-update.ts │ │ │ ├── player-block-interact.ts │ │ │ ├── player-break-block.ts │ │ │ ├── player-chat.ts │ │ │ ├── player-closed-container.ts │ │ │ ├── player-container-interaction.ts │ │ │ ├── player-entity-interact.ts │ │ │ ├── player-initialized.ts │ │ │ ├── player-join.ts │ │ │ ├── player-leave.ts │ │ │ ├── player-opened-container.ts │ │ │ ├── player-place-block.ts │ │ │ ├── player-start-emoting.ts │ │ │ ├── player-start-using-item.ts │ │ │ ├── player-stop-emoting.ts │ │ │ ├── player-stop-using-item.ts │ │ │ ├── player-use-item-on-block.ts │ │ │ ├── player-use-item-on-entity.ts │ │ │ ├── player-use-item.ts │ │ │ ├── world-initialize.ts │ │ │ └── world-tick.ts │ │ ├── handlers │ │ │ ├── actor-event.ts │ │ │ ├── animate.ts │ │ │ ├── block-pick-request.ts │ │ │ ├── command-block-update.ts │ │ │ ├── command-request.ts │ │ │ ├── container-close.ts │ │ │ ├── disconnect.ts │ │ │ ├── emote.ts │ │ │ ├── entity-pick-request.ts │ │ │ ├── index.ts │ │ │ ├── interact.ts │ │ │ ├── inventory-transaction.ts │ │ │ ├── item-stack-request.ts │ │ │ ├── login.ts │ │ │ ├── mob-equipment.ts │ │ │ ├── modal-form-response.ts │ │ │ ├── npc-request.ts │ │ │ ├── packet-violation-warning.ts │ │ │ ├── player-action.ts │ │ │ ├── player-auth-input.ts │ │ │ ├── request-chunk-radius.ts │ │ │ ├── request-network-settings.ts │ │ │ ├── request-permissions.ts │ │ │ ├── resource-pack-chunk-request.ts │ │ │ ├── resource-pack-response.ts │ │ │ ├── respawn.ts │ │ │ ├── set-default-gamemode.ts │ │ │ ├── set-difficulty.ts │ │ │ ├── set-local-player-as-initialized.ts │ │ │ ├── set-player-game-type.ts │ │ │ └── text.ts │ │ ├── index.ts │ │ ├── item │ │ │ ├── creative │ │ │ │ ├── descriptor.ts │ │ │ │ ├── group.ts │ │ │ │ └── index.ts │ │ │ ├── identity │ │ │ │ ├── collection.ts │ │ │ │ ├── components │ │ │ │ │ ├── block-placer.ts │ │ │ │ │ ├── can-destroy-in-creative.ts │ │ │ │ │ ├── component.ts │ │ │ │ │ ├── cooldown.ts │ │ │ │ │ ├── digger.ts │ │ │ │ │ ├── display-name.ts │ │ │ │ │ ├── hand_equipped.ts │ │ │ │ │ ├── icon.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── item-properties.ts │ │ │ │ │ ├── max-stack-size.ts │ │ │ │ │ └── wearable.ts │ │ │ │ ├── custom.ts │ │ │ │ ├── index.ts │ │ │ │ └── type.ts │ │ │ ├── index.ts │ │ │ ├── maps │ │ │ │ ├── index.ts │ │ │ │ └── nbt-map.ts │ │ │ ├── palette.ts │ │ │ ├── stack.ts │ │ │ ├── traits │ │ │ │ ├── bundle.ts │ │ │ │ ├── display.ts │ │ │ │ ├── durability.ts │ │ │ │ ├── enchantable.ts │ │ │ │ ├── food.ts │ │ │ │ ├── index.ts │ │ │ │ ├── keep-on-die.ts │ │ │ │ ├── liquid-container.ts │ │ │ │ ├── lock.ts │ │ │ │ ├── shooter.ts │ │ │ │ ├── spawn-egg.ts │ │ │ │ ├── sword.ts │ │ │ │ ├── trait.ts │ │ │ │ ├── weapon.ts │ │ │ │ └── wearable.ts │ │ │ └── types │ │ │ │ ├── index.ts │ │ │ │ ├── item-stack-data-entry.ts │ │ │ │ ├── item-stack-options.ts │ │ │ │ ├── item-stack-storage.ts │ │ │ │ ├── item-stack-use-options.ts │ │ │ │ └── item-type-options.ts │ │ ├── loot │ │ │ ├── index.ts │ │ │ ├── pool.ts │ │ │ └── table.ts │ │ ├── network │ │ │ ├── handler.ts │ │ │ ├── index.ts │ │ │ └── network.ts │ │ ├── pathfinding │ │ │ ├── astar.ts │ │ │ ├── evaluator.ts │ │ │ ├── heap.ts │ │ │ ├── index.ts │ │ │ └── node.ts │ │ ├── permissions │ │ │ ├── group.ts │ │ │ ├── index.ts │ │ │ └── member.ts │ │ ├── resources │ │ │ ├── index.ts │ │ │ ├── pack.ts │ │ │ └── resources.ts │ │ ├── serenity.ts │ │ ├── simulation.ts │ │ ├── trait.ts │ │ ├── types │ │ │ ├── block │ │ │ │ ├── block.ts │ │ │ │ ├── blocks.ts │ │ │ │ ├── index.ts │ │ │ │ ├── options.ts │ │ │ │ ├── state.ts │ │ │ │ └── states.ts │ │ │ ├── commands │ │ │ │ ├── arguments.ts │ │ │ │ ├── callback.ts │ │ │ │ ├── context.ts │ │ │ │ ├── index.ts │ │ │ │ ├── overload.ts │ │ │ │ ├── registry.ts │ │ │ │ └── response.ts │ │ │ ├── components │ │ │ │ ├── index.ts │ │ │ │ ├── item-stack.ts │ │ │ │ └── player.ts │ │ │ ├── entity │ │ │ │ ├── entity.ts │ │ │ │ ├── index.ts │ │ │ │ ├── options.ts │ │ │ │ ├── player.ts │ │ │ │ ├── title-display-options.ts │ │ │ │ └── traits.ts │ │ │ ├── index.ts │ │ │ ├── json.ts │ │ │ ├── loot.ts │ │ │ ├── network │ │ │ │ ├── events.ts │ │ │ │ ├── index.ts │ │ │ │ └── packet-event.ts │ │ │ ├── permissions.ts │ │ │ ├── resource │ │ │ │ ├── index.ts │ │ │ │ ├── manifest.ts │ │ │ │ └── properties.ts │ │ │ ├── serenity-properties.ts │ │ │ ├── serenity │ │ │ │ ├── events.ts │ │ │ │ ├── index.ts │ │ │ │ └── options.ts │ │ │ └── world │ │ │ │ ├── dimension.ts │ │ │ │ ├── events.ts │ │ │ │ ├── generator │ │ │ │ ├── index.ts │ │ │ │ └── properties.ts │ │ │ │ ├── index.ts │ │ │ │ ├── properties.ts │ │ │ │ └── provider.ts │ │ ├── ui │ │ │ ├── action.ts │ │ │ ├── bossbar.ts │ │ │ ├── dialogue.ts │ │ │ ├── form.ts │ │ │ ├── index.ts │ │ │ ├── message.ts │ │ │ └── modal.ts │ │ └── world │ │ │ ├── chunk │ │ │ ├── block-storage.ts │ │ │ ├── chunk.ts │ │ │ ├── index.ts │ │ │ └── sub-chunk.ts │ │ │ ├── dimension.ts │ │ │ ├── generator │ │ │ ├── generator.ts │ │ │ ├── index.ts │ │ │ ├── superflat.ts │ │ │ └── void.ts │ │ │ ├── index.ts │ │ │ ├── provider │ │ │ ├── index.ts │ │ │ ├── internal.ts │ │ │ ├── leveldb.ts │ │ │ └── provider.ts │ │ │ ├── schedule.ts │ │ │ ├── scoreboard │ │ │ ├── display-options.ts │ │ │ ├── identity.ts │ │ │ ├── index.ts │ │ │ ├── objective.ts │ │ │ └── scoreboard.ts │ │ │ └── world.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── typedoc.json ├── data │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── package.json │ ├── src │ │ ├── bin │ │ │ └── crafting_data.json │ │ ├── index.ts │ │ └── json │ │ │ ├── block_drops.json │ │ │ ├── block_metadata.json │ │ │ ├── block_permutations.json │ │ │ ├── block_states.json │ │ │ ├── block_types.json │ │ │ ├── creative_content.json │ │ │ ├── creative_groups.json │ │ │ ├── entity_types.json │ │ │ ├── item_metadata.json │ │ │ ├── item_types.json │ │ │ └── tool_types.json │ ├── tsconfig.json │ ├── tsup.config.ts │ └── typedoc.json ├── emitter │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── package.json │ ├── src │ │ ├── get-path.ts │ │ └── index.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── typedoc.json ├── internal-config │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint │ │ ├── eslint.config.base.d.mts │ │ └── eslint.config.base.mjs │ ├── package.json │ ├── tsup │ │ ├── tsup.config.base.d.mts │ │ └── tsup.config.base.mjs │ └── typescript │ │ └── tsconfig.base.json ├── logger │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── logger-colors.ts │ │ ├── logger.ts │ │ └── minecraft-colors.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── typedoc.json ├── nbt │ ├── CHANGELOG.md │ ├── README.md │ ├── __tests__ │ │ └── name.test.ts │ ├── eslint.config.mjs │ ├── package.json │ ├── src │ │ ├── enum │ │ │ ├── index.ts │ │ │ └── tag-type.ts │ │ ├── index.ts │ │ └── types │ │ │ ├── byte-array.ts │ │ │ ├── byte.ts │ │ │ ├── code-point-string.ts │ │ │ ├── compound.ts │ │ │ ├── double.ts │ │ │ ├── float.ts │ │ │ ├── index.ts │ │ │ ├── int.ts │ │ │ ├── list.ts │ │ │ ├── long.ts │ │ │ ├── short.ts │ │ │ ├── string.ts │ │ │ └── tag.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── typedoc.json ├── plugins │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── eslint.config.mjs │ ├── package.json │ ├── public │ │ ├── creating-plugin.png │ │ └── template-generation.png │ ├── src │ │ ├── commands │ │ │ ├── command.ts │ │ │ ├── enum.ts │ │ │ └── index.ts │ │ ├── enums │ │ │ ├── index.ts │ │ │ ├── priority.ts │ │ │ └── type.ts │ │ ├── index.ts │ │ ├── pipeline.ts │ │ ├── plugin.ts │ │ ├── registry │ │ │ ├── block.ts │ │ │ ├── entity.ts │ │ │ ├── index.ts │ │ │ └── item.ts │ │ └── types │ │ │ ├── after-events.ts │ │ │ ├── before-events.ts │ │ │ ├── events.ts │ │ │ ├── index.ts │ │ │ ├── on-events.ts │ │ │ └── package.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── typedoc.json ├── protocol │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── package.json │ ├── src │ │ ├── constants │ │ │ ├── default-ability-values.ts │ │ │ └── index.ts │ │ ├── enums │ │ │ ├── ability-index.ts │ │ │ ├── ability-layer-type.ts │ │ │ ├── ability-set.ts │ │ │ ├── actor-damage-cause.ts │ │ │ ├── actor-data-id.ts │ │ │ ├── actor-data-type.ts │ │ │ ├── actor-event.ts │ │ │ ├── actor-flag.ts │ │ │ ├── actor-link-type.ts │ │ │ ├── animate-id.ts │ │ │ ├── attribute-name.ts │ │ │ ├── block-event-type.ts │ │ │ ├── block-face.ts │ │ │ ├── book-edit-action.ts │ │ │ ├── boss-event-color.ts │ │ │ ├── boss-event-update-type.ts │ │ │ ├── camera-audio-listeners.ts │ │ │ ├── client-input-locks-flag.ts │ │ │ ├── command-block-mode.ts │ │ │ ├── command-parameter-type.ts │ │ │ ├── command-permission-level.ts │ │ │ ├── complex-inventory-transaction.ts │ │ │ ├── compression-method.ts │ │ │ ├── container-data-type.ts │ │ │ ├── container-id.ts │ │ │ ├── container-name.ts │ │ │ ├── container-type.ts │ │ │ ├── crafting-data-entry-type.ts │ │ │ ├── creative-item-category.ts │ │ │ ├── creative-item-group.ts │ │ │ ├── debugger-protocol-version.ts │ │ │ ├── decoration-type.ts │ │ │ ├── device-o-s.ts │ │ │ ├── difficulty.ts │ │ │ ├── dimension-type.ts │ │ │ ├── disconnect-reason.ts │ │ │ ├── display-slot-type.ts │ │ │ ├── easing-type.ts │ │ │ ├── effect-type.ts │ │ │ ├── emote-flag.ts │ │ │ ├── enchantment.ts │ │ │ ├── entity-property-type.ts │ │ │ ├── equipment-slot.ts │ │ │ ├── game-rule-type.ts │ │ │ ├── game-rule.ts │ │ │ ├── gamemode.ts │ │ │ ├── generator-type.ts │ │ │ ├── graphics-mode.ts │ │ │ ├── hud-element.ts │ │ │ ├── hud-visibility.ts │ │ │ ├── index.ts │ │ │ ├── input-data.ts │ │ │ ├── input-lock-flags.ts │ │ │ ├── input-mode.ts │ │ │ ├── interact-action.ts │ │ │ ├── interaction-mode.ts │ │ │ ├── internal-type.ts │ │ │ ├── inventory-layout.ts │ │ │ ├── inventory-left-tab.ts │ │ │ ├── inventory-right-tab.ts │ │ │ ├── inventory-source-type.ts │ │ │ ├── item-release-inventory-transaction-type.ts │ │ │ ├── item-stack-request-action-type.ts │ │ │ ├── item-stack-status.ts │ │ │ ├── item-use-inventory-transaction-type.ts │ │ │ ├── item-use-method.ts │ │ │ ├── item-use-on-entity-inventory-transaction-type.ts │ │ │ ├── level-event.ts │ │ │ ├── level-sound-event.ts │ │ │ ├── material-render-method.ts │ │ │ ├── memory-tier.ts │ │ │ ├── mob-effect-events.ts │ │ │ ├── modal-form-canceled-reason.ts │ │ │ ├── modal-form-type.ts │ │ │ ├── move-delta-flags.ts │ │ │ ├── move-mode.ts │ │ │ ├── movement-effect-type.ts │ │ │ ├── npc-dialogue-action.ts │ │ │ ├── npc-request-type.ts │ │ │ ├── objective-sort-order.ts │ │ │ ├── pack-type.ts │ │ │ ├── packet.ts │ │ │ ├── permission-flag.ts │ │ │ ├── permission-level.ts │ │ │ ├── play-mode.ts │ │ │ ├── play-status.ts │ │ │ ├── player-action-type.ts │ │ │ ├── player-list-action.ts │ │ │ ├── player-update-entity-overrides-type.ts │ │ │ ├── predicted-result.ts │ │ │ ├── prediction-type.ts │ │ │ ├── resource-pack-response.ts │ │ │ ├── respawn-state.ts │ │ │ ├── scoreboard-action-type.ts │ │ │ ├── scoreboard-identity-action.ts │ │ │ ├── scoreboard-identity-type.ts │ │ │ ├── server-auth-movement-mode.ts │ │ │ ├── serverbound-loading-screen-type.ts │ │ │ ├── shake-action.ts │ │ │ ├── shake-type.ts │ │ │ ├── spawn-type.ts │ │ │ ├── telemetry-event-type.ts │ │ │ ├── text-packet-type.ts │ │ │ ├── title-type.ts │ │ │ ├── tracked-item.ts │ │ │ ├── transaction-source-type.ts │ │ │ ├── trigger-type.ts │ │ │ ├── unlocking-context.ts │ │ │ ├── update-block-flags-type.ts │ │ │ ├── update-block-layer-type.ts │ │ │ ├── update-type.ts │ │ │ ├── violation-severity.ts │ │ │ ├── violation-type.ts │ │ │ └── wearable-slot.ts │ │ ├── index.ts │ │ ├── proto │ │ │ ├── data │ │ │ │ ├── actor-event.ts │ │ │ │ ├── add-entity.ts │ │ │ │ ├── add-item-actor.ts │ │ │ │ ├── add-painting.ts │ │ │ │ ├── add-player.ts │ │ │ │ ├── animate-entity.ts │ │ │ │ ├── animate.ts │ │ │ │ ├── available-actor-identifiers.ts │ │ │ │ ├── available-commands.ts │ │ │ │ ├── award-achievement.ts │ │ │ │ ├── biome-definition-list.ts │ │ │ │ ├── block-actor-data.ts │ │ │ │ ├── block-event.ts │ │ │ │ ├── block-pick-request.ts │ │ │ │ ├── book-edit.ts │ │ │ │ ├── boss-event.ts │ │ │ │ ├── camera-instructions.ts │ │ │ │ ├── camera-presets.ts │ │ │ │ ├── camera-shake.ts │ │ │ │ ├── change-dimension.ts │ │ │ │ ├── chunk-radius-update.ts │ │ │ │ ├── client-bound-debug-renderer.ts │ │ │ │ ├── client-bound-map-item-data.ts │ │ │ │ ├── client-cache-status.ts │ │ │ │ ├── client-to-server-handshake.ts │ │ │ │ ├── clientbound-close-form.ts │ │ │ │ ├── command-block-update.ts │ │ │ │ ├── command-output.ts │ │ │ │ ├── command-request.ts │ │ │ │ ├── completed-using-item.ts │ │ │ │ ├── container-close.ts │ │ │ │ ├── container-open.ts │ │ │ │ ├── container-set-data.ts │ │ │ │ ├── correct-player-move-prediction.ts │ │ │ │ ├── crafting-data.ts │ │ │ │ ├── creative-content.ts │ │ │ │ ├── current-structure-feature.ts │ │ │ │ ├── data-packet.ts │ │ │ │ ├── death-info.ts │ │ │ │ ├── debug-info.ts │ │ │ │ ├── dimension-data.ts │ │ │ │ ├── disconnect.ts │ │ │ │ ├── emote-list.ts │ │ │ │ ├── emote.ts │ │ │ │ ├── entity-pick-request.ts │ │ │ │ ├── game-rules-changed.ts │ │ │ │ ├── hurt-armor.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interact.ts │ │ │ │ ├── inventory-content.ts │ │ │ │ ├── inventory-slot.ts │ │ │ │ ├── inventory-transaction.ts │ │ │ │ ├── item-registry.ts │ │ │ │ ├── item-stack-request.ts │ │ │ │ ├── item-stack-response.ts │ │ │ │ ├── legacy-telemetry-event.ts │ │ │ │ ├── level-chunk.ts │ │ │ │ ├── level-event-generic.ts │ │ │ │ ├── level-event.ts │ │ │ │ ├── level-sound-event.ts │ │ │ │ ├── login.ts │ │ │ │ ├── map-info-request.ts │ │ │ │ ├── mob-armor-equipment.ts │ │ │ │ ├── mob-effect.ts │ │ │ │ ├── mob-equipment.ts │ │ │ │ ├── modal-form-request.ts │ │ │ │ ├── modal-form-response.ts │ │ │ │ ├── motion-prediction-hints.ts │ │ │ │ ├── move-actor-absolute.ts │ │ │ │ ├── move-actor-delta.ts │ │ │ │ ├── move-player.ts │ │ │ │ ├── movement-effect.ts │ │ │ │ ├── network-chunk-publisher-update.ts │ │ │ │ ├── network-settings.ts │ │ │ │ ├── network-stack-latency.ts │ │ │ │ ├── npc-dialogue.ts │ │ │ │ ├── npc-request.ts │ │ │ │ ├── on-screen-texture-animation.ts │ │ │ │ ├── open-sign.ts │ │ │ │ ├── packet-violation-warning.ts │ │ │ │ ├── packets.ts │ │ │ │ ├── play-sound.ts │ │ │ │ ├── play-status.ts │ │ │ │ ├── player-action.ts │ │ │ │ ├── player-auth-input.ts │ │ │ │ ├── player-enchant-options.ts │ │ │ │ ├── player-fog.ts │ │ │ │ ├── player-hotbar.ts │ │ │ │ ├── player-list.ts │ │ │ │ ├── player-skin.ts │ │ │ │ ├── player-start-item-cooldown.ts │ │ │ │ ├── player-update-entity-overrides.ts │ │ │ │ ├── remove-entity.ts │ │ │ │ ├── remove-objective.ts │ │ │ │ ├── request-chunk-radius.ts │ │ │ │ ├── request-network-settings.ts │ │ │ │ ├── request-permissions.ts │ │ │ │ ├── resource-pack-chunk-data.ts │ │ │ │ ├── resource-pack-chunk-request.ts │ │ │ │ ├── resource-pack-client-response.ts │ │ │ │ ├── resource-pack-data-info.ts │ │ │ │ ├── resource-pack-stack.ts │ │ │ │ ├── resource-packs-info.ts │ │ │ │ ├── respawn.ts │ │ │ │ ├── rider-jump.ts │ │ │ │ ├── script-message.ts │ │ │ │ ├── server-bound-loading-screen.ts │ │ │ │ ├── server-settings-response.ts │ │ │ │ ├── server-to-client-handshake.ts │ │ │ │ ├── serverbound-diagnostics.ts │ │ │ │ ├── set-actor-data.ts │ │ │ │ ├── set-actor-link.ts │ │ │ │ ├── set-actor-motion.ts │ │ │ │ ├── set-commands-enabled.ts │ │ │ │ ├── set-default-gamemode.ts │ │ │ │ ├── set-difficulty.ts │ │ │ │ ├── set-display-objective.ts │ │ │ │ ├── set-health.ts │ │ │ │ ├── set-hud.ts │ │ │ │ ├── set-last-hurt-by.ts │ │ │ │ ├── set-local-player-as-initialized.ts │ │ │ │ ├── set-player-game-type.ts │ │ │ │ ├── set-player-inventory-options.ts │ │ │ │ ├── set-score.ts │ │ │ │ ├── set-scoreboard-identity.ts │ │ │ │ ├── set-spawn-position.ts │ │ │ │ ├── set-time.ts │ │ │ │ ├── set-title.ts │ │ │ │ ├── show-credits.ts │ │ │ │ ├── show-profile.ts │ │ │ │ ├── spawn-particle-effect.ts │ │ │ │ ├── start-game.ts │ │ │ │ ├── stop-sound.ts │ │ │ │ ├── structure-block-update.ts │ │ │ │ ├── sync-actor-property.ts │ │ │ │ ├── take-item-actor.ts │ │ │ │ ├── text.ts │ │ │ │ ├── toast-request.ts │ │ │ │ ├── transfer.ts │ │ │ │ ├── trim-data.ts │ │ │ │ ├── unlocked-recipes.ts │ │ │ │ ├── update-abilities.ts │ │ │ │ ├── update-adventure-settings.ts │ │ │ │ ├── update-attributes.ts │ │ │ │ ├── update-block-sync.ts │ │ │ │ ├── update-block.ts │ │ │ │ ├── update-client-input-locks.ts │ │ │ │ ├── update-player-game-type.ts │ │ │ │ ├── update-subchunk-blocks.ts │ │ │ │ └── update-trade.ts │ │ │ ├── debug │ │ │ │ ├── event.ts │ │ │ │ └── index.ts │ │ │ ├── framer.ts │ │ │ ├── index.ts │ │ │ ├── packet-id.ts │ │ │ ├── pool.ts │ │ │ └── types │ │ │ │ ├── ability-layer.ts │ │ │ │ ├── ability-set.ts │ │ │ │ ├── actor-link-set.ts │ │ │ │ ├── actor-link.ts │ │ │ │ ├── animate-action.ts │ │ │ │ ├── animate-entity.ts │ │ │ │ ├── attribute-modifier.ts │ │ │ │ ├── attribute.ts │ │ │ │ ├── behavior-pack-info.ts │ │ │ │ ├── block-action.ts │ │ │ │ ├── block-position.ts │ │ │ │ ├── block-update.ts │ │ │ │ ├── book-actions.ts │ │ │ │ ├── boss-event-add.ts │ │ │ │ ├── boss-event-update.ts │ │ │ │ ├── camera-fade-duration.ts │ │ │ │ ├── camera-instruction-fade.ts │ │ │ │ ├── camera-instruction-set.ts │ │ │ │ ├── camera-instructions.ts │ │ │ │ ├── camera-preset.ts │ │ │ │ ├── camera-set-easing.ts │ │ │ │ ├── chained-subcommand-values.ts │ │ │ │ ├── chunk-coords.ts │ │ │ │ ├── client-predicted-vehicle.ts │ │ │ │ ├── color.ts │ │ │ │ ├── command-block-actor-runtime-id.ts │ │ │ │ ├── command-block-settings.ts │ │ │ │ ├── command-origin-data.ts │ │ │ │ ├── command-output-data.ts │ │ │ │ ├── command-output-message.ts │ │ │ │ ├── commands.ts │ │ │ │ ├── container-mix-data-entry.ts │ │ │ │ ├── crafting-data-entry.ts │ │ │ │ ├── creative-group.ts │ │ │ │ ├── creative-item.ts │ │ │ │ ├── data-item.ts │ │ │ │ ├── death-parameters.ts │ │ │ │ ├── decoration-update-bits.ts │ │ │ │ ├── dimension-definition-group.ts │ │ │ │ ├── dimension-definition.ts │ │ │ │ ├── disconnect-message.ts │ │ │ │ ├── dynamic-enums.ts │ │ │ │ ├── emotes.ts │ │ │ │ ├── enchant-option.ts │ │ │ │ ├── enchant.ts │ │ │ │ ├── entity-attributes.ts │ │ │ │ ├── enum-constraints.ts │ │ │ │ ├── enum-values.ts │ │ │ │ ├── enums.ts │ │ │ │ ├── experiments.ts │ │ │ │ ├── fogs.ts │ │ │ │ ├── full-container-name.ts │ │ │ │ ├── furnance-aux-recipe.ts │ │ │ │ ├── furnance-recipe.ts │ │ │ │ ├── game-rules.ts │ │ │ │ ├── hud-element-data.ts │ │ │ │ ├── index.ts │ │ │ │ ├── input-transaction.ts │ │ │ │ ├── interact-position.ts │ │ │ │ ├── inventory-action.ts │ │ │ │ ├── inventory-source.ts │ │ │ │ ├── inventory-transaction.ts │ │ │ │ ├── item-data.ts │ │ │ │ ├── item-instance-user-data.ts │ │ │ │ ├── item-release-inventory-transaction.ts │ │ │ │ ├── item-stack-request-action-beacon-payment.ts │ │ │ │ ├── item-stack-request-action-craft-creative.ts │ │ │ │ ├── item-stack-request-action-craft-grindstone-request.ts │ │ │ │ ├── item-stack-request-action-craft-loom-request.ts │ │ │ │ ├── item-stack-request-action-craft-recipe-auto.ts │ │ │ │ ├── item-stack-request-action-craft-recipe.ts │ │ │ │ ├── item-stack-request-action-create.ts │ │ │ │ ├── item-stack-request-action-destroy-consume.ts │ │ │ │ ├── item-stack-request-action-drop.ts │ │ │ │ ├── item-stack-request-action-mine-block.ts │ │ │ │ ├── item-stack-request-action-optional.ts │ │ │ │ ├── item-stack-request-action-results-deprecated.ts │ │ │ │ ├── item-stack-request-action-swap.ts │ │ │ │ ├── item-stack-request-action-take-place.ts │ │ │ │ ├── item-stack-request-action.ts │ │ │ │ ├── item-stack-request-slot-info.ts │ │ │ │ ├── item-stack-request.ts │ │ │ │ ├── item-stack-responses.ts │ │ │ │ ├── item-stacks.ts │ │ │ │ ├── item-use-inventory-transaction.ts │ │ │ │ ├── item-use-on-entity-inventory-transaction.ts │ │ │ │ ├── legacy-transaction.ts │ │ │ │ ├── login-tokens.ts │ │ │ │ ├── map-creation-bits.ts │ │ │ │ ├── map-decoration.ts │ │ │ │ ├── map-pixels.ts │ │ │ │ ├── map-scale.ts │ │ │ │ ├── map-tracked-item.ts │ │ │ │ ├── material-reducer-data-entry.ts │ │ │ │ ├── materials.ts │ │ │ │ ├── modal-form-canceled.ts │ │ │ │ ├── modal-form-data.ts │ │ │ │ ├── multi-recipe.ts │ │ │ │ ├── nbt-loop.ts │ │ │ │ ├── network-block-type-definition.ts │ │ │ │ ├── network-item-instance-descriptor.ts │ │ │ │ ├── network-item-stack-descriptor.ts │ │ │ │ ├── optional.ts │ │ │ │ ├── pack-links.ts │ │ │ │ ├── packed-item-use-legacy-inventory-transaction.ts │ │ │ │ ├── packed-legacy-transaction.ts │ │ │ │ ├── patterns.ts │ │ │ │ ├── player-auth-input-data.ts │ │ │ │ ├── player-auth-input-transaction.ts │ │ │ │ ├── player-auth-item-stack-request.ts │ │ │ │ ├── player-block-action-data.ts │ │ │ │ ├── player-block-actions.ts │ │ │ │ ├── player-input-tick.ts │ │ │ │ ├── player-list-record.ts │ │ │ │ ├── player-update-entity-overrides-value.ts │ │ │ │ ├── post-fixes.ts │ │ │ │ ├── potion-max-data-entry.ts │ │ │ │ ├── property-sync-data.ts │ │ │ │ ├── recipe-ingredient.ts │ │ │ │ ├── recipe-unlocking-requirement.ts │ │ │ │ ├── resource-id-versions.ts │ │ │ │ ├── resource-pack-ids.ts │ │ │ │ ├── rotation-byte.ts │ │ │ │ ├── rotation.ts │ │ │ │ ├── score-entry.ts │ │ │ │ ├── scoreboard-identity.ts │ │ │ │ ├── serialized-skin.ts │ │ │ │ ├── shaped-recipe.ts │ │ │ │ ├── shapeless-recipe.ts │ │ │ │ ├── signed-block-position.ts │ │ │ │ ├── skin-animation.ts │ │ │ │ ├── skin-image.ts │ │ │ │ ├── skin-persona-piece.ts │ │ │ │ ├── skin-persona-tint-piece.ts │ │ │ │ ├── smithing-transform-recipe.ts │ │ │ │ ├── smithing-trim-recipe.ts │ │ │ │ ├── structure-editor-data.ts │ │ │ │ ├── structure-settings.ts │ │ │ │ ├── subchunk-blocks.ts │ │ │ │ ├── subcommands.ts │ │ │ │ ├── teleport-cause.ts │ │ │ │ ├── text-parameters.ts │ │ │ │ ├── text-source.ts │ │ │ │ ├── texture-pack-info.ts │ │ │ │ ├── texture-update-bits.ts │ │ │ │ ├── trade-offer.ts │ │ │ │ ├── unlocked-recipes-entry.ts │ │ │ │ ├── user-data-shapeless-recipe.ts │ │ │ │ ├── variable-string-array.ts │ │ │ │ ├── vector2f.ts │ │ │ │ └── vector3f.ts │ │ └── types │ │ │ ├── index.ts │ │ │ ├── legacy-telemetry-event-data.ts │ │ │ ├── login-data.ts │ │ │ ├── position.ts │ │ │ ├── trim-data-material.ts │ │ │ ├── trim-data-pattern.ts │ │ │ └── unlocked-recipes-type.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── typedoc.json └── raknet │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── package.json │ ├── src │ ├── constants │ │ ├── index.ts │ │ └── raknet.ts │ ├── decorators │ │ ├── index.ts │ │ ├── proto.ts │ │ └── serialize.ts │ ├── enums │ │ ├── bit-flags.ts │ │ ├── index.ts │ │ ├── packet.ts │ │ ├── priority.ts │ │ ├── reliability.ts │ │ └── status.ts │ ├── index.ts │ ├── proto │ │ ├── data │ │ │ ├── ack.ts │ │ │ ├── base.ts │ │ │ ├── connected-ping.ts │ │ │ ├── connected-pong.ts │ │ │ ├── connection-request-accepted.ts │ │ │ ├── connection-request.ts │ │ │ ├── disconnect.ts │ │ │ ├── frame-set.ts │ │ │ ├── incompatible-protocol.ts │ │ │ ├── index.ts │ │ │ ├── nack.ts │ │ │ ├── new-incoming-connection.ts │ │ │ ├── open-connection-reply-1.ts │ │ │ ├── open-connection-reply-2.ts │ │ │ ├── open-connection-request-1.ts │ │ │ ├── open-connection-request-2.ts │ │ │ ├── unconnected-ping.ts │ │ │ └── unconnected-pong.ts │ │ ├── index.ts │ │ └── types │ │ │ ├── address.ts │ │ │ ├── frame.ts │ │ │ ├── index.ts │ │ │ ├── magic.ts │ │ │ ├── mtu.ts │ │ │ ├── system-address.ts │ │ │ └── type.ts │ ├── server │ │ ├── connection.ts │ │ ├── index.ts │ │ ├── offline.ts │ │ └── raknet.ts │ └── types │ │ ├── index.ts │ │ ├── network │ │ ├── identifier.ts │ │ ├── index.ts │ │ └── server.ts │ │ ├── packet │ │ ├── index.ts │ │ ├── metadata.ts │ │ └── valid.ts │ │ └── properties.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── typedoc.json ├── turbo.json ├── typedoc.json └── yarn.lock /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@latest/schema.json", 3 | "changelog": [ 4 | "@changesets/changelog-github", 5 | { 6 | "repo": "SerenityJS/serenity" 7 | } 8 | ], 9 | "commit": false, 10 | "fixed": [], 11 | "linked": [], 12 | "ignore": ["dev-app"], 13 | "access": "public", 14 | "baseBranch": "main", 15 | "updateInternalDependencies": "patch", 16 | "snapshot": { 17 | "useCalculatedVersion": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.changeset/smooth-dogs-clean.md: -------------------------------------------------------------------------------- 1 | --- 2 | "@serenityjs/core": patch 3 | "@serenityjs/data": patch 4 | "@serenityjs/emitter": patch 5 | "@serenityjs/internal-config": patch 6 | "@serenityjs/logger": patch 7 | "@serenityjs/nbt": patch 8 | "@serenityjs/plugins": patch 9 | "@serenityjs/protocol": patch 10 | "@serenityjs/raknet": patch 11 | --- 12 | 13 | init v0.8.3-beta 14 | -------------------------------------------------------------------------------- /.changeset/strange-ears-stare.md: -------------------------------------------------------------------------------- 1 | --- 2 | "@serenityjs/core": patch 3 | --- 4 | 5 | Fix the time set/add command to only allow positive integers (or 0) 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*.{js,json,yml}] 8 | charset = utf-8 9 | indent_style = space 10 | indent_size = 2 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/common/install/action.yml: -------------------------------------------------------------------------------- 1 | name: Install 2 | description: Install dependencies 3 | 4 | runs: 5 | using: 'composite' 6 | steps: 7 | - name: Setup Node 8 | uses: actions/setup-node@v4 9 | with: 10 | registry-url: 'https://registry.npmjs.org/' 11 | node-version-file: '.nvmrc' 12 | cache: 'yarn' 13 | 14 | - name: Install dependencies 15 | shell: bash 16 | run: yarn install --immutable 17 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | on: 3 | push: 4 | pull_request: 5 | 6 | jobs: 7 | lint: 8 | name: Lint 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | 13 | - name: Install 14 | uses: ./.github/common/install 15 | 16 | - name: Lint 17 | run: yarn lint 18 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | yarn commitlint --edit \ -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | # TODO: Add pre-commit hook to run tests before commit 2 | 3 | yarn run build 4 | yarn run lint 5 | yarn run test 6 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | save-exact=true 2 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 22.x 2 | -------------------------------------------------------------------------------- /.renovaterc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "local>NordcomInc/renovate-config", 5 | ":semanticCommits", 6 | ":automergeMajor" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "bierner.comment-tagged-templates", 5 | "mikestead.dotenv", 6 | "naumovs.color-highlight", 7 | "exodiusstudios.comment-anchors", 8 | "christian-kohler.npm-intellisense", 9 | "christian-kohler.path-intellisense", 10 | "christian-kohler.path-intellisense", 11 | "nobuwu.mc-color" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-4.5.3.cjs 4 | -------------------------------------------------------------------------------- /bundle/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityJS/serenity/5dc4f01be25977cc973a344ff62d1d754283e50e/bundle/README.md -------------------------------------------------------------------------------- /bundle/modules/binarystream.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/binarystream"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/binarystream", () => { 7 | return { 8 | exports: module, 9 | loader: "object" 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/core.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/core"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/core", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/data.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/data"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/data", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/emitter.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/emitter"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/emitter", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/index.ts: -------------------------------------------------------------------------------- 1 | import Binarystream from "./binarystream"; 2 | import Core from "./core"; 3 | import Data from "./data"; 4 | import Emitter from "./emitter"; 5 | import LevelDB from "./leveldb"; 6 | import Logger from "./logger"; 7 | import NBT from "./nbt"; 8 | import Plugins from "./plugins"; 9 | import Protocol from "./protocol"; 10 | import Raknet from "./raknet"; 11 | 12 | const Modules = [ 13 | Binarystream, 14 | Core, 15 | Data, 16 | Emitter, 17 | LevelDB, 18 | Logger, 19 | NBT, 20 | Plugins, 21 | Protocol, 22 | Raknet 23 | ]; 24 | 25 | export { Modules }; 26 | -------------------------------------------------------------------------------- /bundle/modules/leveldb.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/leveldb"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/leveldb", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/logger.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/logger"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/logger", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/nbt.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/nbt"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/nbt", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/plugins.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/plugins"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/plugins", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/protocol.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/protocol"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/protocol", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /bundle/modules/raknet.ts: -------------------------------------------------------------------------------- 1 | import * as module from "@serenityjs/raknet"; 2 | 3 | import type { PluginBuilder } from "bun"; 4 | 5 | function inject(builder: PluginBuilder) { 6 | builder.module("@serenityjs/raknet", () => { 7 | return { 8 | exports: module, 9 | loader: "object", 10 | }; 11 | }); 12 | } 13 | 14 | export default inject; 15 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["@commitlint/config-angular"], 3 | rules: { 4 | "scope-case": [2, "always", "lower-case"], 5 | "type-enum": [ 6 | 2, 7 | "always", 8 | ["feat", "fix", "docs", "refactor", "test", "chore", "misc"] 9 | ] 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /devapp/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /devapp/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Serenity, LevelDBProvider } from "@serenityjs/core"; 2 | import { Pipeline } from "@serenityjs/plugins"; 3 | 4 | // Create a new Serenity instance 5 | const serenity = new Serenity({ 6 | path: "./properties.json", 7 | serenity: { 8 | permissions: "./permissions.json", 9 | resources: "./resource_packs", 10 | debugLogging: true 11 | } 12 | }); 13 | 14 | // Create a new plugin pipeline 15 | new Pipeline(serenity, { path: "./plugins" }); 16 | 17 | // Register the LevelDBProvider 18 | serenity.registerProvider(LevelDBProvider, { path: "./worlds" }); 19 | 20 | // Start the server 21 | serenity.start(); 22 | -------------------------------------------------------------------------------- /devapp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist" 6 | ] 7 | } -------------------------------------------------------------------------------- /devapp/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options 7 | })); 8 | -------------------------------------------------------------------------------- /packages/core/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /packages/core/src/block/identity/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./component"; 2 | export * from "./light-emission"; 3 | export * from "./material-instances"; 4 | export * from "./geometry"; 5 | export * from "./interactable"; 6 | export * from "./destructible-by-mining"; 7 | export * from "./friction"; 8 | export * from "./collision-box"; 9 | export * from "./selection-box"; 10 | export * from "./transformation"; 11 | export * from "./crafting-table"; 12 | export * from "./display-name"; 13 | -------------------------------------------------------------------------------- /packages/core/src/block/identity/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./type"; 2 | export * from "./permutation"; 3 | export * from "./drops"; 4 | export * from "./custom"; 5 | export * from "./components"; 6 | -------------------------------------------------------------------------------- /packages/core/src/block/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./identity"; 2 | export * from "./traits"; 3 | export * from "./palette"; 4 | export * from "./block"; 5 | export * from "./container"; 6 | 7 | import * as Traits from "./traits"; 8 | 9 | /** 10 | * A list of all block traits 11 | */ 12 | const BlockTraits = Array(); 13 | 14 | // Iterate over each trait 15 | for (const key in Traits) { 16 | // Get the block trait 17 | const trait = Traits[key as keyof typeof Traits]; 18 | 19 | // Push the block trait to the list 20 | BlockTraits.push(trait); 21 | } 22 | 23 | export { BlockTraits }; 24 | -------------------------------------------------------------------------------- /packages/core/src/block/maps/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./nbt-map"; 2 | -------------------------------------------------------------------------------- /packages/core/src/block/traits/direction.ts: -------------------------------------------------------------------------------- 1 | import { CardinalDirection } from "../../enums"; 2 | 3 | import { BlockTrait } from "./trait"; 4 | 5 | class BlockDirectionTrait extends BlockTrait { 6 | public static readonly identifier = "direction"; 7 | 8 | /** 9 | * Gets the current direction that the block is facing. 10 | * @returns The direction relative to the block. 11 | */ 12 | public getDirection(): number { 13 | return CardinalDirection.North; // Default to north 14 | } 15 | 16 | /** 17 | * Sets the direction of the block. 18 | * @param direction The direction to set. 19 | */ 20 | public setDirection(direction: number): void { 21 | return void direction; 22 | } 23 | } 24 | 25 | export { BlockDirectionTrait }; 26 | -------------------------------------------------------------------------------- /packages/core/src/block/traits/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./trait"; 2 | export * from "./inventory"; 3 | export * from "./weirdo-direction"; 4 | export * from "./upside-down-bit"; 5 | export * from "./open-bit"; 6 | export * from "./upper-block-bit"; 7 | export * from "./vertical-half"; 8 | export * from "./cardinal-direction"; 9 | export * from "./direction"; 10 | export * from "./facing-direction"; 11 | export * from "./pillar-axis"; 12 | export * from "./torch-direction"; 13 | export * from "./command-block"; 14 | export * from "./button"; 15 | export * from "./crafting-table"; 16 | -------------------------------------------------------------------------------- /packages/core/src/commands/common/about.ts: -------------------------------------------------------------------------------- 1 | import { MINECRAFT_VERSION, PROTOCOL_VERSION } from "@serenityjs/protocol"; 2 | 3 | import type { World } from "../../world"; 4 | 5 | const register = (world: World) => { 6 | world.commandPalette.register( 7 | "about", 8 | "Get information about the server", 9 | () => { 10 | // Get the runtime of the server 11 | const runtime = process.versions.bun === undefined ? "node.js" : "bun.sh"; 12 | 13 | return { 14 | message: `§7This server is running §uSerenityJS§7 for Minecraft Bedrock Edition. §8(v${MINECRAFT_VERSION}, proto-v${PROTOCOL_VERSION}, ${runtime})§r` 15 | }; 16 | } 17 | ); 18 | }; 19 | 20 | export default register; 21 | -------------------------------------------------------------------------------- /packages/core/src/commands/common/index.ts: -------------------------------------------------------------------------------- 1 | import About from "./about"; 2 | 3 | const CommonCommands = [About]; 4 | 5 | export { CommonCommands }; 6 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/ability.ts: -------------------------------------------------------------------------------- 1 | import { AbilityIndex } from "@serenityjs/protocol"; 2 | 3 | import { CustomEnum } from "."; 4 | 5 | const identifiers = Object.values(AbilityIndex).filter( 6 | (id) => typeof id === "string" 7 | ) as Array; 8 | 9 | class AbilityEnum extends CustomEnum { 10 | public static readonly name = "ability"; 11 | public static readonly options = identifiers; 12 | } 13 | 14 | export { AbilityEnum }; 15 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/block.ts: -------------------------------------------------------------------------------- 1 | import { BlockType } from "../../../block"; 2 | 3 | import { CustomEnum } from "."; 4 | 5 | const identifiers = BlockType.getAll().map((block) => 6 | block.identifier.startsWith("minecraft:") 7 | ? block.identifier.slice(10) 8 | : block.identifier 9 | ); 10 | 11 | class BlockEnum extends CustomEnum { 12 | public static readonly identifier = "blocks"; 13 | public static readonly options = identifiers; 14 | } 15 | 16 | export { BlockEnum }; 17 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/entity-trait.ts: -------------------------------------------------------------------------------- 1 | import { CustomEnum } from "./custom"; 2 | 3 | class EntityTraitEnum extends CustomEnum { 4 | public static readonly identifier = "entity-trait"; 5 | public static readonly options: Array = []; 6 | } 7 | 8 | export { EntityTraitEnum }; 9 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/entity.ts: -------------------------------------------------------------------------------- 1 | import { EntityType } from "../../../entity"; 2 | 3 | import { CustomEnum } from "."; 4 | 5 | const identifiers = EntityType.getAll() 6 | .map((entity) => 7 | entity.identifier.startsWith("minecraft:") 8 | ? entity.identifier.slice(10) 9 | : entity.identifier 10 | ) 11 | .filter((identifier) => identifier != "player"); 12 | 13 | class EntityEnum extends CustomEnum { 14 | public static readonly identifier = "entities"; 15 | public static readonly options = identifiers; 16 | } 17 | 18 | export { EntityEnum }; 19 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/gamemode.ts: -------------------------------------------------------------------------------- 1 | import { CustomEnum } from "./custom"; 2 | 3 | class GamemodeEnum extends CustomEnum { 4 | public static readonly identifier = "gamemode"; 5 | public static readonly options = [ 6 | "s", 7 | "c", 8 | "a", 9 | "sp", 10 | "survival", 11 | "creative", 12 | "adventure", 13 | "spectator" 14 | ]; 15 | } 16 | 17 | export { GamemodeEnum }; 18 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./soft"; 2 | export * from "./custom"; 3 | export * from "./boolean"; 4 | export * from "./gamemode"; 5 | export * from "./ability"; 6 | export * from "./block"; 7 | export * from "./entity"; 8 | export * from "./item"; 9 | export * from "./tag"; 10 | export * from "./world"; 11 | export * from "./time-operation"; 12 | export * from "./trait-action"; 13 | export * from "./entity-trait"; 14 | export * from "./enchantments"; 15 | export * from "./permissions"; 16 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/item.ts: -------------------------------------------------------------------------------- 1 | import { ItemType } from "../../../item"; 2 | 3 | import { CustomEnum } from "."; 4 | 5 | const identifiers = ItemType.getAll().map((item) => 6 | item.identifier.startsWith("minecraft:") 7 | ? item.identifier.slice(10) 8 | : item.identifier 9 | ); 10 | 11 | class ItemEnum extends CustomEnum { 12 | public static readonly identifier = "items"; 13 | public static readonly options = identifiers; 14 | } 15 | 16 | export { ItemEnum }; 17 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/permissions.ts: -------------------------------------------------------------------------------- 1 | import { CustomEnum } from "."; 2 | 3 | class PermissionsEnum extends CustomEnum { 4 | public static readonly identifier = "permission_operation"; 5 | public static readonly options = ["add", "remove", "list"]; 6 | } 7 | 8 | export { PermissionsEnum }; 9 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/soft.ts: -------------------------------------------------------------------------------- 1 | import { Enum } from "../enum"; 2 | 3 | class SoftEnum extends Enum { 4 | /** 5 | * The type of the enum. 6 | */ 7 | public static readonly type = 0x4_10; 8 | } 9 | 10 | export { SoftEnum }; 11 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/tag.ts: -------------------------------------------------------------------------------- 1 | import { CustomEnum } from "."; 2 | 3 | class TagEnum extends CustomEnum { 4 | public static readonly identifier = "tag_operation"; 5 | public static readonly options = ["add", "remove", "list"]; 6 | } 7 | 8 | export { TagEnum }; 9 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/time-operation.ts: -------------------------------------------------------------------------------- 1 | import { CustomEnum } from "."; 2 | 3 | class TimeOpertation extends CustomEnum { 4 | public static readonly identifier = "time_operation"; 5 | public static readonly options = ["set", "add", "query"]; 6 | } 7 | 8 | export { TimeOpertation }; 9 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/trait-action.ts: -------------------------------------------------------------------------------- 1 | import { CustomEnum } from "./custom"; 2 | 3 | class TraitActionEnum extends CustomEnum { 4 | public static readonly identifier = "trait-action"; 5 | public static readonly options = ["add", "remove", "list"]; 6 | } 7 | 8 | export { TraitActionEnum }; 9 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/custom/world.ts: -------------------------------------------------------------------------------- 1 | import { CustomEnum } from "."; 2 | 3 | class WorldEnum extends CustomEnum { 4 | public static readonly identifier = "worlds"; 5 | public static readonly options: Array = []; 6 | } 7 | 8 | export { WorldEnum }; 9 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./enum"; 2 | export * from "./valid"; 3 | export * from "./custom"; 4 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/valid/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./valid"; 2 | export * from "./string"; 3 | export * from "./integer"; 4 | export * from "./target"; 5 | export * from "./position"; 6 | export * from "./json"; 7 | -------------------------------------------------------------------------------- /packages/core/src/commands/enums/valid/valid.ts: -------------------------------------------------------------------------------- 1 | import { Enum } from "../enum"; 2 | 3 | class ValidEnum extends Enum { 4 | /** 5 | * The type of the enum. 6 | */ 7 | public static readonly type = 0x10; 8 | } 9 | 10 | export { ValidEnum }; 11 | -------------------------------------------------------------------------------- /packages/core/src/commands/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./enums"; 2 | export * from "./command"; 3 | export * from "./palette"; 4 | export * from "./execution-state"; 5 | export * from "./registry"; 6 | export * from "./operator"; 7 | export * from "./common"; 8 | export * from "./console"; 9 | -------------------------------------------------------------------------------- /packages/core/src/commands/operator/save.ts: -------------------------------------------------------------------------------- 1 | import type { World } from "../../world"; 2 | 3 | const register = (world: World) => { 4 | // Register the stop command 5 | world.commandPalette.register( 6 | "save", 7 | "Save the current world's data to disk", 8 | (registry) => { 9 | // Set the permissions of the command 10 | registry.permissions = ["serenity.internal"]; 11 | }, 12 | () => { 13 | // Save the world 14 | world.provider.onSave(); 15 | 16 | // Return a message 17 | return { 18 | message: "World has been saved, check console for additional details." 19 | }; 20 | } 21 | ); 22 | }; 23 | 24 | export default register; 25 | -------------------------------------------------------------------------------- /packages/core/src/commands/operator/stop.ts: -------------------------------------------------------------------------------- 1 | import type { World } from "../../world"; 2 | 3 | const register = (world: World) => { 4 | // Register the stop command 5 | world.commandPalette.register( 6 | "stop", 7 | "Stops the server", 8 | (registry) => { 9 | // Set the permissions of the command 10 | registry.permissions = ["serenity.internal"]; 11 | }, 12 | () => { 13 | // stop the server 14 | world.serenity.stop(); 15 | } 16 | ); 17 | }; 18 | 19 | export default register; 20 | -------------------------------------------------------------------------------- /packages/core/src/constants/block.ts: -------------------------------------------------------------------------------- 1 | import { BlockIdentifier } from "../enums"; 2 | import { BlockEntry } from "../types"; 3 | 4 | /** 5 | * The default block entry. 6 | */ 7 | const DefaultBlockEntry: BlockEntry = { 8 | identifier: BlockIdentifier.Air, 9 | permutation: 0, 10 | position: [0, 0, 0], 11 | traits: [], 12 | dynamicProperties: [], 13 | nbtProperties: "" 14 | }; 15 | 16 | export { DefaultBlockEntry }; 17 | -------------------------------------------------------------------------------- /packages/core/src/constants/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./block"; 2 | export * from "./player"; 3 | export * from "./world"; 4 | -------------------------------------------------------------------------------- /packages/core/src/constants/player.ts: -------------------------------------------------------------------------------- 1 | import { SerializedSkin } from "@serenityjs/protocol"; 2 | 3 | import { ClientSystemInfo } from "../entity/system-info"; 4 | import { PlayerProperties } from "../types"; 5 | 6 | const DefaultPlayerProperties: PlayerProperties = { 7 | username: "SerenityJS", 8 | xuid: "0000000000000000", 9 | uuid: "00000000-0000-0000-0000-000000000000", 10 | uniqueId: -1n, 11 | clientSystemInfo: ClientSystemInfo.empty(), 12 | skin: SerializedSkin.empty() 13 | }; 14 | 15 | export { DefaultPlayerProperties }; 16 | -------------------------------------------------------------------------------- /packages/core/src/effect/effects/blindness.ts: -------------------------------------------------------------------------------- 1 | import { Color, EffectType } from "@serenityjs/protocol"; 2 | 3 | import { Effect } from "./effect"; 4 | 5 | class BlindnessEffect extends Effect { 6 | public static readonly type: EffectType = EffectType.Blindness; 7 | public readonly color: Color = new Color(255, 31, 31, 35); 8 | } 9 | 10 | export { BlindnessEffect }; 11 | -------------------------------------------------------------------------------- /packages/core/src/effect/effects/darkness.ts: -------------------------------------------------------------------------------- 1 | import { Color, EffectType } from "@serenityjs/protocol"; 2 | 3 | import { Effect } from "./effect"; 4 | 5 | class DarknessEffect extends Effect { 6 | public static readonly type: EffectType = EffectType.Darkness; 7 | public readonly color: Color = new Color(255, 41, 39, 33); 8 | } 9 | 10 | export { DarknessEffect }; 11 | -------------------------------------------------------------------------------- /packages/core/src/effect/effects/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./effect"; 2 | export * from "./regeneration"; 3 | export * from "./poison"; 4 | export * from "./night-vision"; 5 | export * from "./instant-damage"; 6 | export * from "./instant-health"; 7 | export * from "./blindness"; 8 | export * from "./darkness"; 9 | export * from "./nauseas"; 10 | export * from "./speed"; 11 | export * from "./wither"; 12 | export * from "./fatal-poison"; 13 | export * from "./slowness"; 14 | export * from "./invisibility"; 15 | export * from "./water-breathing"; 16 | -------------------------------------------------------------------------------- /packages/core/src/effect/effects/invisibility.ts: -------------------------------------------------------------------------------- 1 | import { Color, EffectType } from "@serenityjs/protocol"; 2 | 3 | import { Entity, EntityInvisibilityTrait } from "../../entity"; 4 | 5 | import { Effect } from "./effect"; 6 | 7 | class InvisibilityEffect extends Effect { 8 | public static readonly type: EffectType = EffectType.Invisibility; 9 | 10 | public readonly color: Color = new Color(255, 127, 131, 146); 11 | 12 | public onAdd(entity: Entity): void { 13 | // Make the entity invisible. 14 | entity.getTrait(EntityInvisibilityTrait)?.setInvisibility(true); 15 | } 16 | 17 | public onRemove(entity: Entity): void { 18 | // Make the entity visible again. 19 | entity.getTrait(EntityInvisibilityTrait)?.setInvisibility(false); 20 | } 21 | } 22 | 23 | export { InvisibilityEffect }; 24 | -------------------------------------------------------------------------------- /packages/core/src/effect/effects/nauseas.ts: -------------------------------------------------------------------------------- 1 | import { Color, EffectType } from "@serenityjs/protocol"; 2 | 3 | import { Effect } from "./effect"; 4 | 5 | class NauseasEffect extends Effect { 6 | public static readonly type: EffectType = EffectType.Nausea; 7 | public readonly color: Color = new Color(255, 85, 29, 74); 8 | } 9 | 10 | export { NauseasEffect }; 11 | -------------------------------------------------------------------------------- /packages/core/src/effect/effects/night-vision.ts: -------------------------------------------------------------------------------- 1 | import { Color, EffectType } from "@serenityjs/protocol"; 2 | 3 | import { Effect } from "./effect"; 4 | 5 | class NightVisionEffect extends Effect { 6 | public static readonly type: EffectType = EffectType.NightVision; 7 | public color: Color = new Color(255, 31, 31, 161); 8 | } 9 | 10 | export { NightVisionEffect }; 11 | -------------------------------------------------------------------------------- /packages/core/src/effect/effects/water-breathing.ts: -------------------------------------------------------------------------------- 1 | import { Color, EffectType } from "@serenityjs/protocol"; 2 | 3 | import { Effect } from "./effect"; 4 | 5 | class WaterBreathingEffect extends Effect { 6 | public static readonly type: EffectType = EffectType.WaterBreathing; 7 | 8 | public readonly color: Color = new Color(255, 152, 218, 192); 9 | } 10 | 11 | export { WaterBreathingEffect }; 12 | -------------------------------------------------------------------------------- /packages/core/src/effect/index.ts: -------------------------------------------------------------------------------- 1 | import * as Effects from "./effects"; 2 | 3 | import type { Effect } from "./effects"; 4 | export * from "./pallete"; 5 | export * from "./effects"; 6 | 7 | const EntityEffects: Array = []; 8 | 9 | // Iterate over each effect 10 | for (const key in Effects) { 11 | // Get the block effect 12 | const effect = Effects[key as keyof typeof Effects]; 13 | 14 | // Push the block effect to the list 15 | EntityEffects.push(effect); 16 | } 17 | 18 | export { EntityEffects }; 19 | -------------------------------------------------------------------------------- /packages/core/src/entity/identity/custom.ts: -------------------------------------------------------------------------------- 1 | import { EntityIdentifier } from "../../enums"; 2 | 3 | import { EntityType } from "./type"; 4 | 5 | class CustomEntityType extends EntityType { 6 | /** 7 | * Create a new custom entity type. 8 | * @param identifier The identifier of the custom entity type. 9 | * @param components The default components of the custom entity type. 10 | */ 11 | public constructor(identifier: string) { 12 | super(identifier as EntityIdentifier); 13 | } 14 | } 15 | 16 | export { CustomEntityType }; 17 | -------------------------------------------------------------------------------- /packages/core/src/entity/identity/index.ts: -------------------------------------------------------------------------------- 1 | // Registers the entity types from the dumped bedrock data. 2 | import "./registry"; 3 | 4 | export * from "./type"; 5 | export * from "./custom"; 6 | export * from "./properties"; 7 | -------------------------------------------------------------------------------- /packages/core/src/entity/identity/properties/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./property"; 2 | export * from "./int"; 3 | export * from "./float"; 4 | export * from "./boolean"; 5 | export * from "./enum"; 6 | -------------------------------------------------------------------------------- /packages/core/src/entity/identity/registry.ts: -------------------------------------------------------------------------------- 1 | import { ENTITY_TYPES } from "@serenityjs/data"; 2 | 3 | import { EntityType } from "./type"; 4 | 5 | import type { EntityIdentifier } from "../../enums"; 6 | 7 | // Iterate over the entity types and register them. 8 | for (const type of ENTITY_TYPES) { 9 | // Create a new entity type. 10 | const entityType = new EntityType( 11 | type.identifier as EntityIdentifier, 12 | type.components 13 | ); 14 | 15 | // Register the entity type. 16 | EntityType.types.set(type.identifier, entityType); 17 | } 18 | -------------------------------------------------------------------------------- /packages/core/src/entity/input-info.ts: -------------------------------------------------------------------------------- 1 | import { Vector2f } from "@serenityjs/protocol"; 2 | 3 | class EntityInputInfo { 4 | /** 5 | * The movement vector of the entity input device. 6 | */ 7 | public readonly movementVector: Vector2f = new Vector2f(0, 0); 8 | 9 | /** 10 | * The current tick of the entity input device. 11 | */ 12 | public tick: bigint = 0n; 13 | } 14 | 15 | export { EntityInputInfo }; 16 | -------------------------------------------------------------------------------- /packages/core/src/entity/maps/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./metadata-map"; 2 | export * from "./actor-flag-map"; 3 | export * from "./attribute-map"; 4 | export * from "./ability-map"; 5 | export * from "./shared-properties"; 6 | -------------------------------------------------------------------------------- /packages/core/src/entity/traits/attribute/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./attribute"; 2 | export * from "./movement"; 3 | export * from "./health"; 4 | -------------------------------------------------------------------------------- /packages/core/src/entity/traits/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./trait"; 2 | export * from "./attribute"; 3 | export * from "./player"; 4 | export * from "./gravity"; 5 | export * from "./collision"; 6 | export * from "./air-supply"; 7 | export * from "./inventory"; 8 | export * from "./item-stack"; 9 | export * from "./physics"; 10 | export * from "./effects"; 11 | export * from "./visibility"; 12 | export * from "./equipment"; 13 | export * from "./npc"; 14 | export * from "./look-at-player"; 15 | export * from "./rideable"; 16 | -------------------------------------------------------------------------------- /packages/core/src/entity/traits/player/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./trait"; 2 | export * from "./chunk-rendering"; 3 | export * from "./entity-rendering"; 4 | export * from "./player-list"; 5 | export * from "./cursor"; 6 | export * from "./hunger"; 7 | export * from "./crafting-input"; 8 | export * from "./combat"; 9 | export * from "./command-executor"; 10 | -------------------------------------------------------------------------------- /packages/core/src/entity/traits/rideable/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./rideable"; 2 | export * from "./riding"; 3 | export * from "./seat"; 4 | -------------------------------------------------------------------------------- /packages/core/src/enums/block-tool-type.ts: -------------------------------------------------------------------------------- 1 | enum BlockToolType { 2 | None, 3 | Sword, 4 | Shovel, 5 | Pickaxe, 6 | Axe, 7 | Hoe, 8 | Shears 9 | } 10 | 11 | export { BlockToolType }; 12 | -------------------------------------------------------------------------------- /packages/core/src/enums/cardinal-direction.ts: -------------------------------------------------------------------------------- 1 | enum CardinalDirection { 2 | North = 3, 3 | East = 0, 4 | South = 2, 5 | West = 1 6 | } 7 | 8 | export { CardinalDirection }; 9 | -------------------------------------------------------------------------------- /packages/core/src/enums/entity-interact-method.ts: -------------------------------------------------------------------------------- 1 | import { ItemUseOnEntityInventoryTransactionType } from "@serenityjs/protocol"; 2 | 3 | enum EntityInteractMethod { 4 | Interact = ItemUseOnEntityInventoryTransactionType.Interact, 5 | Attack = ItemUseOnEntityInventoryTransactionType.Attack 6 | } 7 | 8 | export { EntityInteractMethod }; 9 | -------------------------------------------------------------------------------- /packages/core/src/enums/facing-direction.ts: -------------------------------------------------------------------------------- 1 | enum FacingDirection { 2 | Down = 0, 3 | Up = 1, 4 | North = 2, 5 | South = 3, 6 | West = 4, 7 | East = 5 8 | } 9 | 10 | export { FacingDirection }; 11 | -------------------------------------------------------------------------------- /packages/core/src/enums/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./network-bound"; 2 | export * from "./block-identifier"; 3 | export * from "./entity-identifier"; 4 | export * from "./item-identifier"; 5 | export * from "./item-category"; 6 | export * from "./item-group"; 7 | export * from "./tool-tier"; 8 | export * from "./tool-type"; 9 | export * from "./block-tool-type"; 10 | export * from "./entity-interact-method"; 11 | export * from "./cardinal-direction"; 12 | export * from "./world-event"; 13 | export * from "./server-event"; 14 | export * from "./time-of-day"; 15 | export * from "./torch-direction"; 16 | export * from "./item-wearable-tier"; 17 | export * from "./server-state"; 18 | export * from "./facing-direction"; 19 | export * from "./item-lock-mode"; 20 | -------------------------------------------------------------------------------- /packages/core/src/enums/item-category.ts: -------------------------------------------------------------------------------- 1 | enum ItemCategory { 2 | Construction = "construction", 3 | Equipment = "equipment", 4 | Items = "items", 5 | Nature = "nature", 6 | None = "none" 7 | } 8 | 9 | export { ItemCategory }; 10 | -------------------------------------------------------------------------------- /packages/core/src/enums/item-lock-mode.ts: -------------------------------------------------------------------------------- 1 | enum ItemLockMode { 2 | None = 0, 3 | LockToSlot = 1, 4 | LockToInventory = 2 5 | } 6 | 7 | export { ItemLockMode }; 8 | -------------------------------------------------------------------------------- /packages/core/src/enums/item-wearable-tier.ts: -------------------------------------------------------------------------------- 1 | enum ItemWearableTier { 2 | Generic, 3 | Leather, 4 | Chainmail, 5 | Iron, 6 | Gold, 7 | Diamond, 8 | Netherite 9 | } 10 | 11 | export { ItemWearableTier }; 12 | -------------------------------------------------------------------------------- /packages/core/src/enums/network-bound.ts: -------------------------------------------------------------------------------- 1 | enum NetworkBound { 2 | Server = 0, 3 | Client = 1 4 | } 5 | 6 | export { NetworkBound }; 7 | -------------------------------------------------------------------------------- /packages/core/src/enums/server-event.ts: -------------------------------------------------------------------------------- 1 | enum ServerEvent { 2 | Start = 1000, 3 | Stop 4 | } 5 | 6 | export { ServerEvent }; 7 | -------------------------------------------------------------------------------- /packages/core/src/enums/server-state.ts: -------------------------------------------------------------------------------- 1 | enum ServerState { 2 | StartingUp, 3 | Running, 4 | ShuttingDown, 5 | Stopped 6 | } 7 | 8 | export { ServerState }; 9 | -------------------------------------------------------------------------------- /packages/core/src/enums/time-of-day.ts: -------------------------------------------------------------------------------- 1 | enum TimeOfDay { 2 | Day = 1000, 3 | Noon = 6000, 4 | Sunset = 12000, 5 | Night = 13000, 6 | Midnight = 18000, 7 | Sunrise = 23000 8 | } 9 | 10 | export { TimeOfDay }; 11 | -------------------------------------------------------------------------------- /packages/core/src/enums/tool-tier.ts: -------------------------------------------------------------------------------- 1 | enum ItemTypeToolTier { 2 | None, 3 | Wooden, 4 | Stone, 5 | Iron, 6 | Golden, 7 | Diamond, 8 | Netherite 9 | } 10 | 11 | export { ItemTypeToolTier }; 12 | -------------------------------------------------------------------------------- /packages/core/src/enums/tool-type.ts: -------------------------------------------------------------------------------- 1 | enum ItemToolType { 2 | None, 3 | Axe, 4 | Hoe, 5 | Shovel, 6 | Sword, 7 | Pickaxe 8 | } 9 | 10 | export { ItemToolType }; 11 | -------------------------------------------------------------------------------- /packages/core/src/enums/torch-direction.ts: -------------------------------------------------------------------------------- 1 | enum TorchDirection { 2 | West = "west", 3 | East = "east", 4 | North = "north", 5 | South = "south", 6 | Top = "top" 7 | } 8 | 9 | export { TorchDirection }; 10 | -------------------------------------------------------------------------------- /packages/core/src/events/effect-add.ts: -------------------------------------------------------------------------------- 1 | import { Effect } from "../effect"; 2 | import { Entity } from "../entity"; 3 | import { WorldEvent } from "../enums"; 4 | 5 | import { EventSignal } from "./event-signal"; 6 | 7 | class EffectAddSignal extends EventSignal { 8 | public static readonly identifier: WorldEvent = WorldEvent.EffectAdd; 9 | 10 | /** 11 | * The entity where the effect was added 12 | */ 13 | public readonly entity: Entity; 14 | 15 | /** 16 | * The effect that was added. 17 | */ 18 | public readonly effect: Effect; 19 | 20 | public constructor(entity: Entity, effect: Effect) { 21 | super(entity.world); 22 | this.entity = entity; 23 | this.effect = effect; 24 | } 25 | } 26 | 27 | export { EffectAddSignal }; 28 | -------------------------------------------------------------------------------- /packages/core/src/events/effect-remove.ts: -------------------------------------------------------------------------------- 1 | import { EffectType } from "@serenityjs/protocol"; 2 | 3 | import { Entity } from "../entity"; 4 | import { WorldEvent } from "../enums"; 5 | 6 | import { EventSignal } from "./event-signal"; 7 | 8 | class EffectRemoveSignal extends EventSignal { 9 | public static readonly identifier: WorldEvent = WorldEvent.EffectRemove; 10 | 11 | /** 12 | * The entity where the effect was removed 13 | */ 14 | public readonly entity: Entity; 15 | 16 | /** 17 | * The effect that was removed 18 | */ 19 | public readonly effect: EffectType; 20 | 21 | public constructor(entity: Entity, effect: EffectType) { 22 | super(entity.world); 23 | this.entity = entity; 24 | this.effect = effect; 25 | } 26 | } 27 | 28 | export { EffectRemoveSignal }; 29 | -------------------------------------------------------------------------------- /packages/core/src/events/entity-hit.ts: -------------------------------------------------------------------------------- 1 | import { Entity } from "../entity"; 2 | import { WorldEvent } from "../enums"; 3 | 4 | import { EventSignal } from "./event-signal"; 5 | 6 | class EntityHitSignal extends EventSignal { 7 | public static readonly identifier: WorldEvent = WorldEvent.EntityHit; 8 | 9 | /** 10 | * The entity that was hit. 11 | */ 12 | public readonly hitEntity: Entity; 13 | 14 | /** 15 | * The entity that hitted the other entity. 16 | */ 17 | public readonly damagingEntity: Entity; 18 | 19 | public constructor(damagingEntity: Entity, hitEntity: Entity) { 20 | super(damagingEntity.world); 21 | this.damagingEntity = damagingEntity; 22 | this.hitEntity = hitEntity; 23 | } 24 | } 25 | 26 | export { EntityHitSignal }; 27 | -------------------------------------------------------------------------------- /packages/core/src/events/player-join.ts: -------------------------------------------------------------------------------- 1 | import { Player } from "../entity"; 2 | import { WorldEvent } from "../enums"; 3 | 4 | import { EventSignal } from "./event-signal"; 5 | 6 | class PlayerJoinSignal extends EventSignal { 7 | public static readonly identifier = WorldEvent.PlayerJoin; 8 | 9 | /** 10 | * The player joining the world. 11 | */ 12 | public readonly player: Player; 13 | 14 | /** 15 | * Creates a new player join event signal. 16 | * @param player The player joining the world.. 17 | */ 18 | public constructor(player: Player) { 19 | super(player.dimension.world); 20 | this.player = player; 21 | } 22 | } 23 | 24 | export { PlayerJoinSignal }; 25 | -------------------------------------------------------------------------------- /packages/core/src/events/world-initialize.ts: -------------------------------------------------------------------------------- 1 | import { WorldEvent } from "../enums"; 2 | 3 | import { EventSignal } from "./event-signal"; 4 | 5 | class WorldInitializeSignal extends EventSignal { 6 | public static readonly identifier = WorldEvent.WorldInitialize; 7 | } 8 | 9 | export { WorldInitializeSignal }; 10 | -------------------------------------------------------------------------------- /packages/core/src/handlers/actor-event.ts: -------------------------------------------------------------------------------- 1 | import { ActorEventPacket, Packet } from "@serenityjs/protocol"; 2 | import { Connection } from "@serenityjs/raknet"; 3 | 4 | import { NetworkHandler } from "../network"; 5 | 6 | class ActorEventHandler extends NetworkHandler { 7 | public static readonly packet = Packet.ActorEvent; 8 | 9 | public handle(packet: ActorEventPacket, connection: Connection): void { 10 | // Get the player from the connection 11 | const player = this.serenity.getPlayerByConnection(connection); 12 | if (!player) return connection.disconnect(); 13 | 14 | // Broadcast the packet to all players 15 | player.dimension.broadcast(packet); 16 | } 17 | } 18 | 19 | export { ActorEventHandler }; 20 | -------------------------------------------------------------------------------- /packages/core/src/handlers/animate.ts: -------------------------------------------------------------------------------- 1 | import { AnimatePacket, Packet } from "@serenityjs/protocol"; 2 | import { Connection } from "@serenityjs/raknet"; 3 | 4 | import { NetworkHandler } from "../network"; 5 | 6 | class AnimateHandler extends NetworkHandler { 7 | public static readonly packet = Packet.Animate; 8 | 9 | public handle(packet: AnimatePacket, connection: Connection): void { 10 | // Get the player from the connection 11 | const player = this.serenity.players.get(connection); 12 | if (!player) return connection.disconnect(); 13 | 14 | // Broadcast the animation to all players 15 | player.dimension.broadcastExcept(player, packet); 16 | } 17 | } 18 | 19 | export { AnimateHandler }; 20 | -------------------------------------------------------------------------------- /packages/core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./serenity"; 2 | export * from "./network"; 3 | export * from "./commands"; 4 | export * from "./item"; 5 | export * from "./entity"; 6 | export * from "./block"; 7 | export * from "./world"; 8 | export * from "./types"; 9 | export * from "./events"; 10 | export * from "./enums"; 11 | export * from "./handlers"; 12 | export * from "./container"; 13 | export * from "./trait"; 14 | export * from "./ui"; 15 | export * from "./loot"; 16 | export * from "./resources"; 17 | export * from "./pathfinding"; 18 | export * from "./permissions"; 19 | -------------------------------------------------------------------------------- /packages/core/src/item/creative/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./group"; 2 | export * from "./descriptor"; 3 | -------------------------------------------------------------------------------- /packages/core/src/item/identity/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./component"; 2 | export * from "./can-destroy-in-creative"; 3 | export * from "./display-name"; 4 | export * from "./block-placer"; 5 | export * from "./wearable"; 6 | export * from "./max-stack-size"; 7 | export * from "./icon"; 8 | export * from "./item-properties"; 9 | export * from "./cooldown"; 10 | export * from "./digger"; 11 | export * from "./hand_equipped"; 12 | -------------------------------------------------------------------------------- /packages/core/src/item/identity/components/item-properties.ts: -------------------------------------------------------------------------------- 1 | import { CompoundTag } from "@serenityjs/nbt"; 2 | 3 | import { ItemTypeComponent } from "./component"; 4 | 5 | class ItemTypeItemPropertiesComponent extends ItemTypeComponent { 6 | public static readonly identifier = "item_properties"; 7 | 8 | public get component(): CompoundTag { 9 | return this.collection.getTag>(this.identifier); 10 | } 11 | } 12 | 13 | export { ItemTypeItemPropertiesComponent }; 14 | -------------------------------------------------------------------------------- /packages/core/src/item/identity/custom.ts: -------------------------------------------------------------------------------- 1 | import { ItemIdentifier } from "../../enums"; 2 | import { ItemTypeOptions } from "../types"; 3 | 4 | import { ItemType } from "./type"; 5 | 6 | class CustomItemType extends ItemType { 7 | protected static networkId = 20000; // Start at 20000 to avoid conflicts with vanilla item types. 8 | 9 | /** 10 | * Create a new custom item type. 11 | * @param identifier The identifier of the item type. 12 | * @param options The options of the item type. 13 | */ 14 | public constructor(identifier: string, options?: Partial) { 15 | super(identifier as ItemIdentifier, ++CustomItemType.networkId, options); 16 | } 17 | } 18 | 19 | export { CustomItemType }; 20 | -------------------------------------------------------------------------------- /packages/core/src/item/identity/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./type"; 2 | export * from "./custom"; 3 | export * from "./collection"; 4 | export * from "./components"; 5 | -------------------------------------------------------------------------------- /packages/core/src/item/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./identity"; 2 | export * from "./creative"; 3 | export * from "./palette"; 4 | export * from "./traits"; 5 | export * from "./stack"; 6 | export * from "./types"; 7 | 8 | import * as Traits from "./traits"; 9 | 10 | /** 11 | * A list of all item stack traits 12 | */ 13 | const ItemTraits = Array(); 14 | 15 | // Iterate over each trait 16 | for (const key in Traits) { 17 | // Get the item trait 18 | const trait = Traits[key as keyof typeof Traits]; 19 | 20 | // Push the item trait to the list 21 | ItemTraits.push(trait); 22 | } 23 | 24 | export { ItemTraits }; 25 | -------------------------------------------------------------------------------- /packages/core/src/item/maps/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./nbt-map"; 2 | -------------------------------------------------------------------------------- /packages/core/src/item/traits/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./trait"; 2 | export * from "./bundle"; 3 | export * from "./enchantable"; 4 | export * from "./durability"; 5 | export * from "./display"; 6 | export * from "./keep-on-die"; 7 | export * from "./food"; 8 | export * from "./spawn-egg"; 9 | export * from "./liquid-container"; 10 | export * from "./weapon"; 11 | export * from "./sword"; 12 | export * from "./wearable"; 13 | export * from "./shooter"; 14 | export * from "./lock"; 15 | -------------------------------------------------------------------------------- /packages/core/src/item/traits/keep-on-die.ts: -------------------------------------------------------------------------------- 1 | import { ByteTag } from "@serenityjs/nbt"; 2 | 3 | import { ItemTrait } from "./trait"; 4 | 5 | class ItemKeepOnDieTrait extends ItemTrait { 6 | public static readonly identifier = "keep_on_die"; 7 | 8 | public get keep(): boolean { 9 | return this.item.nbt.has("minecraft:keep_on_death"); 10 | } 11 | 12 | public set keep(value: boolean) { 13 | if (value) { 14 | this.item.nbt.add( 15 | new ByteTag({ name: "minecraft:keep_on_death", value: 1 }) 16 | ); 17 | } else { 18 | this.item.nbt.delete("minecraft:keep_on_death"); 19 | } 20 | } 21 | 22 | public onRemove(): void { 23 | this.item.nbt.delete("minecraft:keep_on_death"); 24 | } 25 | } 26 | 27 | export { ItemKeepOnDieTrait }; 28 | -------------------------------------------------------------------------------- /packages/core/src/item/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./item-stack-options"; 2 | export * from "./item-stack-data-entry"; 3 | export * from "./item-type-options"; 4 | export * from "./item-stack-storage"; 5 | export * from "./item-stack-use-options"; 6 | -------------------------------------------------------------------------------- /packages/core/src/item/types/item-stack-storage.ts: -------------------------------------------------------------------------------- 1 | import type { JSONLikeObject } from "../../types"; 2 | import type { ItemStackDataEntry } from "./item-stack-data-entry"; 3 | 4 | /** 5 | * Used to store item stacks in a JSON-like format. 6 | * This is mainly used for the traits that need to store item stacks. 7 | */ 8 | interface ItemStackStorage extends JSONLikeObject { 9 | /** 10 | * The max amount of item slots in the storage. 11 | */ 12 | size: number; 13 | 14 | /** 15 | * The items stack data entries in the storage. 16 | */ 17 | items: Array<[number, ItemStackDataEntry]>; 18 | } 19 | 20 | export { ItemStackStorage }; 21 | -------------------------------------------------------------------------------- /packages/core/src/loot/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./pool"; 2 | export * from "./table"; 3 | -------------------------------------------------------------------------------- /packages/core/src/network/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./network"; 2 | export * from "./handler"; 3 | -------------------------------------------------------------------------------- /packages/core/src/pathfinding/evaluator.ts: -------------------------------------------------------------------------------- 1 | import { Block } from ".."; 2 | import { Entity } from "../entity"; 3 | 4 | import { Node } from "./node"; 5 | 6 | abstract class NodeEvaluator { 7 | public readonly entity: Entity; 8 | 9 | public constructor(entity: Entity) { 10 | this.entity = entity; 11 | } 12 | 13 | public abstract getNeighbors(node: Node): Generator; 14 | 15 | protected getBlock(node: Node): Block { 16 | return this.entity.dimension.getBlock(node); 17 | } 18 | } 19 | 20 | export { NodeEvaluator }; 21 | -------------------------------------------------------------------------------- /packages/core/src/pathfinding/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./node"; 2 | export * from "./evaluator"; 3 | export * from "./astar"; 4 | export * from "./heap"; 5 | -------------------------------------------------------------------------------- /packages/core/src/permissions/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./group"; 2 | export * from "./member"; 3 | -------------------------------------------------------------------------------- /packages/core/src/resources/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./resources"; 2 | export * from "./pack"; 3 | -------------------------------------------------------------------------------- /packages/core/src/types/block/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./states"; 2 | export * from "./blocks"; 3 | export * from "./state"; 4 | export * from "./block"; 5 | export * from "./options"; 6 | -------------------------------------------------------------------------------- /packages/core/src/types/commands/arguments.ts: -------------------------------------------------------------------------------- 1 | import type { Enum } from "../../commands"; 2 | 3 | type CommandArguments> = { 4 | [K in keyof T]: T[K] extends [typeof Enum, boolean] 5 | ? T[K][0]["prototype"] 6 | : T[K] extends typeof Enum 7 | ? T[K]["prototype"] 8 | : T[K] | Enum; 9 | }; 10 | 11 | export { type CommandArguments }; 12 | -------------------------------------------------------------------------------- /packages/core/src/types/commands/callback.ts: -------------------------------------------------------------------------------- 1 | import type { CommandContext } from "./context"; 2 | import type { CommandResponse } from "./response"; 3 | 4 | type CommandCallback> = ( 5 | context: CommandContext 6 | ) => CommandResponse | void | Promise; 7 | 8 | export { type CommandCallback }; 9 | -------------------------------------------------------------------------------- /packages/core/src/types/commands/context.ts: -------------------------------------------------------------------------------- 1 | import { Entity } from "../../entity"; 2 | import { Dimension } from "../../world"; 3 | 4 | type CommandContext> = { 5 | origin: Dimension | Entity; 6 | } & T; 7 | 8 | export { type CommandContext }; 9 | -------------------------------------------------------------------------------- /packages/core/src/types/commands/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./context"; 2 | export * from "./callback"; 3 | export * from "./registry"; 4 | export * from "./overload"; 5 | export * from "./arguments"; 6 | export * from "./response"; 7 | -------------------------------------------------------------------------------- /packages/core/src/types/commands/overload.ts: -------------------------------------------------------------------------------- 1 | import type { Enum } from "../../commands"; 2 | 3 | interface CommandOverload { 4 | [key: string]: typeof Enum | [typeof Enum, boolean]; 5 | } 6 | 7 | export { type CommandOverload }; 8 | -------------------------------------------------------------------------------- /packages/core/src/types/commands/registry.ts: -------------------------------------------------------------------------------- 1 | import type { CommandRegistry } from "../../commands"; 2 | 3 | type CommandRegistryCallback = (registry: CommandRegistry) => void; 4 | 5 | export { type CommandRegistryCallback }; 6 | -------------------------------------------------------------------------------- /packages/core/src/types/commands/response.ts: -------------------------------------------------------------------------------- 1 | type CommandResponse> = { message?: string } & T; 2 | 3 | export { CommandResponse }; 4 | -------------------------------------------------------------------------------- /packages/core/src/types/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./player"; 2 | export * from "./item-stack"; 3 | -------------------------------------------------------------------------------- /packages/core/src/types/components/item-stack.ts: -------------------------------------------------------------------------------- 1 | import { JSONLikeObject } from "../json"; 2 | 3 | interface ItemWeaponComponent extends JSONLikeObject { 4 | /** 5 | * The base damage of the weapon. 6 | */ 7 | baseDamage: number; 8 | 9 | /** 10 | * The critical damage of the weapon. 11 | */ 12 | criticalDamage: number; 13 | } 14 | 15 | export { ItemWeaponComponent }; 16 | -------------------------------------------------------------------------------- /packages/core/src/types/components/player.ts: -------------------------------------------------------------------------------- 1 | import { JSONLikeObject } from "../json"; 2 | 3 | interface PlayerCombatProperty extends JSONLikeObject { 4 | /** 5 | * The maximum reach of the player horizontally. 6 | */ 7 | horizontalMaxReach: number; 8 | 9 | /** 10 | * The maximum reach of the player vertically. 11 | */ 12 | verticalMaxReach: number; 13 | 14 | /** 15 | * The horizontal knockback of the player. 16 | */ 17 | horizontalKnockback: number; 18 | 19 | /** 20 | * The vertical knockback of the player. 21 | */ 22 | verticalKnockback: number; 23 | 24 | /** 25 | * The amount of ticks till the player can attack again. 26 | */ 27 | combatCooldown: number; 28 | } 29 | 30 | export { PlayerCombatProperty }; 31 | -------------------------------------------------------------------------------- /packages/core/src/types/entity/entity.ts: -------------------------------------------------------------------------------- 1 | import { EntityEntry } from "../world"; 2 | 3 | interface EntityProperties { 4 | uniqueId: bigint; 5 | entry?: EntityEntry; 6 | } 7 | 8 | export { EntityProperties }; 9 | -------------------------------------------------------------------------------- /packages/core/src/types/entity/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./entity"; 2 | export * from "./player"; 3 | export * from "./title-display-options"; 4 | export * from "./traits"; 5 | export * from "./options"; 6 | -------------------------------------------------------------------------------- /packages/core/src/types/entity/title-display-options.ts: -------------------------------------------------------------------------------- 1 | interface TitleDisplayOptions { 2 | /** 3 | * The time it takes for the title to fade in. 4 | */ 5 | fadeInDuration?: number; 6 | 7 | /** 8 | * The time the title should stay on the screen. 9 | */ 10 | stayDuration?: number; 11 | 12 | /** 13 | * The time it takes for the title to fade out. 14 | */ 15 | fadeOutDuration?: number; 16 | 17 | /** 18 | * The subtitle to display. 19 | */ 20 | subtitle?: string; 21 | } 22 | 23 | export { TitleDisplayOptions }; 24 | -------------------------------------------------------------------------------- /packages/core/src/types/entity/traits.ts: -------------------------------------------------------------------------------- 1 | import { Block } from "../../block"; 2 | 3 | interface EntityFallOnBlockTraitEvent { 4 | /** 5 | * The block that the entity fell on. 6 | */ 7 | block: Block; 8 | 9 | /** 10 | * The distance that the entity fell. 11 | */ 12 | fallDistance: number; 13 | 14 | /** 15 | * The amount of ticks that took place during the fall. 16 | */ 17 | fallTicks: number; 18 | } 19 | 20 | export { EntityFallOnBlockTraitEvent }; 21 | -------------------------------------------------------------------------------- /packages/core/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./serenity-properties"; 2 | export * from "./network"; 3 | export * from "./block"; 4 | export * from "./world"; 5 | export * from "./entity"; 6 | export * from "./json"; 7 | export * from "./commands"; 8 | export * from "./serenity"; 9 | export * from "./loot"; 10 | export * from "./resource"; 11 | export * from "./components"; 12 | export * from "./permissions"; 13 | -------------------------------------------------------------------------------- /packages/core/src/types/json.ts: -------------------------------------------------------------------------------- 1 | interface JSONLikeObject { 2 | [key: string]: JSONLikeValue; 3 | } 4 | 5 | type JSONLikeArray = Array; 6 | 7 | type JSONLikeValue = 8 | | null 9 | | string 10 | | number 11 | | boolean 12 | | JSONLikeObject 13 | | JSONLikeArray; 14 | 15 | export { JSONLikeObject, JSONLikeArray, JSONLikeValue }; 16 | -------------------------------------------------------------------------------- /packages/core/src/types/loot.ts: -------------------------------------------------------------------------------- 1 | import { ItemStack } from "../item"; 2 | 3 | interface LootEntry { 4 | itemStack: ItemStack; 5 | weight: number; 6 | function?: (itemStack: ItemStack) => ItemStack; 7 | } 8 | 9 | export { LootEntry }; 10 | -------------------------------------------------------------------------------- /packages/core/src/types/network/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./packet-event"; 2 | export * from "./events"; 3 | -------------------------------------------------------------------------------- /packages/core/src/types/network/packet-event.ts: -------------------------------------------------------------------------------- 1 | import type { DataPacket } from "@serenityjs/protocol"; 2 | import type { Connection } from "@serenityjs/raknet"; 3 | import type { NetworkBound } from "../../enums"; 4 | 5 | interface SessionPacketEvent { 6 | /** 7 | * The flow direction of the packet. 8 | */ 9 | bound: NetworkBound; 10 | 11 | /** 12 | * The data packet instance. 13 | */ 14 | packet: T; 15 | } 16 | 17 | /** 18 | * Represents a network packet event. 19 | */ 20 | interface NetworkPacketEvent 21 | extends SessionPacketEvent { 22 | /** 23 | * The raknet connection that the packet is being sent from. 24 | */ 25 | connection: Connection; 26 | } 27 | 28 | export { SessionPacketEvent, NetworkPacketEvent }; 29 | -------------------------------------------------------------------------------- /packages/core/src/types/resource/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./manifest"; 2 | export * from "./properties"; 3 | -------------------------------------------------------------------------------- /packages/core/src/types/resource/properties.ts: -------------------------------------------------------------------------------- 1 | interface ResourcePackEntry { 2 | path: string; 3 | subPack?: string; 4 | } 5 | 6 | interface ResourcePacksProperties { 7 | path: string | null; 8 | mustAcceptPacks: boolean; 9 | resourcePacks: Array; 10 | } 11 | 12 | export { ResourcePackEntry, ResourcePacksProperties }; 13 | -------------------------------------------------------------------------------- /packages/core/src/types/serenity/events.ts: -------------------------------------------------------------------------------- 1 | import { ServerEvent } from "../../enums"; 2 | 3 | interface ServerEvents { 4 | [ServerEvent.Start]: [unknown]; 5 | [ServerEvent.Stop]: [unknown]; 6 | } 7 | 8 | export { ServerEvents }; 9 | -------------------------------------------------------------------------------- /packages/core/src/types/serenity/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./events"; 2 | export * from "./options"; 3 | -------------------------------------------------------------------------------- /packages/core/src/types/serenity/options.ts: -------------------------------------------------------------------------------- 1 | interface EntityEffectOptions { 2 | showParticles?: boolean; 3 | amplifier?: number; 4 | } 5 | 6 | export { EntityEffectOptions }; 7 | -------------------------------------------------------------------------------- /packages/core/src/types/world/generator/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./properties"; 2 | -------------------------------------------------------------------------------- /packages/core/src/types/world/generator/properties.ts: -------------------------------------------------------------------------------- 1 | interface TerrainGeneratorProperties { 2 | seed: number; 3 | } 4 | 5 | export { TerrainGeneratorProperties }; 6 | -------------------------------------------------------------------------------- /packages/core/src/types/world/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./properties"; 2 | export * from "./generator"; 3 | export * from "./provider"; 4 | export * from "./dimension"; 5 | export * from "./events"; 6 | -------------------------------------------------------------------------------- /packages/core/src/ui/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./form"; 2 | export * from "./message"; 3 | export * from "./action"; 4 | export * from "./modal"; 5 | export * from "./bossbar"; 6 | export * from "./dialogue"; 7 | -------------------------------------------------------------------------------- /packages/core/src/world/chunk/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./block-storage"; 2 | export * from "./sub-chunk"; 3 | export * from "./chunk"; 4 | -------------------------------------------------------------------------------- /packages/core/src/world/generator/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./generator"; 2 | export * from "./void"; 3 | export * from "./superflat"; 4 | -------------------------------------------------------------------------------- /packages/core/src/world/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./world"; 2 | export * from "./chunk"; 3 | export * from "./dimension"; 4 | export * from "./provider"; 5 | export * from "./generator"; 6 | export * from "./schedule"; 7 | -------------------------------------------------------------------------------- /packages/core/src/world/provider/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./provider"; 2 | export * from "./internal"; 3 | export * from "./leveldb"; 4 | -------------------------------------------------------------------------------- /packages/core/src/world/scoreboard/display-options.ts: -------------------------------------------------------------------------------- 1 | import { Player } from "../../entity"; 2 | 3 | import type { ScoreboardObjective } from "./objective"; 4 | import type { ObjectiveSortOrder } from "@serenityjs/protocol"; 5 | 6 | interface ScoreboardObjectiveDisplayOptions { 7 | /** 8 | * The objective to display. 9 | */ 10 | objective: ScoreboardObjective; 11 | 12 | /** 13 | * The sorting order to display the scores of the objective. 14 | */ 15 | sortOrder: ObjectiveSortOrder; 16 | 17 | /** 18 | * Whether or not to display to a specific player. 19 | * If not specified, the display will be global. 20 | */ 21 | player?: Player; 22 | } 23 | 24 | export { ScoreboardObjectiveDisplayOptions }; 25 | -------------------------------------------------------------------------------- /packages/core/src/world/scoreboard/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./scoreboard"; 2 | export * from "./objective"; 3 | export * from "./identity"; 4 | export * from "./display-options"; 5 | -------------------------------------------------------------------------------- /packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/core/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options, 7 | minify: false 8 | })); 9 | -------------------------------------------------------------------------------- /packages/core/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "./dist", 4 | "readme": "README.md" 5 | } -------------------------------------------------------------------------------- /packages/data/README.md: -------------------------------------------------------------------------------- 1 | # Data 2 | -------------------------------------------------------------------------------- /packages/data/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /packages/data/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/data/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options 7 | })); 8 | -------------------------------------------------------------------------------- /packages/data/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "./dist", 4 | "readme": "README.md" 5 | } -------------------------------------------------------------------------------- /packages/emitter/README.md: -------------------------------------------------------------------------------- 1 | # Emitter 2 | 3 | -------------------------------------------------------------------------------- /packages/emitter/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /packages/emitter/src/get-path.ts: -------------------------------------------------------------------------------- 1 | import { resolve } from "path"; 2 | 3 | function getFilePath() { 4 | const error = new Error(); 5 | const stack = error?.stack?.split("\n"); 6 | // The first line is the current function, the second is the caller 7 | const callerLine = stack?.[3]; 8 | 9 | // Extract the file path from the caller line 10 | const match = callerLine?.match(/\((.*):\d+:\d+\)/); 11 | 12 | if (match) { 13 | return resolve(match[1] ?? ""); // The file path will be in the first capturing group 14 | } 15 | 16 | return null; // If no match found 17 | } 18 | 19 | export { getFilePath }; 20 | -------------------------------------------------------------------------------- /packages/emitter/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/emitter/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options 7 | })); 8 | -------------------------------------------------------------------------------- /packages/emitter/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "./dist", 4 | "readme": "README.md" 5 | } -------------------------------------------------------------------------------- /packages/internal-config/README.md: -------------------------------------------------------------------------------- 1 | # Internal Config -------------------------------------------------------------------------------- /packages/internal-config/eslint/eslint.config.base.d.mts: -------------------------------------------------------------------------------- 1 | import { Config, config } from "typescript-eslint"; 2 | 3 | declare const serenity: Config; 4 | 5 | export { 6 | serenity, 7 | config, 8 | }; 9 | -------------------------------------------------------------------------------- /packages/internal-config/tsup/tsup.config.base.d.mts: -------------------------------------------------------------------------------- 1 | import { Options } from "tsup"; 2 | 3 | declare const config: Options; 4 | 5 | export default config; 6 | -------------------------------------------------------------------------------- /packages/internal-config/tsup/tsup.config.base.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {import("tsup").Options} 3 | */ 4 | export default { 5 | bundle: true, 6 | cjsInterop: true, 7 | clean: true, 8 | dts: true, 9 | entry: ["src/index.ts"], 10 | external: [/^@serenityjs/], 11 | format: ["cjs", "esm"], 12 | keepNames: true, 13 | minify: true, 14 | skipNodeModulesBundle: true, 15 | sourcemap: "inline", 16 | splitting: false, 17 | treeshake: false, 18 | tsconfig: "./tsconfig.json", 19 | }; 20 | -------------------------------------------------------------------------------- /packages/logger/README.md: -------------------------------------------------------------------------------- 1 | # Logger 2 | 3 | -------------------------------------------------------------------------------- /packages/logger/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /packages/logger/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./logger"; 2 | export * from "./logger-colors"; 3 | export * from "./minecraft-colors"; 4 | -------------------------------------------------------------------------------- /packages/logger/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/logger/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options 7 | })); 8 | -------------------------------------------------------------------------------- /packages/logger/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "./dist", 4 | "readme": "README.md" 5 | } -------------------------------------------------------------------------------- /packages/nbt/README.md: -------------------------------------------------------------------------------- 1 | # Nbt 2 | 3 | -------------------------------------------------------------------------------- /packages/nbt/__tests__/name.test.ts: -------------------------------------------------------------------------------- 1 | describe("getName function", () => { 2 | it("should return '@serenityjs/nbt'", () => {}); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/nbt/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /packages/nbt/src/enum/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./tag-type"; 2 | -------------------------------------------------------------------------------- /packages/nbt/src/enum/tag-type.ts: -------------------------------------------------------------------------------- 1 | enum TagType { 2 | End = 0x00, 3 | Byte = 0x01, 4 | Short = 0x02, 5 | Int = 0x03, 6 | Long = 0x04, 7 | Float = 0x05, 8 | Double = 0x06, 9 | ByteArray = 0x07, 10 | String = 0x08, 11 | List = 0x09, 12 | Compound = 0x0a, 13 | IntArray = 0x0b, 14 | LongArray = 0x0c 15 | } 16 | 17 | export { TagType }; 18 | -------------------------------------------------------------------------------- /packages/nbt/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./enum"; 2 | export * from "./types"; 3 | -------------------------------------------------------------------------------- /packages/nbt/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./tag"; 2 | export * from "./byte"; 3 | export * from "./short"; 4 | export * from "./int"; 5 | export * from "./long"; 6 | export * from "./float"; 7 | export * from "./double"; 8 | export * from "./byte-array"; 9 | export * from "./string"; 10 | export * from "./list"; 11 | export * from "./compound"; 12 | -------------------------------------------------------------------------------- /packages/nbt/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/nbt/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options, 7 | minify: false 8 | })); 9 | -------------------------------------------------------------------------------- /packages/nbt/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "./dist", 4 | "readme": "README.md" 5 | } -------------------------------------------------------------------------------- /packages/plugins/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /packages/plugins/public/creating-plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityJS/serenity/5dc4f01be25977cc973a344ff62d1d754283e50e/packages/plugins/public/creating-plugin.png -------------------------------------------------------------------------------- /packages/plugins/public/template-generation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityJS/serenity/5dc4f01be25977cc973a344ff62d1d754283e50e/packages/plugins/public/template-generation.png -------------------------------------------------------------------------------- /packages/plugins/src/commands/enum.ts: -------------------------------------------------------------------------------- 1 | import { CustomEnum } from "@serenityjs/core"; 2 | 3 | class PluginsEnum extends CustomEnum { 4 | public static readonly identifier = "plugins"; 5 | public static readonly options: Array = []; 6 | } 7 | 8 | class PluginActionsEnum extends CustomEnum { 9 | public static readonly identifier = "plugin_actions"; 10 | public static readonly options: Array = ["list", "reload", "bundle"]; 11 | } 12 | 13 | export { PluginsEnum, PluginActionsEnum }; 14 | -------------------------------------------------------------------------------- /packages/plugins/src/commands/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./enum"; 2 | -------------------------------------------------------------------------------- /packages/plugins/src/enums/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./type"; 2 | -------------------------------------------------------------------------------- /packages/plugins/src/enums/type.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The plugin type declares the use case of the plugin. 3 | */ 4 | enum PluginType { 5 | /** 6 | * An addon plugin type adds additional functionality to the server, without an exposed API. 7 | */ 8 | Addon, 9 | 10 | /** 11 | * An API plugin type adds additional functionality to the server, with an exposed API for other plugins to use. 12 | */ 13 | Api 14 | } 15 | 16 | export { PluginType }; 17 | -------------------------------------------------------------------------------- /packages/plugins/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./pipeline"; 2 | export * from "./plugin"; 3 | export * from "./enums"; 4 | export * from "./types"; 5 | -------------------------------------------------------------------------------- /packages/plugins/src/registry/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./block"; 2 | export * from "./item"; 3 | export * from "./entity"; 4 | -------------------------------------------------------------------------------- /packages/plugins/src/types/events.ts: -------------------------------------------------------------------------------- 1 | import { PluginAfterEvents } from "./after-events"; 2 | import { PluginBeforeEvents } from "./before-events"; 3 | import { PluginOnEvents } from "./on-events"; 4 | 5 | type PluginEvents = Partial & 6 | Partial & 7 | Partial; 8 | 9 | export { PluginEvents }; 10 | -------------------------------------------------------------------------------- /packages/plugins/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./package"; 2 | export * from "./events"; 3 | export * from "./on-events"; 4 | export * from "./before-events"; 5 | export * from "./after-events"; 6 | -------------------------------------------------------------------------------- /packages/plugins/src/types/package.ts: -------------------------------------------------------------------------------- 1 | interface PluginPackage { 2 | name: string; 3 | version: string; 4 | main: string; 5 | module: string; 6 | } 7 | 8 | export { PluginPackage }; 9 | -------------------------------------------------------------------------------- /packages/plugins/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist", 6 | "bin" 7 | ] 8 | } -------------------------------------------------------------------------------- /packages/plugins/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options 7 | })); 8 | -------------------------------------------------------------------------------- /packages/plugins/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "./dist", 4 | "readme": "README.md" 5 | } -------------------------------------------------------------------------------- /packages/protocol/README.md: -------------------------------------------------------------------------------- 1 | # Protocol 2 | 3 | -------------------------------------------------------------------------------- /packages/protocol/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /packages/protocol/src/constants/index.ts: -------------------------------------------------------------------------------- 1 | // Contains the current protocol version and Minecraft version 2 | 3 | const PROTOCOL_VERSION = 800; 4 | const MINECRAFT_VERSION = "1.21.80"; 5 | const MINECRAFT_TICK_SPEED = 50; 6 | 7 | const SHIELD_NETWORK_ID = 380; 8 | 9 | export { 10 | PROTOCOL_VERSION, 11 | MINECRAFT_VERSION, 12 | MINECRAFT_TICK_SPEED, 13 | SHIELD_NETWORK_ID 14 | }; 15 | 16 | export * from "./default-ability-values"; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/ability-index.ts: -------------------------------------------------------------------------------- 1 | enum AbilityIndex { 2 | Build, 3 | Mine, 4 | DoorsAndSwitches, 5 | OpenContainers, 6 | AttackPlayers, 7 | AttackMobs, 8 | OperatorCommands, 9 | Teleport, 10 | Invulnerable, 11 | Flying, 12 | MayFly, 13 | InstantBuild, 14 | Lightning, 15 | FlySpeed, 16 | WalkSpeed, 17 | Muted, 18 | WorldBuilder, 19 | NoClip, 20 | PrivilegedBuilder, 21 | VerticalFlySpeed, 22 | Count 23 | } 24 | 25 | export { AbilityIndex }; 26 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/ability-layer-type.ts: -------------------------------------------------------------------------------- 1 | enum AbilityLayerType { 2 | CustomCache = 0, 3 | Base = 1, 4 | Spectator = 2, 5 | Commands = 3, 6 | Editor = 4 7 | } 8 | 9 | export { AbilityLayerType }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/ability-set.ts: -------------------------------------------------------------------------------- 1 | enum AbilitySetId { 2 | AttackMobs = "attack_mobs", 3 | AttackPlayers = "attack_players", 4 | Build = "build", 5 | Count = "count", 6 | DoorsAndSwitches = "doors_and_switches", 7 | FlySpeed = "fly_speed", 8 | Flying = "flying", 9 | InstantBuild = "instant_build", 10 | Invulnerable = "invulnerable", 11 | Lightning = "lightning", 12 | MayFly = "may_fly", 13 | Mine = "mine", 14 | Muted = "muted", 15 | NoClip = "no_clip", 16 | OpenContainers = "open_containers", 17 | OperatorCommands = "operator_commands", 18 | PrivilegedBuilder = "privileged_builder", 19 | Teleport = "teleport", 20 | WalkSpeed = "walk_speed", 21 | WorldBuilder = "world_builder" 22 | } 23 | 24 | export { AbilitySetId }; 25 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/actor-damage-cause.ts: -------------------------------------------------------------------------------- 1 | enum ActorDamageCause { 2 | None = -1, 3 | Override, 4 | Contact, 5 | EntityAttack, 6 | Projectile, 7 | Suffocation, 8 | Fall, 9 | Fire, 10 | FireTick, 11 | Lava, 12 | Drowning, 13 | BlockExplosion, 14 | EntityExplosion, 15 | Void, 16 | SelfDestruct, 17 | Magic, 18 | Wither, 19 | Starve, 20 | Anvil, 21 | Thorns, 22 | FallingBlock, 23 | Piston, 24 | FlyIntoWall, 25 | Magma, 26 | Fireworks, 27 | Lightning, 28 | Charging, 29 | Temperature, 30 | Freezing, 31 | Stalactite, 32 | Stalagmite, 33 | RamAttack, 34 | SonicBoom, 35 | Campfire, 36 | SoulCampfire, 37 | All 38 | } 39 | 40 | export { ActorDamageCause }; 41 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/actor-data-type.ts: -------------------------------------------------------------------------------- 1 | enum ActorDataType { 2 | Byte, 3 | Short, 4 | Int, 5 | Float, 6 | String, 7 | CompoundTag, 8 | BlockPos, 9 | Long, 10 | Vec3 11 | } 12 | 13 | export { ActorDataType }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/actor-link-type.ts: -------------------------------------------------------------------------------- 1 | enum ActorLinkType { 2 | Remove, 3 | Rider, 4 | Passenger 5 | } 6 | 7 | export { ActorLinkType }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/animate-id.ts: -------------------------------------------------------------------------------- 1 | enum AnimateId { 2 | None, 3 | SwingArm, 4 | Unknown, 5 | WakeUp, 6 | CriticalHit, 7 | MagicCriticalHit, 8 | RowRight = 128, 9 | RowLeft 10 | } 11 | 12 | export { AnimateId }; 13 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/block-event-type.ts: -------------------------------------------------------------------------------- 1 | enum BlockEventType { 2 | Sound, 3 | ChangeState 4 | } 5 | 6 | export { BlockEventType }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/block-face.ts: -------------------------------------------------------------------------------- 1 | enum BlockFace { 2 | Bottom, 3 | Top, 4 | North, 5 | South, 6 | West, 7 | East 8 | } 9 | 10 | export { BlockFace }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/book-edit-action.ts: -------------------------------------------------------------------------------- 1 | enum BookEditAction { 2 | ReplacePage, 3 | AddPage, 4 | DeletePage, 5 | SwapPage, 6 | Finalize 7 | } 8 | 9 | export { BookEditAction }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/boss-event-color.ts: -------------------------------------------------------------------------------- 1 | enum BossEventColor { 2 | Pink, 3 | Blue, 4 | Red, 5 | Green, 6 | Yellow, 7 | Magenta, 8 | Purple, 9 | White 10 | } 11 | 12 | export { BossEventColor }; 13 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/boss-event-update-type.ts: -------------------------------------------------------------------------------- 1 | enum BossEventUpdateType { 2 | Add, 3 | PlayerAdded, 4 | Remove, 5 | PlayerRemoved, 6 | UpdatePercent, 7 | UpdateName, 8 | UpdateProperties, 9 | UpdateStyle, 10 | Query 11 | } 12 | 13 | export { BossEventUpdateType }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/camera-audio-listeners.ts: -------------------------------------------------------------------------------- 1 | enum CameraAudioListener { 2 | Camera, 3 | Player 4 | } 5 | 6 | export { CameraAudioListener }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/client-input-locks-flag.ts: -------------------------------------------------------------------------------- 1 | enum ClientInputLocksFlag { 2 | Move = 0x02, 3 | Jump = 0x04, 4 | Sneak = 0x08, 5 | Mount = 0x10, 6 | Dismount = 0x20, 7 | Rotate = 0x40 8 | } 9 | 10 | export { ClientInputLocksFlag }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/command-block-mode.ts: -------------------------------------------------------------------------------- 1 | enum CommandBlockMode { 2 | Impulse = 0, 3 | Repeating = 1, 4 | Chain = 2 5 | } 6 | 7 | export { CommandBlockMode }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/command-parameter-type.ts: -------------------------------------------------------------------------------- 1 | enum CommandParameterType { 2 | Int = 1, 3 | Float = 3, 4 | Value = 4, 5 | WildcardInt = 5, 6 | Operator = 6, 7 | CompareOperator = 7, 8 | Target = 8, 9 | WildcardTarget = 10, 10 | Filepath = 17, 11 | FullIntegerRange = 23, 12 | EquipmentSlot = 47, 13 | String = 48, 14 | IntPosition = 64, 15 | FloatPosition = 65, 16 | Message = 67, 17 | RawText = 70, 18 | Json = 74, 19 | BlockState = 84, 20 | Command = 87 21 | } 22 | 23 | export { CommandParameterType }; 24 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/command-permission-level.ts: -------------------------------------------------------------------------------- 1 | enum CommandPermissionLevel { 2 | Normal, 3 | Operator, 4 | Automation, 5 | Host, 6 | Owner, 7 | Internal 8 | } 9 | 10 | export { CommandPermissionLevel }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/complex-inventory-transaction.ts: -------------------------------------------------------------------------------- 1 | enum ComplexInventoryTransaction { 2 | NormalTransaction = 0, 3 | InventoryMismatch = 1, 4 | ItemUseTransaction = 2, 5 | ItemUseOnEntityTransaction = 3, 6 | ItemReleaseTransaction = 4 7 | } 8 | 9 | export { ComplexInventoryTransaction }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/compression-method.ts: -------------------------------------------------------------------------------- 1 | enum CompressionMethod { 2 | Zlib, 3 | Snappy, 4 | NotPresent, 5 | None = 0xff 6 | } 7 | 8 | export { CompressionMethod }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/container-data-type.ts: -------------------------------------------------------------------------------- 1 | enum ContainerDataType { 2 | FurnanceTickCount = 0, 3 | FurnaceLitTime = 1, 4 | FurnaceLitDuration = 2, 5 | FurnaceStoredXp = 3, 6 | FurnaceFuelAux = 4, 7 | BrewTime = 5, 8 | BrewFuelAmount = 6, 9 | BrewFuelTotal = 7 10 | } 11 | 12 | export { ContainerDataType }; 13 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/container-id.ts: -------------------------------------------------------------------------------- 1 | enum ContainerId { 2 | None = -1, 3 | Inventory = 0, 4 | First = 1, 5 | Last = 100, 6 | Offhand = 119, 7 | Armor = 120, 8 | SelectionSlots = 122, 9 | Ui = 124, 10 | Registry = 125 11 | } 12 | 13 | export { ContainerId }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/crafting-data-entry-type.ts: -------------------------------------------------------------------------------- 1 | enum CraftingDataEntryType { 2 | ShapelessRecipe = 0, 3 | ShapedRecipe = 1, 4 | FurnaceRecipe = 2, 5 | FurnaceAuxRecipe = 3, 6 | MultiRecipe = 4, 7 | UserDataShapelessRecipe = 5, 8 | ShapelessChemistryRecipe = 6, 9 | ShapedChemistryRecipe = 7, 10 | SmithingTransformRecipe = 8, 11 | SmithingTrimRecipe = 9, 12 | COUNT = 10 13 | } 14 | 15 | export { CraftingDataEntryType }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/creative-item-category.ts: -------------------------------------------------------------------------------- 1 | enum CreativeItemCategory { 2 | All = 0, 3 | Construction = 1, 4 | Nature = 2, 5 | Equipment = 3, 6 | Items = 4, 7 | ItemCommandOnly = 5, 8 | Undefined = 6, 9 | NUM_CATEGORIES = 7 10 | } 11 | 12 | export { CreativeItemCategory }; 13 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/debugger-protocol-version.ts: -------------------------------------------------------------------------------- 1 | enum DebuggerProtocolVersion { 2 | Initial = 1, 3 | SupportTargetModuleUuid = 2, 4 | SupportTargetSelection = 3, 5 | SupportPasscode = 4 6 | } 7 | 8 | export { DebuggerProtocolVersion }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/decoration-type.ts: -------------------------------------------------------------------------------- 1 | enum MapDecorationType { 2 | MarkerWhite, 3 | MarkerGreen, 4 | MarkerRed, 5 | MarkerBlue, 6 | XWhite, 7 | TriangleRed, 8 | SquareWhite, 9 | MarkerSign, 10 | MarkerPink, 11 | MarkerOrange, 12 | MarkerYellow, 13 | MarkerTeal, 14 | TriangleGreen, 15 | SmallSquareWhite, 16 | Mansion, 17 | Monument, 18 | NoDraw, 19 | VillageDesert, 20 | VillagePlains, 21 | VillageSavanna, 22 | VillageSnowy, 23 | VillageTaiga, 24 | JungleTemple, 25 | WitchHut, 26 | TrialChambers, 27 | Count, 28 | Player = MarkerWhite, 29 | PlayerOffMap = SquareWhite, 30 | PlayerOffLimits = SmallSquareWhite, 31 | PlayerHidden = NoDraw, 32 | ItemFrame = MarkerGreen 33 | } 34 | 35 | export { MapDecorationType }; 36 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/device-o-s.ts: -------------------------------------------------------------------------------- 1 | enum DeviceOS { 2 | Undefined, 3 | Android, 4 | Ios, 5 | MacOS, 6 | FireOS, 7 | GearVR, 8 | Hololens, 9 | Win10, 10 | Win32, 11 | Dedicated, 12 | TVOS, 13 | Orbis, 14 | Switch, 15 | Xbox, 16 | WindowsPhone, 17 | Linux 18 | } 19 | 20 | export { DeviceOS }; 21 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/difficulty.ts: -------------------------------------------------------------------------------- 1 | enum Difficulty { 2 | Peaceful, 3 | Easy, 4 | Normal, 5 | Hard 6 | } 7 | 8 | export { Difficulty }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/dimension-type.ts: -------------------------------------------------------------------------------- 1 | enum DimensionType { 2 | Overworld, 3 | Nether, 4 | End 5 | } 6 | 7 | export { DimensionType }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/display-slot-type.ts: -------------------------------------------------------------------------------- 1 | enum DisplaySlotType { 2 | List = "slot", 3 | Sidebar = "sidebar", 4 | BelowName = "belowname" 5 | } 6 | 7 | export { DisplaySlotType }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/easing-type.ts: -------------------------------------------------------------------------------- 1 | enum EasingType { 2 | Linear, 3 | Spring, 4 | InQuad, 5 | OutQuad, 6 | InOutQuad, 7 | InCubic, 8 | OutCubic, 9 | InOutCubic, 10 | InQuart, 11 | OutQuart, 12 | InOutQuart, 13 | InQuint, 14 | OutQuint, 15 | InOutQuint, 16 | InSine, 17 | OutSine, 18 | InOutSine, 19 | InExpo, 20 | OutExpo, 21 | InOutExpo, 22 | InCirc, 23 | OutCirc, 24 | InOutCirc, 25 | InBounce, 26 | OutBounce, 27 | InOutBounce, 28 | InBack, 29 | OutBack, 30 | InOutBack, 31 | InElastic, 32 | OutElastic, 33 | InOutElastic 34 | } 35 | 36 | export { EasingType }; 37 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/effect-type.ts: -------------------------------------------------------------------------------- 1 | enum EffectType { 2 | Speed = 1, 3 | Slowness, 4 | Haste, 5 | MiningFatigue, 6 | Strength, 7 | InstantHealth, 8 | InstantDamage, 9 | JumpBoost, 10 | Nausea, 11 | Regeneration, 12 | Resistance, 13 | FireResistance, 14 | WaterBreathing, 15 | Invisibility, 16 | Blindness, 17 | NightVision, 18 | Hunger, 19 | Weakness, 20 | Poison, 21 | Wither, 22 | HealthBoost, 23 | Absorption, 24 | Saturation, 25 | Levitation, 26 | FatalPoison, 27 | ConduitPower, 28 | SlowFalling, 29 | BadOmen, 30 | HeroOfTheVillage, 31 | Darkness, 32 | 33 | // 1.21 SPECIFIC 34 | TrialOmen, 35 | WindCharged, 36 | Weaving, 37 | Oozing, 38 | Infested 39 | } 40 | 41 | export { EffectType }; 42 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/emote-flag.ts: -------------------------------------------------------------------------------- 1 | enum EmoteFlags { 2 | SERVER, 3 | MUTE_CHAT 4 | } 5 | 6 | export { EmoteFlags }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/entity-property-type.ts: -------------------------------------------------------------------------------- 1 | enum EntityPropertyType { 2 | Int = 0, 3 | Float = 1, 4 | Boolean = 2, 5 | Enum = 3 6 | } 7 | 8 | export { EntityPropertyType }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/equipment-slot.ts: -------------------------------------------------------------------------------- 1 | enum EquipmentSlot { 2 | Head, 3 | Chest, 4 | Legs, 5 | Feet, 6 | Offhand 7 | } 8 | 9 | export { EquipmentSlot }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/game-rule-type.ts: -------------------------------------------------------------------------------- 1 | enum GameRuleType { 2 | Bool = 1, 3 | Int = 2, 4 | Float = 3 5 | } 6 | 7 | export { GameRuleType }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/gamemode.ts: -------------------------------------------------------------------------------- 1 | enum Gamemode { 2 | Survival, 3 | Creative, 4 | Adventure, 5 | SurvivalSpectator, 6 | CreativeSpectator, 7 | Fallback, 8 | Spectator 9 | } 10 | 11 | export { Gamemode }; 12 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/generator-type.ts: -------------------------------------------------------------------------------- 1 | enum GeneratorType { 2 | Legacy, 3 | Overworld, 4 | Flat, 5 | Nether, 6 | TheEnd, 7 | Void 8 | } 9 | 10 | export { GeneratorType }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/graphics-mode.ts: -------------------------------------------------------------------------------- 1 | enum GraphicsMode { 2 | Simple = 0, 3 | Fancy = 1, 4 | Advanced = 2, 5 | RayTraced = 3 6 | } 7 | 8 | export { GraphicsMode }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/hud-element.ts: -------------------------------------------------------------------------------- 1 | enum HudElement { 2 | PaperDoll = 0, 3 | Armor = 1, 4 | ToolTips = 2, 5 | TouchControls = 3, 6 | Crosshair = 4, 7 | HotBar = 5, 8 | Health = 6, 9 | ProgressBar = 7, 10 | Hunger = 8, 11 | AirBubbles = 9, 12 | HorseHealth = 10, 13 | StatusEffects = 11, 14 | ItemText = 12, 15 | Count = 13 16 | } 17 | 18 | export { HudElement }; 19 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/hud-visibility.ts: -------------------------------------------------------------------------------- 1 | enum HudVisibility { 2 | Hide = 0, 3 | Reset = 1, 4 | Count = 2 5 | } 6 | 7 | export { HudVisibility }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/input-lock-flags.ts: -------------------------------------------------------------------------------- 1 | enum InputLockFlags { 2 | None = 0x0, 3 | Camera = 0x2, 4 | Movement = 0x4 5 | } 6 | 7 | export { InputLockFlags }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/input-mode.ts: -------------------------------------------------------------------------------- 1 | enum InputMode { 2 | Unknown, 3 | Mouse, 4 | Touch, 5 | GamePad, 6 | MotionController 7 | } 8 | 9 | export { InputMode }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/interact-action.ts: -------------------------------------------------------------------------------- 1 | enum InteractAction { 2 | Invalid = 0, 3 | StopRiding = 3, 4 | InteractUpdate = 4, 5 | NpcOpen = 5, 6 | OpenInventory = 6 7 | } 8 | 9 | export { InteractAction }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/interaction-mode.ts: -------------------------------------------------------------------------------- 1 | enum InteractionMode { 2 | Touch, 3 | Crosshair, 4 | Classic 5 | } 6 | 7 | export { InteractionMode }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/internal-type.ts: -------------------------------------------------------------------------------- 1 | enum InternalType { 2 | Invalid = 0, 3 | Default = 1, 4 | Molang = 2, 5 | ItemTag = 3, 6 | Deferred = 4, 7 | ComplexAlias = 5 8 | } 9 | 10 | export { InternalType }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/inventory-layout.ts: -------------------------------------------------------------------------------- 1 | enum InventoryLayout { 2 | NONE, 3 | SURVIVAL, 4 | RECIPE_BOOK, 5 | CREATIVE 6 | } 7 | 8 | export { InventoryLayout }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/inventory-left-tab.ts: -------------------------------------------------------------------------------- 1 | enum InventoryLeftTab { 2 | NONE, 3 | CONSTRUCTION, 4 | EQUIPMENT, 5 | ITEMS, 6 | NATURE, 7 | SEARCH, 8 | SURVIVAL 9 | } 10 | 11 | export { InventoryLeftTab }; 12 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/inventory-right-tab.ts: -------------------------------------------------------------------------------- 1 | enum InventoryRightTab { 2 | NONE, 3 | FULL_SCREEN, 4 | CRAFTING, 5 | ARMOR 6 | } 7 | 8 | export { InventoryRightTab }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/inventory-source-type.ts: -------------------------------------------------------------------------------- 1 | enum InventorySourceType { 2 | ContainerInventory = 0, 3 | GlobalInventory = 1, 4 | WorldInteraction = 2, 5 | CreativeInventory = 3, 6 | NonImplementedFeatureTODO = 99_999 7 | } 8 | 9 | export { InventorySourceType }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/item-release-inventory-transaction-type.ts: -------------------------------------------------------------------------------- 1 | enum ItemReleaseInventoryTransactionType { 2 | Release = 0, 3 | Consume = 1 4 | } 5 | 6 | export { ItemReleaseInventoryTransactionType }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/item-stack-status.ts: -------------------------------------------------------------------------------- 1 | enum ItemStackStatus { 2 | Ok, 3 | Error 4 | } 5 | 6 | export { ItemStackStatus }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/item-use-inventory-transaction-type.ts: -------------------------------------------------------------------------------- 1 | enum ItemUseInventoryTransactionType { 2 | Place = 0, 3 | Use = 1, 4 | Destroy = 2 5 | } 6 | 7 | export { ItemUseInventoryTransactionType }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/item-use-method.ts: -------------------------------------------------------------------------------- 1 | enum ItemUseMethod { 2 | Unknown = -1, 3 | EquipArmor, 4 | Eat, 5 | Attack, 6 | Consume, 7 | Throw, 8 | Shoot, 9 | Place, 10 | FillBottle, 11 | FillBucket, 12 | PourBucket, 13 | UseTool, 14 | Interact, 15 | Retrieved, 16 | Dyed, 17 | Traded, 18 | BrushingCompleted, 19 | OpenedVault, 20 | _Count 21 | } 22 | 23 | export { ItemUseMethod }; 24 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/item-use-on-entity-inventory-transaction-type.ts: -------------------------------------------------------------------------------- 1 | enum ItemUseOnEntityInventoryTransactionType { 2 | Interact = 0, 3 | Attack = 1 4 | } 5 | 6 | export { ItemUseOnEntityInventoryTransactionType }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/material-render-method.ts: -------------------------------------------------------------------------------- 1 | enum MaterialRenderMethod { 2 | AlphaTest = "alpha_test", 3 | AlphaTestSingleSided = "alpha_test_single_sided", 4 | Blend = "blend", 5 | DoubleSided = "double_sided", 6 | Opaque = "opaque" 7 | } 8 | 9 | export { MaterialRenderMethod }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/memory-tier.ts: -------------------------------------------------------------------------------- 1 | enum MemoryTier { 2 | Undetermined = 0, 3 | SuperLow = 1, 4 | Low = 2, 5 | Mid = 3, 6 | Hight = 4, 7 | SuperHigh = 5 8 | } 9 | 10 | export { MemoryTier }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/mob-effect-events.ts: -------------------------------------------------------------------------------- 1 | enum MobEffectEvents { 2 | EffectAdd = 1, 3 | EffectModify, 4 | EffectRemove 5 | } 6 | 7 | export { MobEffectEvents }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/modal-form-canceled-reason.ts: -------------------------------------------------------------------------------- 1 | enum ModalFormCanceledReason { 2 | Closed, 3 | Busy 4 | } 5 | 6 | export { ModalFormCanceledReason }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/modal-form-type.ts: -------------------------------------------------------------------------------- 1 | enum ModalFormType { 2 | Action = "form", 3 | Message = "modal", 4 | Modal = "custom_form", 5 | Dialogue = "dialogue" 6 | } 7 | 8 | export { ModalFormType }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/move-delta-flags.ts: -------------------------------------------------------------------------------- 1 | enum MoveDeltaFlags { 2 | HasX = 0x01, 3 | HasY = 0x02, 4 | HasZ = 0x04, 5 | HasRotationX = 0x08, 6 | HasRotationY = 0x10, 7 | HasRotationZ = 0x20, 8 | OnGround = 0x40, 9 | Teleport = 0x80, 10 | ForceMove = 0x100, 11 | All = 0x3f 12 | } 13 | 14 | export { MoveDeltaFlags }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/move-mode.ts: -------------------------------------------------------------------------------- 1 | enum MoveMode { 2 | Normal, 3 | Reset, 4 | Teleport, 5 | Rotation 6 | } 7 | 8 | export { MoveMode }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/movement-effect-type.ts: -------------------------------------------------------------------------------- 1 | enum MovementEffectType { 2 | GlideBoost 3 | } 4 | 5 | export { MovementEffectType }; 6 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/npc-dialogue-action.ts: -------------------------------------------------------------------------------- 1 | enum NpcDialogueAction { 2 | Open, 3 | Close 4 | } 5 | 6 | export { NpcDialogueAction }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/npc-request-type.ts: -------------------------------------------------------------------------------- 1 | enum NpcRequestType { 2 | SetActions, 3 | ExecuteAction, 4 | ExecuteClosingCommands, 5 | SetName, 6 | SetSkin, 7 | SetInteractText, 8 | ExecuteOpeningCommands 9 | } 10 | 11 | export { NpcRequestType }; 12 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/objective-sort-order.ts: -------------------------------------------------------------------------------- 1 | enum ObjectiveSortOrder { 2 | Ascending = 0, 3 | Descending = 1 4 | } 5 | 6 | export { ObjectiveSortOrder }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/pack-type.ts: -------------------------------------------------------------------------------- 1 | enum PackType { 2 | Addon = 1, 3 | Cached = 2, 4 | CopyProtected = 3, 5 | Behaviour = 4, 6 | PersonaPiece = 5, 7 | Resources = 6, 8 | Skins = 7, 9 | WorldTemplate = 8 10 | } 11 | 12 | export { PackType }; 13 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/permission-flag.ts: -------------------------------------------------------------------------------- 1 | enum PermissionFlag { 2 | Build = 0b1, 3 | Mine = 0b10, 4 | DoorsAndSwitches = 0b100, 5 | OpenContainers = 0b1000, 6 | AttackPlayers = 0b10000, 7 | AttackMobs = 0b100000, 8 | OperatorCommands = 0b1000000, 9 | Teleport = 0b10000000 10 | } 11 | 12 | export { PermissionFlag }; 13 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/permission-level.ts: -------------------------------------------------------------------------------- 1 | enum PermissionLevel { 2 | Visitor, 3 | Member, 4 | Operator, 5 | Custom 6 | } 7 | 8 | export { PermissionLevel }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/play-mode.ts: -------------------------------------------------------------------------------- 1 | enum PlayMode { 2 | Normal, 3 | Teaser, 4 | Screen, 5 | Viewer, 6 | Reality, 7 | Placement, 8 | LivingRoom, 9 | ExitLevel, 10 | ExitLevelLivingRoom, 11 | NumberModes 12 | } 13 | 14 | export { PlayMode }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/play-status.ts: -------------------------------------------------------------------------------- 1 | enum PlayStatus { 2 | LoginSuccess, 3 | FailedClient, 4 | FailedServer, 5 | PlayerSpawn, 6 | FailedInvalidTenant, 7 | FailedVanillaEdu, 8 | FailedIncompatible, 9 | FailedServerFull, 10 | FailedEditorVanillaMismatch, 11 | FailedVanillaEditorMismatch 12 | } 13 | 14 | export { PlayStatus }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/player-list-action.ts: -------------------------------------------------------------------------------- 1 | enum PlayerListAction { 2 | Add, 3 | Remove 4 | } 5 | 6 | export { PlayerListAction }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/player-update-entity-overrides-type.ts: -------------------------------------------------------------------------------- 1 | enum PlayerUpdateEntityOverridesType { 2 | ClearOverrides = 0, 3 | RemoveOverride = 1, 4 | SetIntOverride = 2, 5 | SetFloatOverride = 3 6 | } 7 | 8 | export { PlayerUpdateEntityOverridesType }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/predicted-result.ts: -------------------------------------------------------------------------------- 1 | enum PredictedResult { 2 | Failure = 0, 3 | Success = 1 4 | } 5 | 6 | export { PredictedResult }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/prediction-type.ts: -------------------------------------------------------------------------------- 1 | enum PredictionType { 2 | Player = 0, 3 | Vehicle = 1 4 | } 5 | 6 | export { PredictionType }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/resource-pack-response.ts: -------------------------------------------------------------------------------- 1 | enum ResourcePackResponse { 2 | None, 3 | Refused, 4 | SendPacks, 5 | HaveAllPacks, 6 | Completed 7 | } 8 | 9 | export { ResourcePackResponse }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/respawn-state.ts: -------------------------------------------------------------------------------- 1 | enum RespawnState { 2 | ServerSearchingForSpawn, 3 | ServerReadyToSpawn, 4 | ClientReadyToSpawn 5 | } 6 | 7 | export { RespawnState }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/scoreboard-action-type.ts: -------------------------------------------------------------------------------- 1 | enum ScoreboardActionType { 2 | Change, 3 | Remove 4 | } 5 | 6 | export { ScoreboardActionType }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/scoreboard-identity-action.ts: -------------------------------------------------------------------------------- 1 | enum ScoreboardIdentityAction { 2 | Register, 3 | Clear 4 | } 5 | 6 | export { ScoreboardIdentityAction }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/scoreboard-identity-type.ts: -------------------------------------------------------------------------------- 1 | enum ScoreboardIdentityType { 2 | Invalid = 0, 3 | Player = 1, 4 | Entity = 2, 5 | FakePlayer = 3 6 | } 7 | 8 | export { ScoreboardIdentityType }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/server-auth-movement-mode.ts: -------------------------------------------------------------------------------- 1 | enum ServerAuthMovementMode { 2 | LegacyClientAuthoritativeV1 = 0, 3 | ClientAuthoritativeV2 = 1, 4 | ServerAuthoritativeV3 = 2 5 | } 6 | 7 | export { ServerAuthMovementMode }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/serverbound-loading-screen-type.ts: -------------------------------------------------------------------------------- 1 | enum ServerboundLoadingScreenType { 2 | Unknown = 0, 3 | StartLoadingScreen = 1, 4 | EndLoadingScreen = 2 5 | } 6 | 7 | export { ServerboundLoadingScreenType }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/shake-action.ts: -------------------------------------------------------------------------------- 1 | enum ShakeAction { 2 | Add, 3 | Stop 4 | } 5 | 6 | export { ShakeAction }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/shake-type.ts: -------------------------------------------------------------------------------- 1 | enum ShakeType { 2 | Positional, 3 | Rotational 4 | } 5 | 6 | export { ShakeType }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/spawn-type.ts: -------------------------------------------------------------------------------- 1 | enum SpawnType { 2 | Player = 0, 3 | World = 1 4 | } 5 | 6 | export { SpawnType }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/text-packet-type.ts: -------------------------------------------------------------------------------- 1 | enum TextPacketType { 2 | Raw, 3 | Chat, 4 | Translation, 5 | Popup, 6 | JukeboxPopup, 7 | Tip, 8 | System, 9 | Whisper, 10 | Announcement, 11 | JsonWhisper, 12 | Json, 13 | JsonAnnouncement 14 | } 15 | 16 | export { TextPacketType }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/title-type.ts: -------------------------------------------------------------------------------- 1 | enum TitleType { 2 | Clear = 0, 3 | Reset = 1, 4 | Title = 2, 5 | Subtitle = 3, 6 | Actionbar = 4, 7 | Times = 5, 8 | TitleTextObject = 6, 9 | SubtitleTextObject = 7, 10 | ActionbarTextObject = 8 11 | } 12 | 13 | export { TitleType }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/tracked-item.ts: -------------------------------------------------------------------------------- 1 | enum ItemTrackedType { 2 | Entity, 3 | BlockEntity, 4 | Other 5 | } 6 | 7 | export { ItemTrackedType }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/transaction-source-type.ts: -------------------------------------------------------------------------------- 1 | enum TransactionSourceType { 2 | Container, 3 | Global, 4 | WorldInteraction, 5 | Creative, 6 | CraftSlot = 100, 7 | Craft = 9999 8 | } 9 | 10 | export { TransactionSourceType }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/trigger-type.ts: -------------------------------------------------------------------------------- 1 | enum TriggerType { 2 | Unknown = 0, 3 | PlayerInput = 1, 4 | SimulationTick = 2 5 | } 6 | 7 | export { TriggerType }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/unlocking-context.ts: -------------------------------------------------------------------------------- 1 | enum UnlockingContext { 2 | None = 0, 3 | AlwaysUnlocked = 1, 4 | PlayerInWater = 2, 5 | PlayerHasManyItems = 3 6 | } 7 | 8 | export { UnlockingContext }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/update-block-flags-type.ts: -------------------------------------------------------------------------------- 1 | enum UpdateBlockFlagsType { 2 | None = 0b0000, 3 | Neighbors = 0b0001, 4 | Network = 0b0010, 5 | NoGraphic = 0b0100, 6 | Priority = 0b1000 7 | } 8 | 9 | export { UpdateBlockFlagsType }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/update-block-layer-type.ts: -------------------------------------------------------------------------------- 1 | enum UpdateBlockLayerType { 2 | Normal, 3 | WaterLogged 4 | } 5 | 6 | export { UpdateBlockLayerType }; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/update-type.ts: -------------------------------------------------------------------------------- 1 | enum UpdateType { 2 | ClearOverrides = 0, 3 | RemoveOverride = 1, 4 | SetIntOverride = 2, 5 | SetFloatOverride = 3 6 | } 7 | 8 | export { UpdateType }; 9 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/violation-severity.ts: -------------------------------------------------------------------------------- 1 | enum ViolationSeverity { 2 | Warning, 3 | FanalWarning, 4 | Terminating 5 | } 6 | 7 | export { ViolationSeverity }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/violation-type.ts: -------------------------------------------------------------------------------- 1 | enum ViolationType { 2 | Malformed 3 | } 4 | 5 | export { ViolationType }; 6 | -------------------------------------------------------------------------------- /packages/protocol/src/enums/wearable-slot.ts: -------------------------------------------------------------------------------- 1 | enum WearableSlot { 2 | Head = "slot.armor.head", 3 | Chest = "slot.armor.chest", 4 | Legs = "slot.armor.legs", 5 | Feet = "slot.armor.feet", 6 | Offhand = "slot.weapon.offhand" 7 | } 8 | 9 | export { WearableSlot }; 10 | -------------------------------------------------------------------------------- /packages/protocol/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./enums"; 2 | export * from "./proto"; 3 | export * from "./constants"; 4 | export * from "./types"; 5 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/actor-event.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Uint8, VarLong, ZigZag } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ActorEvent) 9 | class ActorEventPacket extends DataPacket { 10 | @Serialize(VarLong) public actorRuntimeId!: bigint; 11 | @Serialize(Uint8) public event!: number; 12 | @Serialize(ZigZag) public data!: number; 13 | } 14 | 15 | export { ActorEventPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/add-painting.ts: -------------------------------------------------------------------------------- 1 | import { ZigZong, ZigZag, VarString } from "@serenityjs/binarystream"; 2 | import { Serialize, Proto } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { Vector3f } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.AddPainting) 10 | class AddPaintingPacket extends DataPacket { 11 | @Serialize(ZigZong) public uniqueId!: bigint; 12 | @Serialize(ZigZong) public runtimeId!: bigint; 13 | @Serialize(Vector3f) public position!: Vector3f; 14 | @Serialize(ZigZag) public direction!: number; 15 | @Serialize(VarString) public name!: string; 16 | } 17 | 18 | export { AddPaintingPacket }; 19 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/animate.ts: -------------------------------------------------------------------------------- 1 | import { VarLong, ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type AnimateId, Packet } from "../../enums"; 5 | import { AnimateAction } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.Animate) 10 | class AnimatePacket extends DataPacket { 11 | @Serialize(ZigZag) public id!: AnimateId; 12 | @Serialize(VarLong) public runtimeEntityId!: bigint; 13 | @Serialize(AnimateAction) public boatRowingTime!: number | null; 14 | } 15 | 16 | export { AnimatePacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/available-actor-identifiers.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { CompoundTag } from "@serenityjs/nbt"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.AvailableActorIdentifiers) 9 | class AvailableActorIdentifiersPacket extends DataPacket { 10 | @Serialize(CompoundTag, true) public data!: CompoundTag; 11 | } 12 | 13 | export { AvailableActorIdentifiersPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/award-achievement.ts: -------------------------------------------------------------------------------- 1 | import { Int32, Endianness } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.AwardAchievement) 9 | class AwardAchievementPacket extends DataPacket { 10 | @Serialize(Int32, Endianness.Little) public identifier!: number; 11 | } 12 | 13 | export { AwardAchievementPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/biome-definition-list.ts: -------------------------------------------------------------------------------- 1 | import { Proto } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | 5 | import { DataPacket } from "./data-packet"; 6 | 7 | import type { Buffer } from "node:buffer"; 8 | 9 | @Proto(Packet.BiomeDefinitionList) 10 | class BiomeDefinitionListPacket extends DataPacket { 11 | public biomes!: Buffer; 12 | 13 | public override serialize(): Buffer { 14 | this.writeVarInt(Packet.BiomeDefinitionList); 15 | this.writeBuffer(this.biomes); 16 | 17 | return this.getBuffer(); 18 | } 19 | 20 | public override deserialize(): this { 21 | this.readVarInt(); 22 | this.biomes = this.readRemainingBuffer(); 23 | 24 | return this; 25 | } 26 | } 27 | 28 | export { BiomeDefinitionListPacket }; 29 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/block-actor-data.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { CompoundTag } from "@serenityjs/nbt"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { BlockPosition } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.BlockActorData) 10 | class BlockActorDataPacket extends DataPacket { 11 | @Serialize(BlockPosition) public position!: BlockPosition; 12 | @Serialize(CompoundTag, true) public nbt!: CompoundTag; 13 | } 14 | 15 | export { BlockActorDataPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/block-event.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { ZigZag } from "@serenityjs/binarystream"; 3 | 4 | import { BlockPosition } from "../types"; 5 | import { type BlockEventType, Packet } from "../../enums"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.BlockEvent) 10 | class BlockEventPacket extends DataPacket { 11 | @Serialize(BlockPosition) public position!: BlockPosition; 12 | @Serialize(ZigZag) public type!: BlockEventType; 13 | @Serialize(ZigZag) public data!: number; 14 | } 15 | 16 | export { BlockEventPacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/block-pick-request.ts: -------------------------------------------------------------------------------- 1 | import { Bool, Uint8, ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.BlockPickRequest) 9 | class BlockPickRequestPacket extends DataPacket { 10 | @Serialize(ZigZag) public x!: number; 11 | @Serialize(ZigZag) public y!: number; 12 | @Serialize(ZigZag) public z!: number; 13 | @Serialize(Bool) public addData!: boolean; 14 | @Serialize(Uint8) public selectedSlot!: number; 15 | } 16 | 17 | export { BlockPickRequestPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/book-edit.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Uint8 } from "@serenityjs/binarystream"; 3 | 4 | import { type BookEditAction, Packet } from "../../enums"; 5 | import { BookActions } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.BookEdit) 10 | class BookEditPacket extends DataPacket { 11 | @Serialize(Uint8) 12 | public action!: BookEditAction; 13 | 14 | @Serialize(Uint8) 15 | public bookSlot!: number; 16 | 17 | @Serialize(BookActions, false, "action") 18 | public actions!: BookActions; 19 | } 20 | 21 | export { BookEditPacket }; 22 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/boss-event.ts: -------------------------------------------------------------------------------- 1 | import { VarInt, ZigZong, Endianness } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type BossEventUpdateType, Packet } from "../../enums"; 5 | import { BossEventAdd, BossEventUpdate } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.BossEvent) 10 | class BossEventPacket extends DataPacket { 11 | @Serialize(ZigZong) public targetUniqueId!: bigint; 12 | @Serialize(VarInt) public type!: BossEventUpdateType; 13 | @Serialize(BossEventAdd, Endianness.Little, "type") public add!: BossEventAdd; 14 | @Serialize(BossEventUpdate, Endianness.Little, "type") 15 | public update!: BossEventUpdate; 16 | } 17 | 18 | export { BossEventPacket }; 19 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/camera-instructions.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { CameraInstructions } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.CameraInstructions) 9 | class CameraInstructionsPacket extends DataPacket { 10 | @Serialize(CameraInstructions) 11 | public instruction!: CameraInstructions; 12 | } 13 | 14 | export { CameraInstructionsPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/camera-presets.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { CameraPreset } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.CameraPresetsPacket) 9 | class CameraPresetsPacket extends DataPacket { 10 | @Serialize(CameraPreset) 11 | public presets!: Array; 12 | } 13 | 14 | export { CameraPresetsPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/camera-shake.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Float32, Uint8 } from "@serenityjs/binarystream"; 3 | 4 | import { Packet, type ShakeAction, type ShakeType } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.CameraShake) 9 | class CameraShakePacket extends DataPacket { 10 | @Serialize(Float32) 11 | public intensity!: number; 12 | 13 | @Serialize(Float32) 14 | public duration!: number; 15 | 16 | @Serialize(Uint8) 17 | public shakeType!: ShakeType; 18 | 19 | @Serialize(Uint8) 20 | public shakeAction!: ShakeAction; 21 | } 22 | 23 | export { CameraShakePacket }; 24 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/change-dimension.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag, Bool } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type DimensionType, Packet } from "../../enums"; 5 | import { Vector3f } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.ChangeDimension) 10 | class ChangeDimensionPacket extends DataPacket { 11 | @Serialize(ZigZag) public dimension!: DimensionType; 12 | @Serialize(Vector3f) public position!: Vector3f; 13 | @Serialize(Bool) public respawn!: boolean; 14 | @Serialize(Bool) public hasLoadingScreen!: boolean; 15 | } 16 | 17 | export { ChangeDimensionPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/chunk-radius-update.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ChunkRadiusUpdate) 9 | class ChunkRadiusUpdatePacket extends DataPacket { 10 | @Serialize(ZigZag) public radius!: number; 11 | } 12 | 13 | export { ChunkRadiusUpdatePacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/client-cache-status.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from "@serenityjs/binarystream"; 2 | import { Serialize, Proto } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ClientCacheStatus) 9 | class ClientCacheStatusPacket extends DataPacket { 10 | @Serialize(Bool) public enabled!: boolean; 11 | } 12 | 13 | export { ClientCacheStatusPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/client-to-server-handshake.ts: -------------------------------------------------------------------------------- 1 | import { Proto } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | 5 | import { DataPacket } from "./data-packet"; 6 | 7 | @Proto(Packet.ClientToServerHandshake) 8 | class ClientToServerHandshakePacket extends DataPacket {} 9 | 10 | export { ClientToServerHandshakePacket }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/clientbound-close-form.ts: -------------------------------------------------------------------------------- 1 | import { Proto } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | 5 | import { DataPacket } from "./data-packet"; 6 | 7 | @Proto(Packet.ClientboundCloseForm) 8 | class ClientboundCloseFormPacket extends DataPacket {} 9 | 10 | export { ClientboundCloseFormPacket }; 11 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/command-output.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { CommandOutputData } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.CommandOutput) 9 | class CommandOutputPacket extends DataPacket { 10 | @Serialize(CommandOutputData) public originData!: CommandOutputData; 11 | } 12 | 13 | export { CommandOutputPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/command-request.ts: -------------------------------------------------------------------------------- 1 | import { Bool, VarInt, VarString } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { CommandOriginData } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.CommandRequest) 10 | class CommandRequestPacket extends DataPacket { 11 | @Serialize(VarString) public command!: string; 12 | @Serialize(CommandOriginData) public origin!: CommandOriginData; 13 | @Serialize(Bool) public isInternal!: boolean; 14 | @Serialize(VarInt) public version!: number; 15 | } 16 | 17 | export { CommandRequestPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/completed-using-item.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Endianness, Int32, Short } from "@serenityjs/binarystream"; 3 | 4 | import { type ItemUseMethod, Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.CompletedUsingItem) 9 | class CompletedUsingItemPacket extends DataPacket { 10 | @Serialize(Short, Endianness.Little) 11 | public itemNetworkId!: number; 12 | 13 | @Serialize(Int32, Endianness.Little) 14 | public useMethod!: ItemUseMethod; 15 | } 16 | 17 | export { CompletedUsingItemPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/container-close.ts: -------------------------------------------------------------------------------- 1 | import { Int8, Bool } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type ContainerId, type ContainerType } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ContainerClose) 9 | class ContainerClosePacket extends DataPacket { 10 | @Serialize(Int8) public identifier!: ContainerId; 11 | @Serialize(Int8) public type!: ContainerType; 12 | @Serialize(Bool) public serverInitiated!: boolean; 13 | } 14 | 15 | export { ContainerClosePacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/container-open.ts: -------------------------------------------------------------------------------- 1 | import { Int8, ZigZong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type ContainerId, type ContainerType } from "../../enums"; 5 | import { BlockPosition } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.ContainerOpen) 10 | class ContainerOpenPacket extends DataPacket { 11 | @Serialize(Int8) public identifier!: ContainerId; 12 | @Serialize(Int8) public type!: ContainerType; 13 | @Serialize(BlockPosition) public position!: BlockPosition; 14 | @Serialize(ZigZong) public uniqueId!: bigint; 15 | } 16 | 17 | export { ContainerOpenPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/container-set-data.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Int8, ZigZag } from "@serenityjs/binarystream"; 3 | 4 | import { type ContainerDataType, type ContainerId, Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ContainerSetData) 9 | class ContainerSetDataPacket extends DataPacket { 10 | @Serialize(Int8) public containerId!: ContainerId; 11 | @Serialize(ZigZag) public type!: ContainerDataType; 12 | @Serialize(ZigZag) public value!: number; 13 | } 14 | 15 | export { ContainerSetDataPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/creative-content.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { CreativeGroup, CreativeItem } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.CreativeContent) 9 | class CreativeContentPacket extends DataPacket { 10 | /** 11 | * The groups that are displayed within the creative inventory menu. 12 | */ 13 | @Serialize(CreativeGroup) 14 | public groups!: Array; 15 | 16 | /** 17 | * The items that are displayed within the creative inventory menu, grouped by their category. 18 | */ 19 | @Serialize(CreativeItem) 20 | public items!: Array; 21 | } 22 | 23 | export { CreativeContentPacket }; 24 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/current-structure-feature.ts: -------------------------------------------------------------------------------- 1 | import { VarString } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.CurrentStructureFeature) 9 | class CurrectStructureFeaturePacket extends DataPacket { 10 | @Serialize(VarString) public featureId!: string; 11 | } 12 | 13 | export { CurrectStructureFeaturePacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/data-packet.ts: -------------------------------------------------------------------------------- 1 | import { BasePacket } from "@serenityjs/raknet"; 2 | import { VarInt } from "@serenityjs/binarystream"; 3 | 4 | import type { Packet } from "../../enums"; 5 | 6 | /** 7 | * Represents a Minecraft Bedrock Edition data packet 8 | */ 9 | abstract class DataPacket extends BasePacket { 10 | public static readonly id: Packet; 11 | 12 | public static readonly id_type = VarInt; 13 | 14 | public serialize(): Buffer { 15 | throw new Error("DataPacket.serialize() is not implemented"); 16 | } 17 | 18 | public deserialize(): this { 19 | throw new Error("DataPacket.deserialize() is not implemented"); 20 | } 21 | } 22 | 23 | export { DataPacket }; 24 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/death-info.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { VarString } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { DeathParameters } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.DeathInfo) 10 | class DeathInfoPacket extends DataPacket { 11 | @Serialize(VarString) public cause!: string; 12 | @Serialize(DeathParameters) public deathParameters!: Array; 13 | } 14 | 15 | export { DeathInfoPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/debug-info.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { VarString, ZigZong } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.DebugInfo) 9 | class DebugInfoPacket extends DataPacket { 10 | @Serialize(ZigZong) public actorUniqueId!: bigint; 11 | @Serialize(VarString) public data!: string; 12 | } 13 | 14 | export { DebugInfoPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/dimension-data.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { DimensionDefinitionGroup } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.DimensionData) 9 | class DimensionDataPacket extends DataPacket { 10 | @Serialize(DimensionDefinitionGroup) 11 | public definitionGroup!: DimensionDefinitionGroup; 12 | } 13 | 14 | export { DimensionDataPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/disconnect.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag, Bool } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type DisconnectReason } from "../../enums"; 5 | import { DisconnectMessage } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.Disconnect) 10 | class DisconnectPacket extends DataPacket { 11 | @Serialize(ZigZag) public reason!: DisconnectReason; 12 | @Serialize(Bool) public hideDisconnectScreen!: boolean; 13 | @Serialize(DisconnectMessage, 0, "hideDisconnectScreen") 14 | public message!: DisconnectMessage; 15 | } 16 | 17 | export { DisconnectPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/emote-list.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { VarLong } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { Emotes } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.EmoteList) 10 | class EmoteListPacket extends DataPacket { 11 | @Serialize(VarLong) public runtimeId!: bigint; 12 | @Serialize(Emotes) public emoteIds!: Array; 13 | } 14 | 15 | export { EmoteListPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/emote.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Byte, VarInt, VarString, VarLong } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | import type { EmoteFlags } from "../../enums/emote-flag"; 9 | 10 | @Proto(Packet.Emote) 11 | class EmotePacket extends DataPacket { 12 | @Serialize(VarLong) public actorRuntimeId!: bigint; 13 | @Serialize(VarString) public emoteId!: string; 14 | @Serialize(VarInt) public tickLength!: number; 15 | @Serialize(VarString) public xuid!: string; 16 | @Serialize(VarString) public platformChatId!: string; 17 | @Serialize(Byte) public flags!: EmoteFlags; 18 | } 19 | 20 | export { EmotePacket }; 21 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/entity-pick-request.ts: -------------------------------------------------------------------------------- 1 | import { Bool, Endianness, Uint64, Uint8 } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.EntityPickRequest) 9 | class EntityPickRequestPacket extends DataPacket { 10 | @Serialize(Uint64, Endianness.Little) public uniqueActorId!: bigint; // lu64 11 | @Serialize(Uint8) public slot!: number; //u8 12 | @Serialize(Bool) public withData!: boolean; 13 | } 14 | 15 | export { EntityPickRequestPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/game-rules-changed.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { GameRules } from "../types"; 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.GameRulesChanged) 9 | class GameRulesChangedPacket extends DataPacket { 10 | @Serialize(GameRules) public rules!: GameRules; 11 | } 12 | 13 | export { GameRulesChangedPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/hurt-armor.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { ZigZag, ZigZong } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.HurtArmor) 9 | class HurtArmorPacket extends DataPacket { 10 | @Serialize(ZigZag) public cause!: number; 11 | @Serialize(ZigZag) public damage!: number; 12 | @Serialize(ZigZong) public slots!: number; 13 | } 14 | 15 | export { HurtArmorPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/interact.ts: -------------------------------------------------------------------------------- 1 | import { Uint8, Endianness, VarLong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type InteractAction, Packet } from "../../enums"; 5 | import { InteractPosition, type Vector3f } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.Interact) 10 | class InteractPacket extends DataPacket { 11 | @Serialize(Uint8) public action!: InteractAction; 12 | @Serialize(VarLong) public actorRuntimeId!: bigint; 13 | @Serialize(InteractPosition, Endianness.Big, "action") 14 | public position!: Vector3f; 15 | } 16 | 17 | export { InteractPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/inventory-transaction.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { InventoryTransaction, LegacyTransaction } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.InventoryTransaction) 9 | class InventoryTransactionPacket extends DataPacket { 10 | @Serialize(LegacyTransaction) public legacy!: LegacyTransaction; 11 | @Serialize(InventoryTransaction) public transaction!: InventoryTransaction; 12 | } 13 | 14 | export { InventoryTransactionPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/item-registry.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { ItemData } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ItemRegistry) 9 | class ItemRegistryPacket extends DataPacket { 10 | /** 11 | * The item type definitions that are registered within the item registry. 12 | */ 13 | @Serialize(ItemData) public definitions!: Array; 14 | } 15 | 16 | export { ItemRegistryPacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/item-stack-request.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { ItemStackRequest } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ItemStackRequest) 9 | class ItemStackRequestPacket extends DataPacket { 10 | @Serialize(ItemStackRequest) public requests!: Array; 11 | } 12 | 13 | export { ItemStackRequestPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/item-stack-response.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { ItemStackResponses } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ItemStackResponse) 9 | class ItemStackResponsePacket extends DataPacket { 10 | @Serialize(ItemStackResponses) public responses!: Array; 11 | } 12 | 13 | export { ItemStackResponsePacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/level-event-generic.ts: -------------------------------------------------------------------------------- 1 | import { VarInt } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { NbtLoop } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.LevelEventGeneric) 10 | class LevelEventGenericPacket extends DataPacket { 11 | @Serialize(VarInt) public eventId!: number; 12 | @Serialize(NbtLoop) public nbtData!: NbtLoop; 13 | } 14 | 15 | export { LevelEventGenericPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/level-event.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type LevelEvent, Packet } from "../../enums"; 5 | import { Vector3f } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.LevelEvent) 10 | class LevelEventPacket extends DataPacket { 11 | @Serialize(ZigZag) public event!: LevelEvent; 12 | @Serialize(Vector3f) public position!: Vector3f; 13 | @Serialize(ZigZag) public data!: number; 14 | } 15 | 16 | export { LevelEventPacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/login.ts: -------------------------------------------------------------------------------- 1 | import { Int32 } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { LoginTokens } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.Login) 10 | class LoginPacket extends DataPacket { 11 | @Serialize(Int32) public protocol!: number; 12 | @Serialize(LoginTokens) public tokens!: LoginTokens; 13 | } 14 | 15 | export { LoginPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/map-info-request.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { ZigZong } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { MapPixel } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.MapInfoRequest) 10 | class MapInfoRequestPacket extends DataPacket { 11 | @Serialize(ZigZong) 12 | public mapId!: bigint; 13 | 14 | @Serialize(MapPixel) 15 | public mapPixels!: Array; 16 | } 17 | 18 | export { MapInfoRequestPacket }; 19 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/mob-equipment.ts: -------------------------------------------------------------------------------- 1 | import { Int8, Uint8, VarLong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type ContainerId, Packet } from "../../enums"; 5 | import { NetworkItemStackDescriptor } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.MobEquipment) 10 | class MobEquipmentPacket extends DataPacket { 11 | @Serialize(VarLong) public runtimeEntityId!: bigint; 12 | @Serialize(NetworkItemStackDescriptor) 13 | public item!: NetworkItemStackDescriptor; 14 | 15 | @Serialize(Uint8) public slot!: number; 16 | @Serialize(Uint8) public selectedSlot!: number; 17 | @Serialize(Int8) public containerId!: ContainerId; 18 | } 19 | 20 | export { MobEquipmentPacket }; 21 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/modal-form-request.ts: -------------------------------------------------------------------------------- 1 | import { VarInt, VarString } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ModalFormRequest) 9 | class ModalFormRequestPacket extends DataPacket { 10 | @Serialize(VarInt) public id!: number; 11 | @Serialize(VarString) public payload!: string; 12 | } 13 | 14 | export { ModalFormRequestPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/motion-prediction-hints.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { VarLong, Bool } from "@serenityjs/binarystream"; 3 | 4 | import { DataPacket, Packet } from "../.."; 5 | import { Vector3f } from "../types"; 6 | 7 | @Proto(Packet.MotionPredictHints) 8 | export class MotionPredictHintsPacket extends DataPacket { 9 | @Serialize(VarLong) public hints!: bigint; 10 | @Serialize(Vector3f) public position!: Vector3f; 11 | @Serialize(Bool) public onGround!: boolean; 12 | } 13 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/move-actor-absolute.ts: -------------------------------------------------------------------------------- 1 | import { Uint8, VarLong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { Rotation, Vector3f } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.MoveActorAbsolute) 10 | class MoveActorAbsolutePacket extends DataPacket { 11 | @Serialize(VarLong) public runtimeId!: bigint; 12 | @Serialize(Uint8) public flags!: number; 13 | @Serialize(Vector3f) public position!: Vector3f; 14 | @Serialize(Rotation) public rotation!: Rotation; 15 | } 16 | 17 | export { MoveActorAbsolutePacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/movement-effect.ts: -------------------------------------------------------------------------------- 1 | import { VarInt, VarLong } from "@serenityjs/binarystream"; 2 | import { Serialize, Proto } from "@serenityjs/raknet"; 3 | 4 | import { MovementEffectType, Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.MovementEffect) 9 | class MovementEffectPacket extends DataPacket { 10 | @Serialize(VarLong) public runtimeId!: bigint; 11 | @Serialize(VarInt) public type!: MovementEffectType; 12 | @Serialize(VarInt) public duration!: number; 13 | @Serialize(VarLong) public inputTick!: bigint; 14 | } 15 | 16 | export { MovementEffectPacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/network-chunk-publisher-update.ts: -------------------------------------------------------------------------------- 1 | import { VarInt } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { BlockPosition, ChunkCoords } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.NetworkChunkPublisherUpdate) 10 | class NetworkChunkPublisherUpdatePacket extends DataPacket { 11 | @Serialize(BlockPosition) public coordinate!: BlockPosition; 12 | @Serialize(VarInt) public radius!: number; 13 | @Serialize(ChunkCoords) public savedChunks!: Array; 14 | } 15 | 16 | export { NetworkChunkPublisherUpdatePacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/network-stack-latency.ts: -------------------------------------------------------------------------------- 1 | import { Bool, Endianness, Uint64 } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.NetworkStackLatency) 9 | class NetworkStackLatencyPacket extends DataPacket { 10 | @Serialize(Uint64, Endianness.Little) public timestamp!: bigint; 11 | @Serialize(Bool) public fromServer!: boolean; 12 | } 13 | 14 | export { NetworkStackLatencyPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/npc-request.ts: -------------------------------------------------------------------------------- 1 | import { VarLong, VarString, Uint8 } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type NpcRequestType, Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.NpcRequest) 9 | class NpcRequestPacket extends DataPacket { 10 | @Serialize(VarLong) public runtimeActorId!: bigint; 11 | @Serialize(Uint8) public type!: NpcRequestType; 12 | @Serialize(VarString) public actions!: string; 13 | @Serialize(Uint8) public index!: number; 14 | @Serialize(VarString) public scene!: string; 15 | } 16 | 17 | export { NpcRequestPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/on-screen-texture-animation.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Endianness, Uint32 } from "@serenityjs/binarystream"; 3 | 4 | import { type EffectType, Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.OnScreenTextureAnimation) 9 | class OnScreenTextureAnimationPacket extends DataPacket { 10 | @Serialize(Uint32, Endianness.Little) public effectId!: EffectType; 11 | } 12 | 13 | export { OnScreenTextureAnimationPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/open-sign.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Bool } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { BlockPosition } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.OpenSign) 10 | class OpenSignPacket extends DataPacket { 11 | @Serialize(BlockPosition) 12 | public position!: BlockPosition; 13 | 14 | @Serialize(Bool) 15 | public isFrontSide!: boolean; 16 | } 17 | 18 | export { OpenSignPacket }; 19 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/packet-violation-warning.ts: -------------------------------------------------------------------------------- 1 | import { VarString, ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { 5 | Packet, 6 | type ViolationSeverity, 7 | type ViolationType 8 | } from "../../enums"; 9 | 10 | import { DataPacket } from "./data-packet"; 11 | 12 | @Proto(Packet.PacketViolationWarning) 13 | class PacketViolationWarningPacket extends DataPacket { 14 | @Serialize(ZigZag) public type!: ViolationType; 15 | @Serialize(ZigZag) public severity!: ViolationSeverity; 16 | @Serialize(ZigZag) public packet!: Packet; 17 | @Serialize(VarString) public context!: string; 18 | } 19 | 20 | export { PacketViolationWarningPacket }; 21 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/play-sound.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Endianness, Float32, VarString } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { BlockPosition } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.PlaySound) 10 | class PlaySoundPacket extends DataPacket { 11 | @Serialize(VarString) public name!: string; 12 | @Serialize(BlockPosition) public position!: BlockPosition; 13 | @Serialize(Float32, Endianness.Little) public volume!: number; 14 | @Serialize(Float32, Endianness.Little) public pitch!: number; 15 | } 16 | 17 | export { PlaySoundPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/play-status.ts: -------------------------------------------------------------------------------- 1 | import { Int32 } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type PlayStatus } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.PlayStatus) 9 | class PlayStatusPacket extends DataPacket { 10 | @Serialize(Int32) public status!: PlayStatus; 11 | } 12 | 13 | export { PlayStatusPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/player-action.ts: -------------------------------------------------------------------------------- 1 | import { VarLong, ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type PlayerActionType, Packet } from "../../enums"; 5 | import { BlockPosition } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.PlayerAction) 10 | class PlayerActionPacket extends DataPacket { 11 | @Serialize(VarLong) public entityRuntimeId!: bigint; 12 | @Serialize(ZigZag) public action!: PlayerActionType; 13 | @Serialize(BlockPosition) public blockPosition!: BlockPosition; 14 | @Serialize(BlockPosition) public resultPosition!: BlockPosition; 15 | @Serialize(ZigZag) public face!: number; 16 | } 17 | 18 | export { PlayerActionPacket }; 19 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/player-enchant-options.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { EnchantOption } from "../types/enchant-option"; 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.PlayerEnchantOptions) 9 | class PlayerEnchantOptionsPacket extends DataPacket { 10 | @Serialize(EnchantOption) public enchantOptions!: Array; 11 | } 12 | 13 | export { PlayerEnchantOptionsPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/player-fog.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Fogs } from "../types"; 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.PlayerFog) 9 | class PlayerFogPacket extends DataPacket { 10 | @Serialize(Fogs) public fogs!: Fogs; 11 | } 12 | 13 | export { PlayerFogPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/player-hotbar.ts: -------------------------------------------------------------------------------- 1 | import { Int8, VarInt, Bool } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.PlayerHotbar) 9 | class PlayerHotbarPacket extends DataPacket { 10 | @Serialize(VarInt) public selectedSlot!: number; 11 | @Serialize(Int8) public windowId!: number; 12 | @Serialize(Bool) public selectSlot!: boolean; 13 | } 14 | 15 | export { PlayerHotbarPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/player-list.ts: -------------------------------------------------------------------------------- 1 | import { Endianness, Uint8 } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type PlayerListAction } from "../../enums"; 5 | import { PlayerListRecord } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.PlayerList) 10 | class PlayerListPacket extends DataPacket { 11 | @Serialize(Uint8) public action!: PlayerListAction; 12 | @Serialize(PlayerListRecord, Endianness.Little, "action") 13 | public records!: Array; 14 | } 15 | 16 | export { PlayerListPacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/player-skin.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Uuid, VarString, Bool } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { SerializedSkin } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.PlayerSkin) 10 | class PlayerSkinPacket extends DataPacket { 11 | @Serialize(Uuid) public uuid!: string; 12 | @Serialize(SerializedSkin) public skin!: SerializedSkin; 13 | @Serialize(VarString) public skinName!: string; 14 | @Serialize(VarString) public oldSkinName!: string; 15 | @Serialize(Bool) public isVerified!: boolean; 16 | } 17 | 18 | export { PlayerSkinPacket }; 19 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/player-start-item-cooldown.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { VarInt, VarString } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.PlayerStartItemCooldown) 9 | class PlayerStartItemCooldownPacket extends DataPacket { 10 | @Serialize(VarString) 11 | public category!: string; 12 | 13 | @Serialize(VarInt) 14 | public duration!: number; 15 | } 16 | 17 | export { PlayerStartItemCooldownPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/remove-entity.ts: -------------------------------------------------------------------------------- 1 | import { ZigZong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.RemoveEntity) 9 | class RemoveEntityPacket extends DataPacket { 10 | @Serialize(ZigZong) public uniqueEntityId!: bigint; 11 | } 12 | 13 | export { RemoveEntityPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/remove-objective.ts: -------------------------------------------------------------------------------- 1 | import { VarString } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.RemoveObjective) 9 | class RemoveObjectivePacket extends DataPacket { 10 | @Serialize(VarString) public objectiveName!: string; 11 | } 12 | 13 | export { RemoveObjectivePacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/request-chunk-radius.ts: -------------------------------------------------------------------------------- 1 | import { Uint8, ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.RequestChunkRadius) 9 | class RequestChunkRadiusPacket extends DataPacket { 10 | @Serialize(ZigZag) public radius!: number; 11 | @Serialize(Uint8) public maxRadius!: number; 12 | } 13 | 14 | export { RequestChunkRadiusPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/request-network-settings.ts: -------------------------------------------------------------------------------- 1 | import { Int32 } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.RequestNetworkSettings) 9 | class RequestNetworkSettingsPacket extends DataPacket { 10 | @Serialize(Int32) public protocol!: number; 11 | } 12 | 13 | export { RequestNetworkSettingsPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/resource-pack-chunk-request.ts: -------------------------------------------------------------------------------- 1 | import { Endianness, Uint32, VarString } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ResourcePackChunkRequest) 9 | class ResourcePackChunkRequestPacket extends DataPacket { 10 | @Serialize(VarString) public packId!: string; 11 | @Serialize(Uint32, Endianness.Little) public chunkId!: number; 12 | } 13 | 14 | export { ResourcePackChunkRequestPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/resource-pack-client-response.ts: -------------------------------------------------------------------------------- 1 | import { Uint8 } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type ResourcePackResponse } from "../../enums"; 5 | import { ResourcePackIds } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.ResourcePackClientResponse) 10 | class ResourcePackClientResponsePacket extends DataPacket { 11 | @Serialize(Uint8) public response!: ResourcePackResponse; 12 | @Serialize(ResourcePackIds) public packs!: Array; 13 | } 14 | 15 | export { ResourcePackClientResponsePacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/respawn.ts: -------------------------------------------------------------------------------- 1 | import { Uint8, VarLong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type RespawnState } from "../../enums"; 5 | import { Vector3f } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.Respawn) 10 | class RespawnPacket extends DataPacket { 11 | @Serialize(Vector3f) public position!: Vector3f; 12 | @Serialize(Uint8) public state!: RespawnState; 13 | @Serialize(VarLong) public runtimeEntityId!: bigint; 14 | } 15 | 16 | export { RespawnPacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/rider-jump.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.RiderJump) 9 | class RiderJumpPacket extends DataPacket { 10 | @Serialize(ZigZag) public strength!: number; 11 | } 12 | 13 | export { RiderJumpPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/script-message.ts: -------------------------------------------------------------------------------- 1 | import { VarString } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ScriptMessage) 9 | class ScriptMessagePacket extends DataPacket { 10 | @Serialize(VarString) public messageId!: string; 11 | @Serialize(VarString) public data!: string; 12 | } 13 | 14 | export { ScriptMessagePacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/server-bound-loading-screen.ts: -------------------------------------------------------------------------------- 1 | import { Bool, ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type ServerboundLoadingScreenType } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ServerboundLoadingScreenPacket) 9 | class ServerboundLoadingScreenPacketPacket extends DataPacket { 10 | @Serialize(ZigZag) public type!: ServerboundLoadingScreenType; 11 | @Serialize(Bool) public hasScreenId!: boolean; // TODO: Implement the screen ID 12 | } 13 | 14 | export { ServerboundLoadingScreenPacketPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/server-settings-response.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { VarInt, VarString } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ServerSettingsResponse) 9 | class ServerSettingsResponsePacket extends DataPacket { 10 | @Serialize(VarInt) public formId!: number; 11 | @Serialize(VarString) public payload!: string; 12 | } 13 | 14 | export { ServerSettingsResponsePacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/server-to-client-handshake.ts: -------------------------------------------------------------------------------- 1 | import { VarString } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ServerToClientHandshake) 9 | class ServerToClientHandshakePacket extends DataPacket { 10 | @Serialize(VarString) public token!: string; 11 | } 12 | 13 | export { ServerToClientHandshakePacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-actor-link.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Packet } from "../../enums"; 4 | import { ActorLink } from "../types"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.SetActorLink) 9 | class SetActorLinkPacket extends DataPacket { 10 | @Serialize(ActorLink) 11 | public link!: ActorLink; 12 | } 13 | 14 | export { SetActorLinkPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-actor-motion.ts: -------------------------------------------------------------------------------- 1 | import { VarLong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { PlayerInputTick, Vector3f } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.SetActorMotion) 10 | class SetActorMotionPacket extends DataPacket { 11 | @Serialize(VarLong) public runtimeId!: bigint; 12 | @Serialize(Vector3f) public motion!: Vector3f; 13 | @Serialize(PlayerInputTick) public inputTick!: bigint; 14 | } 15 | 16 | export { SetActorMotionPacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-commands-enabled.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.SetCommandsEnabled) 9 | class SetCommandsEnabledPacket extends DataPacket { 10 | @Serialize(Bool) public enabled!: boolean; 11 | } 12 | 13 | export { SetCommandsEnabledPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-default-gamemode.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag } from "@serenityjs/binarystream"; 2 | import { Serialize, Proto } from "@serenityjs/raknet"; 3 | 4 | import { DataPacket } from "../.."; 5 | import { Gamemode, Packet } from "../../enums"; 6 | 7 | @Proto(Packet.SetDefaultGamemode) 8 | export class SetDefaultGamemodePacket extends DataPacket { 9 | @Serialize(ZigZag) public gamemode!: Gamemode; 10 | } 11 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-difficulty.ts: -------------------------------------------------------------------------------- 1 | import { VarInt } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Difficulty, Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.SetDifficulty) 9 | class SetDifficultyPacket extends DataPacket { 10 | @Serialize(VarInt) public difficulty!: Difficulty; 11 | } 12 | 13 | export { SetDifficultyPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-display-objective.ts: -------------------------------------------------------------------------------- 1 | import { VarString, ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { 5 | Packet, 6 | type DisplaySlotType, 7 | type ObjectiveSortOrder 8 | } from "../../enums"; 9 | 10 | import { DataPacket } from "./data-packet"; 11 | 12 | @Proto(Packet.SetDisplayObjective) 13 | class SetDisplayObjectivePacket extends DataPacket { 14 | @Serialize(VarString) public displaySlot!: DisplaySlotType; 15 | @Serialize(VarString) public objectiveName!: string; 16 | @Serialize(VarString) public displayName!: string; 17 | @Serialize(VarString) public criteriaName!: string; 18 | @Serialize(ZigZag) public sortOrder!: ObjectiveSortOrder; 19 | } 20 | 21 | export { SetDisplayObjectivePacket }; 22 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-health.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.SetHealth) 9 | class SetHealthPacket extends DataPacket { 10 | @Serialize(ZigZag) public health!: number; 11 | } 12 | 13 | export { SetHealthPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-hud.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { ZigZag } from "@serenityjs/binarystream"; 3 | 4 | import { Packet, type HudVisibility } from "../../enums"; 5 | import { HudElementData } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.SetHud) 10 | class SetHudPacket extends DataPacket { 11 | @Serialize(HudElementData) public elements!: Array; 12 | @Serialize(ZigZag) public visibility!: HudVisibility; 13 | } 14 | 15 | export { SetHudPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-last-hurt-by.ts: -------------------------------------------------------------------------------- 1 | import { VarInt } from "@serenityjs/binarystream"; 2 | import { Serialize, Proto } from "@serenityjs/raknet"; 3 | 4 | import { DataPacket } from "../.."; 5 | import { Packet } from "../../enums"; 6 | 7 | @Proto(Packet.SetLastHurtBy) 8 | export class SetLastHurtByPacket extends DataPacket { 9 | @Serialize(VarInt) public lastHurtBy!: number; 10 | } 11 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-local-player-as-initialized.ts: -------------------------------------------------------------------------------- 1 | import { VarLong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.SetLocalPlayerAsInitialized) 9 | class SetLocalPlayerAsInitializedPacket extends DataPacket { 10 | @Serialize(VarLong) public runtimeEntityId!: bigint; 11 | } 12 | 13 | export { SetLocalPlayerAsInitializedPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-player-game-type.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { type Gamemode, Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.SetPlayerGameType) 9 | class SetPlayerGameTypePacket extends DataPacket { 10 | @Serialize(ZigZag) public gamemode!: Gamemode; 11 | } 12 | 13 | export { SetPlayerGameTypePacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-score.ts: -------------------------------------------------------------------------------- 1 | import { VarInt } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet, type ScoreboardActionType } from "../../enums"; 5 | import { ScoreEntry } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.SetScore) 10 | class SetScorePacket extends DataPacket { 11 | @Serialize(VarInt) public type!: ScoreboardActionType; 12 | @Serialize(ScoreEntry, 0, "type") public entries!: Array; 13 | } 14 | 15 | export { SetScorePacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-scoreboard-identity.ts: -------------------------------------------------------------------------------- 1 | import { VarInt } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { ScoreboardIdentity } from "../types/scoreboard-identity"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | import type { ScoreboardIdentityAction } from "../../enums/scoreboard-identity-action"; 10 | 11 | @Proto(Packet.SetScoreboardIdentity) 12 | class SetScoreboardIdentityPacket extends DataPacket { 13 | @Serialize(VarInt) public action!: ScoreboardIdentityAction; 14 | @Serialize(ScoreboardIdentity) public entries!: ScoreboardIdentity; 15 | } 16 | 17 | export { SetScoreboardIdentityPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-spawn-position.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { ZigZag } from "@serenityjs/binarystream"; 3 | 4 | import { BlockPosition } from "../types"; 5 | import { Packet, SpawnType } from "../../enums"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.SetSpawnPosition) 10 | class SetSpawnPositionPacket extends DataPacket { 11 | @Serialize(ZigZag) public spawnType!: SpawnType; 12 | @Serialize(BlockPosition) public playerPosition!: BlockPosition; 13 | @Serialize(ZigZag) public dimension!: number; 14 | @Serialize(BlockPosition) public worldPosition!: BlockPosition; 15 | } 16 | 17 | export { SetSpawnPositionPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/set-time.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.SetTime) 9 | class SetTimePacket extends DataPacket { 10 | @Serialize(ZigZag) public time!: number; 11 | } 12 | 13 | export { SetTimePacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/show-credits.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Byte, VarLong } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ShowCredits) 9 | class ShowCreditsPacket extends DataPacket { 10 | @Serialize(VarLong) 11 | public playerRuntimeId!: bigint; 12 | 13 | @Serialize(Byte) 14 | public creditsState!: number; 15 | } 16 | 17 | export { ShowCreditsPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/show-profile.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { VarString } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ShowProfile) 9 | class ShowProfilePacket extends DataPacket { 10 | @Serialize(VarString) public xuid!: string; 11 | } 12 | 13 | export { ShowProfilePacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/stop-sound.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Bool, VarString } from "@serenityjs/binarystream"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.StopSound) 9 | class StopSoundPacket extends DataPacket { 10 | @Serialize(VarString) 11 | public soundName!: string; 12 | 13 | @Serialize(Bool) 14 | public stopAllSounds!: boolean; 15 | 16 | @Serialize(Bool) 17 | // Legacy 18 | public stopMusic!: boolean; 19 | } 20 | 21 | export { StopSoundPacket }; 22 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/structure-block-update.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { Bool } from "@serenityjs/binarystream"; 3 | 4 | import { BlockPosition, StructureEditorData } from "../types"; 5 | import { Packet } from "../../enums"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.StructureBlockUpdate) 10 | class StructureBlockUpdatePacket extends DataPacket { 11 | @Serialize(BlockPosition) 12 | public blockPosition!: BlockPosition; 13 | 14 | @Serialize(StructureEditorData) 15 | public structureEditData!: StructureEditorData; 16 | 17 | @Serialize(Bool) 18 | public trigger!: boolean; 19 | 20 | @Serialize(Bool) 21 | public isWaterLogged!: boolean; 22 | } 23 | 24 | export { StructureBlockUpdatePacket }; 25 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/sync-actor-property.ts: -------------------------------------------------------------------------------- 1 | import { CompoundTag } from "@serenityjs/nbt"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.SyncActorProperty) 9 | class SyncActorPropertyPacket extends DataPacket { 10 | @Serialize(CompoundTag, true) public properties!: CompoundTag; 11 | } 12 | 13 | export { SyncActorPropertyPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/take-item-actor.ts: -------------------------------------------------------------------------------- 1 | import { VarLong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.TakeItemActor) 9 | class TakeItemActorPacket extends DataPacket { 10 | @Serialize(VarLong) public itemRuntimeId!: bigint; 11 | @Serialize(VarLong) public targetRuntimeId!: bigint; 12 | } 13 | 14 | export { TakeItemActorPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/toast-request.ts: -------------------------------------------------------------------------------- 1 | import { VarString } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.ToastRequest) 9 | class ToastRequestPacket extends DataPacket { 10 | @Serialize(VarString) public title!: string; 11 | @Serialize(VarString) public message!: string; 12 | } 13 | 14 | export { ToastRequestPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/transfer.ts: -------------------------------------------------------------------------------- 1 | import { VarString, Uint16, Endianness, Bool } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.Transfer) 9 | class TransferPacket extends DataPacket { 10 | @Serialize(VarString) public address!: string; 11 | @Serialize(Uint16, Endianness.Little) public port!: number; 12 | @Serialize(Bool) public reloadWorld!: boolean; 13 | } 14 | 15 | export { TransferPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/trim-data.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { Patterns, Materials } from "../types"; 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.TrimData) 9 | class TrimDataPacket extends DataPacket { 10 | @Serialize(Patterns) public patterns!: Patterns; 11 | @Serialize(Materials) public materials!: Materials; 12 | } 13 | 14 | export { TrimDataPacket }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/unlocked-recipes.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | 3 | import { UnlockedRecipesEntry } from "../types"; 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.UnlockedRecipes) 9 | class UnlockedRecipesPacket extends DataPacket { 10 | @Serialize(UnlockedRecipesEntry) public recipes!: UnlockedRecipesEntry; 11 | } 12 | 13 | export { UnlockedRecipesPacket }; 14 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/update-adventure-settings.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | 6 | import { DataPacket } from "./data-packet"; 7 | 8 | @Proto(Packet.UpdateAdventureSettings) 9 | class UpdateAdventureSettingsPacket extends DataPacket { 10 | @Serialize(Bool) public noPvm!: boolean; 11 | @Serialize(Bool) public noPvp!: boolean; 12 | @Serialize(Bool) public immutableWorld!: boolean; 13 | @Serialize(Bool) public showNameTags!: boolean; 14 | @Serialize(Bool) public autoJump!: boolean; 15 | } 16 | 17 | export { UpdateAdventureSettingsPacket }; 18 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/update-attributes.ts: -------------------------------------------------------------------------------- 1 | import { VarLong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { Attribute, PlayerInputTick } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.UpdateAttributes) 10 | class UpdateAttributesPacket extends DataPacket { 11 | @Serialize(VarLong) public runtimeActorId!: bigint; 12 | @Serialize(Attribute) public attributes!: Array; 13 | @Serialize(PlayerInputTick) public inputTick!: bigint; 14 | } 15 | 16 | export { UpdateAttributesPacket }; 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/update-block.ts: -------------------------------------------------------------------------------- 1 | import { VarInt } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { 5 | Packet, 6 | type UpdateBlockFlagsType, 7 | type UpdateBlockLayerType 8 | } from "../../enums"; 9 | import { BlockPosition } from "../types"; 10 | 11 | import { DataPacket } from "./data-packet"; 12 | 13 | @Proto(Packet.UpdateBlock) 14 | class UpdateBlockPacket extends DataPacket { 15 | @Serialize(BlockPosition) public position!: BlockPosition; 16 | @Serialize(VarInt) public networkBlockId!: number; 17 | @Serialize(VarInt) public flags!: UpdateBlockFlagsType; 18 | @Serialize(VarInt) public layer!: UpdateBlockLayerType; 19 | } 20 | 21 | export { UpdateBlockPacket }; 22 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/update-client-input-locks.ts: -------------------------------------------------------------------------------- 1 | import { VarInt } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { ClientInputLocksFlag, Packet } from "../../enums"; 5 | import { Vector3f } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.UpdateClientInputLocks) 10 | class UpdateClientInputLocksPacket extends DataPacket { 11 | @Serialize(VarInt) public flags!: ClientInputLocksFlag; 12 | @Serialize(Vector3f) public position!: Vector3f; 13 | } 14 | 15 | export { UpdateClientInputLocksPacket }; 16 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/update-player-game-type.ts: -------------------------------------------------------------------------------- 1 | import { ZigZag, ZigZong } from "@serenityjs/binarystream"; 2 | import { Proto, Serialize } from "@serenityjs/raknet"; 3 | 4 | import { Packet } from "../../enums"; 5 | import { PlayerInputTick } from "../types"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.UpdatePlayerGameType) 10 | export class UpdatePlayerGameTypePacket extends DataPacket { 11 | @Serialize(ZigZag) public gamemode!: number; 12 | @Serialize(ZigZong) public uniqueActorId!: bigint; 13 | @Serialize(PlayerInputTick) public inputTick!: PlayerInputTick; 14 | } 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/data/update-subchunk-blocks.ts: -------------------------------------------------------------------------------- 1 | import { Proto, Serialize } from "@serenityjs/raknet"; 2 | import { ZigZag } from "@serenityjs/binarystream"; 3 | 4 | import { SubchunkBlocks } from "../types"; 5 | import { Packet } from "../../enums"; 6 | 7 | import { DataPacket } from "./data-packet"; 8 | 9 | @Proto(Packet.UpdateSubchunkBlocks) 10 | export class UpdateSubchunkBlocksPacket extends DataPacket { 11 | @Serialize(ZigZag) public x!: number; 12 | @Serialize(ZigZag) public y!: number; 13 | @Serialize(ZigZag) public z!: number; 14 | @Serialize(SubchunkBlocks) public blocks!: SubchunkBlocks; 15 | @Serialize(SubchunkBlocks) public extra!: SubchunkBlocks; 16 | } 17 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/debug/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./event"; 2 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./data"; 2 | export * from "./types"; 3 | export * from "./debug"; 4 | export * from "./framer"; 5 | export * from "./packet-id"; 6 | export * from "./pool"; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/packet-id.ts: -------------------------------------------------------------------------------- 1 | import { BinaryStream } from "@serenityjs/binarystream"; 2 | 3 | import type { Packet } from "../enums"; 4 | 5 | /** 6 | * Get the packet ID from a buffer. ( VarInt ) 7 | * 8 | * @param buffer 9 | * @returns {number} 10 | */ 11 | function getPacketId(buffer: Buffer): Packet { 12 | // Create a new BinaryStream from the buffer. 13 | const stream = BinaryStream.fromBuffer(buffer); 14 | 15 | // Return the VarInt. 16 | return stream.readVarInt(); 17 | } 18 | 19 | export { getPacketId }; 20 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/types/camera-set-easing.ts: -------------------------------------------------------------------------------- 1 | import { DataType } from "@serenityjs/raknet"; 2 | import { Endianness, type BinaryStream } from "@serenityjs/binarystream"; 3 | 4 | import type { EasingType } from "../../enums"; 5 | 6 | class CameraSetEasing extends DataType { 7 | public type: EasingType; 8 | public duration: number; 9 | 10 | public constructor(type: EasingType, duration: number) { 11 | super(); 12 | this.type = type; 13 | this.duration = duration; 14 | } 15 | 16 | public static write(stream: BinaryStream, value: CameraSetEasing): void { 17 | stream.writeUint8(value.type); 18 | stream.writeFloat32(value.duration, Endianness.Little); 19 | } 20 | } 21 | 22 | export { CameraSetEasing }; 23 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/types/player-input-tick.ts: -------------------------------------------------------------------------------- 1 | import { DataType } from "@serenityjs/raknet"; 2 | 3 | import type { BinaryStream } from "@serenityjs/binarystream"; 4 | 5 | class PlayerInputTick extends DataType { 6 | public static read(stream: BinaryStream): bigint { 7 | // Read a VarLong from the stream 8 | const tick = stream.readVarLong(); 9 | 10 | // Return a new instance of this class with the input tick 11 | return tick; 12 | } 13 | 14 | public static write(stream: BinaryStream, value: bigint): void { 15 | // Write a VarLong to the stream 16 | stream.writeVarLong(value); 17 | } 18 | } 19 | 20 | export { PlayerInputTick }; 21 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/types/rotation-byte.ts: -------------------------------------------------------------------------------- 1 | import { BinaryStream } from "@serenityjs/binarystream"; 2 | import { DataType } from "@serenityjs/raknet"; 3 | 4 | class RotationByte extends DataType { 5 | public static read(stream: BinaryStream): number { 6 | return stream.readInt8() * (360 / 256); 7 | } 8 | 9 | public static write(stream: BinaryStream, value: number): void { 10 | stream.writeInt8(value / (360 / 256)); 11 | } 12 | } 13 | 14 | export { RotationByte }; 15 | -------------------------------------------------------------------------------- /packages/protocol/src/proto/types/texture-update-bits.ts: -------------------------------------------------------------------------------- 1 | import { BinaryStream, Endianness } from "@serenityjs/binarystream"; 2 | import { DataType } from "@serenityjs/raknet"; 3 | 4 | class MapTextureUpdateBits extends DataType { 5 | public static write( 6 | stream: BinaryStream, 7 | value: number | Array, 8 | _: Endianness, 9 | parameter: number 10 | ): void { 11 | if ((parameter & 0x2) == 0x0) return; 12 | if (Array.isArray(value)) { 13 | stream.writeVarInt(value.length); 14 | 15 | for (const bit of value) { 16 | stream.writeVarInt(bit); 17 | } 18 | return; 19 | } 20 | stream.writeZigZag(value); 21 | } 22 | } 23 | 24 | export { MapTextureUpdateBits }; 25 | -------------------------------------------------------------------------------- /packages/protocol/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./login-data"; 2 | export * from "./position"; 3 | export * from "./legacy-telemetry-event-data"; 4 | export * from "./trim-data-pattern"; 5 | export * from "./trim-data-material"; 6 | export * from "./unlocked-recipes-type"; 7 | -------------------------------------------------------------------------------- /packages/protocol/src/types/position.ts: -------------------------------------------------------------------------------- 1 | interface IPosition { 2 | x: number; 3 | y: number; 4 | z: number; 5 | } 6 | 7 | export { IPosition }; 8 | -------------------------------------------------------------------------------- /packages/protocol/src/types/trim-data-material.ts: -------------------------------------------------------------------------------- 1 | export interface TrimDataMaterial { 2 | material: string; 3 | color: string; 4 | item_name: string; 5 | } 6 | -------------------------------------------------------------------------------- /packages/protocol/src/types/trim-data-pattern.ts: -------------------------------------------------------------------------------- 1 | export interface TrimDataPattern { 2 | item_name: string; 3 | pattern: string; 4 | } 5 | -------------------------------------------------------------------------------- /packages/protocol/src/types/unlocked-recipes-type.ts: -------------------------------------------------------------------------------- 1 | export enum UnlockedRecipesType { 2 | EMPTY = 0, 3 | INITIALLY_UNLOCKED = 1, 4 | NEWLY_UNLOCKED = 2, 5 | REMOVED = 3, 6 | REMOVED_ALL = 4 7 | } 8 | -------------------------------------------------------------------------------- /packages/protocol/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/protocol/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options 7 | })); 8 | -------------------------------------------------------------------------------- /packages/protocol/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "./dist", 4 | "readme": "README.md" 5 | } -------------------------------------------------------------------------------- /packages/raknet/README.md: -------------------------------------------------------------------------------- 1 | # Raknet 2 | 3 | -------------------------------------------------------------------------------- /packages/raknet/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { config, serenity } from "@serenityjs/internal-config/eslint"; 2 | 3 | export default config({ 4 | extends: [...serenity] 5 | }); 6 | -------------------------------------------------------------------------------- /packages/raknet/src/constants/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./raknet"; 2 | -------------------------------------------------------------------------------- /packages/raknet/src/decorators/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./proto"; 2 | export * from "./serialize"; 3 | -------------------------------------------------------------------------------- /packages/raknet/src/enums/bit-flags.ts: -------------------------------------------------------------------------------- 1 | enum Bitflags { 2 | Valid = 0x80, 3 | Ack = 0x40, 4 | Nak = 0x20, 5 | Split = 0x10 6 | } 7 | 8 | export { Bitflags }; 9 | -------------------------------------------------------------------------------- /packages/raknet/src/enums/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./packet"; 2 | export * from "./bit-flags"; 3 | export * from "./priority"; 4 | export * from "./status"; 5 | export * from "./reliability"; 6 | -------------------------------------------------------------------------------- /packages/raknet/src/enums/packet.ts: -------------------------------------------------------------------------------- 1 | // NOTE: Please keep all packets in numerical order by their id. Thanks! 2 | 3 | enum Packet { 4 | ConnectedPing = 0x00, // 0 5 | UnconnectedPing = 0x01, // 1 6 | ConnectedPong = 0x03, // 3 7 | OpenConnectionRequest1 = 0x05, // 5 8 | OpenConnectionReply1 = 0x06, // 6 9 | OpenConnectionRequest2 = 0x07, // 7 10 | OpenConnectionReply2 = 0x08, // 8 11 | ConnectionRequest = 0x09, // 9 12 | ConnectionRequestAccepted = 0x10, // 16 13 | NewIncomingConnection = 0x13, // 19 14 | Disconnect = 0x15, // 21 15 | IncompatibleProtocolVersion = 0x19, // 25 16 | UnconnectedPong = 0x1c, // 28 17 | FrameSet = 0x80, // 128 18 | Nack = 0xa0, // 160 19 | Ack = 0xc0 // 192 20 | } 21 | 22 | export { Packet }; 23 | -------------------------------------------------------------------------------- /packages/raknet/src/enums/priority.ts: -------------------------------------------------------------------------------- 1 | enum Priority { 2 | Normal, 3 | Immediate 4 | } 5 | 6 | export { Priority }; 7 | -------------------------------------------------------------------------------- /packages/raknet/src/enums/reliability.ts: -------------------------------------------------------------------------------- 1 | enum Reliability { 2 | Unreliable, 3 | UnreliableSequenced, 4 | Reliable, 5 | ReliableOrdered, 6 | ReliableSequenced, 7 | UnreliableWithAckReceipt, 8 | ReliableWithAckReceipt, 9 | ReliableOrderedWithAckReceipt 10 | } 11 | 12 | export { Reliability }; 13 | -------------------------------------------------------------------------------- /packages/raknet/src/enums/status.ts: -------------------------------------------------------------------------------- 1 | enum Status { 2 | Connecting, 3 | Connected, 4 | Disconnecting, 5 | Disconnected 6 | } 7 | 8 | export { Status }; 9 | -------------------------------------------------------------------------------- /packages/raknet/src/index.ts: -------------------------------------------------------------------------------- 1 | import "reflect-metadata"; 2 | 3 | export * from "./decorators"; 4 | export * from "./proto"; 5 | export * from "./enums"; 6 | export * from "./server"; 7 | export * from "./types"; 8 | export * from "./constants"; 9 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/data/connected-ping.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "@serenityjs/binarystream"; 2 | 3 | import { Proto, Serialize } from "../../decorators"; 4 | import { Packet } from "../../enums"; 5 | 6 | import { BasePacket } from "./base"; 7 | 8 | /** 9 | * Represents an connected ping packet. 10 | */ 11 | @Proto(Packet.ConnectedPing) 12 | class ConnectedPing extends BasePacket { 13 | /** 14 | * The timestamp of the ping. 15 | */ 16 | @Serialize(Long) public timestamp!: bigint; 17 | } 18 | 19 | export { ConnectedPing }; 20 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/data/connected-pong.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "@serenityjs/binarystream"; 2 | 3 | import { Proto, Serialize } from "../../decorators"; 4 | import { Packet } from "../../enums"; 5 | 6 | import { BasePacket } from "./base"; 7 | 8 | /** 9 | * Represents an connected pong packet. 10 | */ 11 | @Proto(Packet.ConnectedPong) 12 | class ConnectedPong extends BasePacket { 13 | /** 14 | * The timestamp of the ping. 15 | */ 16 | @Serialize(Long) public pingTimestamp!: bigint; 17 | 18 | /** 19 | * The timestamp of the pong. 20 | */ 21 | @Serialize(Long) public timestamp!: bigint; 22 | } 23 | 24 | export { ConnectedPong }; 25 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/data/connection-request.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "@serenityjs/binarystream"; 2 | 3 | import { Proto, Serialize } from "../../decorators"; 4 | import { Packet } from "../../enums"; 5 | 6 | import { BasePacket } from "./base"; 7 | 8 | /** 9 | * Represents an connection request packet. 10 | */ 11 | @Proto(Packet.ConnectionRequest) 12 | class ConnectionRequest extends BasePacket { 13 | /** 14 | * The client guid of the request. 15 | */ 16 | @Serialize(Long) public client!: bigint; 17 | 18 | /** 19 | * The timestamp of the request. 20 | */ 21 | @Serialize(Long) public timestamp!: bigint; 22 | } 23 | 24 | export { ConnectionRequest }; 25 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/data/disconnect.ts: -------------------------------------------------------------------------------- 1 | import { Proto } from "../../decorators"; 2 | import { Packet } from "../../enums"; 3 | 4 | import { BasePacket } from "./base"; 5 | 6 | /** 7 | * Represents a disconnect packet. 8 | */ 9 | @Proto(Packet.Disconnect) 10 | class Disconnect extends BasePacket {} 11 | 12 | export { Disconnect }; 13 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/data/frame-set.ts: -------------------------------------------------------------------------------- 1 | import { Endianness, Uint24 } from "@serenityjs/binarystream"; 2 | 3 | import { Proto, Serialize } from "../../decorators"; 4 | import { Packet } from "../../enums"; 5 | import { Frame } from "../types"; 6 | 7 | import { BasePacket } from "./base"; 8 | 9 | /** 10 | * Represents a frame set packet. 11 | * This packet hold multiple frames. 12 | */ 13 | @Proto(Packet.FrameSet) 14 | class FrameSet extends BasePacket { 15 | /** 16 | * The sequence of the frame set. 17 | */ 18 | @Serialize(Uint24, Endianness.Little) public sequence!: number; 19 | 20 | /** 21 | * The frames of the frame set. 22 | */ 23 | @Serialize(Frame) public frames!: Array; 24 | } 25 | 26 | export { FrameSet }; 27 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/data/incompatible-protocol.ts: -------------------------------------------------------------------------------- 1 | import { Uint8, Uint64 } from "@serenityjs/binarystream"; 2 | 3 | import { Proto, Serialize } from "../../decorators"; 4 | import { Packet } from "../../enums"; 5 | import { Magic } from "../types"; 6 | 7 | import { BasePacket } from "./base"; 8 | 9 | /** 10 | * Represents an open connection reply 1 packet. 11 | */ 12 | @Proto(Packet.IncompatibleProtocolVersion) 13 | class IncompatibleProtocolVersion extends BasePacket { 14 | @Serialize(Uint8) public protocol!: number; 15 | @Serialize(Magic) public magic!: Buffer; 16 | @Serialize(Uint64) public guid!: bigint; 17 | } 18 | 19 | export { IncompatibleProtocolVersion }; 20 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/data/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./base"; 2 | export * from "./unconnected-ping"; 3 | export * from "./unconnected-pong"; 4 | export * from "./open-connection-request-1"; 5 | export * from "./open-connection-reply-1"; 6 | export * from "./open-connection-request-2"; 7 | export * from "./open-connection-reply-2"; 8 | export * from "./connected-pong"; 9 | export * from "./connected-ping"; 10 | export * from "./connection-request"; 11 | export * from "./frame-set"; 12 | export * from "./ack"; 13 | export * from "./nack"; 14 | export * from "./disconnect"; 15 | export * from "./incompatible-protocol"; 16 | export * from "./connection-request-accepted"; 17 | export * from "./new-incoming-connection"; 18 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./types"; 2 | export * from "./data"; 3 | -------------------------------------------------------------------------------- /packages/raknet/src/proto/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./type"; 2 | export * from "./magic"; 3 | export * from "./mtu"; 4 | export * from "./address"; 5 | export * from "./frame"; 6 | export * from "./system-address"; 7 | -------------------------------------------------------------------------------- /packages/raknet/src/server/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./raknet"; 2 | export * from "./offline"; 3 | export * from "./connection"; 4 | -------------------------------------------------------------------------------- /packages/raknet/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./packet"; 2 | export * from "./network"; 3 | export * from "./properties"; 4 | -------------------------------------------------------------------------------- /packages/raknet/src/types/network/identifier.ts: -------------------------------------------------------------------------------- 1 | interface NetworkIdentifier { 2 | address: string; 3 | port: number; 4 | version: number; 5 | } 6 | 7 | export type { NetworkIdentifier }; 8 | -------------------------------------------------------------------------------- /packages/raknet/src/types/network/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./identifier"; 2 | export * from "./server"; 3 | -------------------------------------------------------------------------------- /packages/raknet/src/types/network/server.ts: -------------------------------------------------------------------------------- 1 | import type { Connection } from "../../server"; 2 | 3 | interface RaknetEvents { 4 | error: [Error]; 5 | connect: [Connection]; 6 | disconnect: [Connection]; 7 | encapsulated: [Connection, Buffer]; 8 | } 9 | 10 | export { RaknetEvents }; 11 | -------------------------------------------------------------------------------- /packages/raknet/src/types/packet/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./metadata"; 2 | export * from "./valid"; 3 | -------------------------------------------------------------------------------- /packages/raknet/src/types/packet/metadata.ts: -------------------------------------------------------------------------------- 1 | import type { Endianness } from "@serenityjs/binarystream"; 2 | import type { ValidTypes } from "./valid"; 3 | 4 | interface PacketMetadata { 5 | endian: Endianness | boolean; 6 | name: string; 7 | parameter: string; 8 | type: ValidTypes; 9 | } 10 | 11 | export type { PacketMetadata }; 12 | -------------------------------------------------------------------------------- /packages/raknet/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenityjs/internal-config/typescript", 3 | "exclude": [ 4 | "node_modules", 5 | "dist" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/raknet/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, type Options } from "tsup"; 2 | import DefaultConfig from "@serenityjs/internal-config/tsup"; 3 | 4 | export default defineConfig((options: Options) => ({ 5 | ...DefaultConfig, 6 | ...options 7 | })); 8 | -------------------------------------------------------------------------------- /packages/raknet/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "out": "./dist", 4 | "readme": "README.md" 5 | } -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "globalDependencies": ["**/.env.*local"], 4 | "tasks": { 5 | "build": { 6 | "dependsOn": ["^build"], 7 | "outputs": ["dist/**"] 8 | }, 9 | "lint": { 10 | "dependsOn": ["^lint"] 11 | }, 12 | "watch": { 13 | "dependsOn": ["^build"], 14 | "persistent": true, 15 | "cache": false 16 | } 17 | } 18 | } 19 | --------------------------------------------------------------------------------