Documentation
¶
Index ¶
- Variables
- func BuildAvailableCommands(commands map[string]cmd.Command, src cmd.Source, softEnums map[string]struct{}) (*packet.AvailableCommands, map[string]map[int]cmd.Runnable)
- type BlockActorDataHandler
- type BlockPickRequestHandler
- type BookEditHandler
- type ClientCacheBlobStatusHandler
- type CommandRequestHandler
- type Config
- type Conn
- type ContainerCloseHandler
- type Controllable
- type Diagnostics
- type EmoteHandler
- type InteractHandler
- type InventoryTransactionHandler
- type ItemStackRequestHandler
- type LecternUpdateHandler
- type MobEquipmentHandler
- type ModalFormResponseHandler
- type NPCRequestHandler
- type NetworkEncodeableEntity
- type OffsetEntity
- type PlayerActionHandler
- type PlayerAuthInputHandler
- type PlayerSkinHandler
- type RequestAbilityHandler
- type RequestChunkRadiusHandler
- type RespawnHandler
- type ServerBoundDiagnosticsHandler
- type ServerBoundLoadingScreenHandler
- type Session
- func (s *Session) AddDebugShape(shape debug.Shape)
- func (s *Session) Addr() net.Addr
- func (s *Session) ChangingDimension() bool
- func (s *Session) ChunkRadius() int32
- func (s *Session) ClearInputLocks()
- func (s *Session) ClientData() login.ClientData
- func (s *Session) Close(tx *world.Tx, c Controllable)
- func (s *Session) CloseConnection()
- func (s *Session) CloseDialogue()
- func (s *Session) CloseForm()
- func (s *Session) Disconnect(message string)
- func (s *Session) EnableCoordinates(enable bool)
- func (s *Session) EnableInstantRespawn(enable bool)
- func (s *Session) HandleInventories(tx *world.Tx, c Controllable, ...)
- func (s *Session) HideEntity(e world.Entity)
- func (s *Session) HideHudElement(e hud.Element)
- func (s *Session) HudElementHidden(e hud.Element) bool
- func (s *Session) InputLocked(l input.Lock) bool
- func (s *Session) Latency() time.Duration
- func (s *Session) LockInput(l input.Lock)
- func (s *Session) OpenBlockContainer(pos cube.Pos, tx *world.Tx)
- func (s *Session) OpenSign(pos cube.Pos, frontSide bool)
- func (s *Session) PlayLevelSoundEvent(soundType string, pos mgl64.Vec3)
- func (s *Session) PlaySound(t world.Sound, pos mgl64.Vec3)
- func (s *Session) RefreshCommands()
- func (s *Session) RefreshCommandsFor(c Controllable)
- func (s *Session) RemoveAllDebugShapes()
- func (s *Session) RemoveBossBar()
- func (s *Session) RemoveDebugShape(shape debug.Shape)
- func (s *Session) RemoveScoreboard()
- func (s *Session) RemoveViewLayer(entity world.Entity)
- func (s *Session) SendAbilities(c Controllable)
- func (s *Session) SendActionBarMessage(text string)
- func (s *Session) SendAnnouncement(message string)
- func (s *Session) SendBossBar(text string, colour uint8, healthPercentage float64)
- func (s *Session) SendChargeItemComplete()
- func (s *Session) SendCommandOutput(output *cmd.Output, l language.Tag)
- func (s *Session) SendDebugShapes(dim world.Dimension)
- func (s *Session) SendDialogue(d dialogue.Dialogue, e world.Entity)
- func (s *Session) SendEffect(e effect.Effect)
- func (s *Session) SendEffectRemoval(e effect.Type)
- func (s *Session) SendExperience(level int, progress float64)
- func (s *Session) SendFood(food int, saturation, exhaustion float64)
- func (s *Session) SendForm(f form.Form)
- func (s *Session) SendGameMode(c Controllable)
- func (s *Session) SendGameRule(name string, val bool)
- func (s *Session) SendGameRuleInt(name string, val int)
- func (s *Session) SendHealth(health, max, absorption float64)
- func (s *Session) SendHeldSlot(slot int, c Controllable, force bool)
- func (s *Session) SendHudUpdates()
- func (s *Session) SendInputLocks()
- func (s *Session) SendJukeboxPopup(message string)
- func (s *Session) SendMessage(message string)
- func (s *Session) SendPlayerSpawn(pos mgl64.Vec3)
- func (s *Session) SendPopup(message string)
- func (s *Session) SendRespawn(pos mgl64.Vec3, c Controllable)
- func (s *Session) SendScoreboard(sb *scoreboard.Scoreboard)
- func (s *Session) SendSpeed(speed float64)
- func (s *Session) SendSubtitle(text string)
- func (s *Session) SendTip(message string)
- func (s *Session) SendTitle(text string)
- func (s *Session) SendToast(title, message string)
- func (s *Session) SendTranslation(t chat.Translation, l language.Tag, a []any)
- func (s *Session) SetHandle(handle *world.EntityHandle, skin skin.Skin)
- func (s *Session) SetProxyAddr(addr net.Addr)
- func (s *Session) SetTitleDurations(fadeInDuration, remainDuration, fadeOutDuration time.Duration)
- func (s *Session) ShowHudElement(e hud.Element)
- func (s *Session) Spawn(c Controllable, tx *world.Tx)
- func (s *Session) StartShowingEntity(e world.Entity)
- func (s *Session) StopShowingEntity(e world.Entity)
- func (s *Session) StopSound(soundName string, stopAll bool)
- func (s *Session) Transfer(ip net.IP, port int)
- func (s *Session) UnlockInput(l input.Lock)
- func (s *Session) VerifyAndSetHeldSlot(slot int, expected item.Stack, c Controllable) error
- func (s *Session) VerifySlot(slot int, expected item.Stack) error
- func (s *Session) ViewAlwaysShowNameTag(entity world.Entity, alwaysShow bool)
- func (s *Session) ViewBlockAction(pos cube.Pos, a world.BlockAction)
- func (s *Session) ViewBlockUpdate(pos cube.Pos, b world.Block, layer int)
- func (s *Session) ViewBrewingUpdate(prevBrewTime, brewTime time.Duration, ...)
- func (s *Session) ViewChunk(pos world.ChunkPos, dim world.Dimension, ...)
- func (s *Session) ViewEmote(player world.Entity, emote uuid.UUID)
- func (s *Session) ViewEntity(e world.Entity)
- func (s *Session) ViewEntityAction(e world.Entity, a world.EntityAction)
- func (s *Session) ViewEntityAnimation(e world.Entity, a world.EntityAnimation)
- func (s *Session) ViewEntityArmour(e world.Entity)
- func (s *Session) ViewEntityDisplacement(e world.Entity, pos mgl64.Vec3, rot cube.Rotation, onGround bool)
- func (s *Session) ViewEntityGameMode(e world.Entity)
- func (s *Session) ViewEntityItems(e world.Entity)
- func (s *Session) ViewEntityMovement(e world.Entity, pos mgl64.Vec3, rot cube.Rotation, onGround bool)
- func (s *Session) ViewEntityState(e world.Entity)
- func (s *Session) ViewEntityTeleport(e world.Entity, position mgl64.Vec3)
- func (s *Session) ViewEntityVelocity(e world.Entity, velocity mgl64.Vec3)
- func (s *Session) ViewEntityWake(e world.Entity)
- func (s *Session) ViewFurnaceUpdate(...)
- func (s *Session) ViewItemCooldown(item world.Item, duration time.Duration)
- func (s *Session) ViewLayer() *world.ViewLayer
- func (s *Session) ViewLayerEntityChanged(e world.Entity)
- func (s *Session) ViewNameTag(entity world.Entity, nameTag string)
- func (s *Session) ViewParticle(pos mgl64.Vec3, p world.Particle)
- func (s *Session) ViewPublicAlwaysShowNameTag(entity world.Entity)
- func (s *Session) ViewPublicNameTag(entity world.Entity)
- func (s *Session) ViewPublicScoreTag(entity world.Entity)
- func (s *Session) ViewScoreTag(entity world.Entity, scoreTag string)
- func (s *Session) ViewSkin(e world.Entity)
- func (s *Session) ViewSleepingPlayers(sleeping, max int)
- func (s *Session) ViewSlotChange(slot int, newItem item.Stack)
- func (s *Session) ViewSound(pos mgl64.Vec3, soundType world.Sound)
- func (s *Session) ViewSubChunks(centre world.SubChunkPos, offsets []protocol.SubChunkOffset, tx *world.Tx)
- func (s *Session) ViewTime(time int)
- func (s *Session) ViewTimeCycle(doDayLightCycle bool)
- func (s *Session) ViewVisibility(entity world.Entity, level world.VisibilityLevel)
- func (s *Session) ViewWeather(raining, thunder bool)
- func (s *Session) ViewWorldSpawn(pos cube.Pos)
- func (s *Session) VisibleDebugShapes() []debug.Shape
- type SubChunkRequestHandler
- type TextHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var Nop = &Session{conf: Config{Log: slog.New(slog.DiscardHandler)}}
Functions ¶
Types ¶
type BlockActorDataHandler ¶
type BlockActorDataHandler struct{}
func (BlockActorDataHandler) Handle ¶
func (b BlockActorDataHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error
type BlockPickRequestHandler ¶
type BlockPickRequestHandler struct{}
func (BlockPickRequestHandler) Handle ¶
func (b BlockPickRequestHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error
type BookEditHandler ¶
type BookEditHandler struct{}
func (BookEditHandler) Handle ¶
func (b BookEditHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, _ Controllable) error
type ClientCacheBlobStatusHandler ¶
type ClientCacheBlobStatusHandler struct {
}
func (*ClientCacheBlobStatusHandler) Handle ¶
func (c *ClientCacheBlobStatusHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, _ Controllable) error
type CommandRequestHandler ¶
type CommandRequestHandler struct {
// contains filtered or unexported fields
}
func (*CommandRequestHandler) Handle ¶
func (h *CommandRequestHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error
type Config ¶
type Config struct {
Log *slog.Logger
MaxChunkRadius int
EmoteChatMuted bool
JoinMessage, QuitMessage chat.Translation
HandleStop func(*world.Tx, Controllable)
BlockRegistry world.BlockRegistry
}
type Conn ¶
type Conn interface {
io.Closer
IdentityData() login.IdentityData
ClientData() login.ClientData
ClientCacheEnabled() bool
ChunkRadius() int
Latency() time.Duration
Flush() error
RemoteAddr() net.Addr
ReadPacket() (pk packet.Packet, err error)
WritePacket(pk packet.Packet) error
StartGameContext(ctx context.Context, data minecraft.GameData) error
}
type ContainerCloseHandler ¶
type ContainerCloseHandler struct{}
func (*ContainerCloseHandler) Handle ¶
func (h *ContainerCloseHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error
type Controllable ¶
type Controllable interface {
Name() string
world.Entity
item.User
dialogue.Submitter
form.Submitter
cmd.Source
chat.Subscriber
hud.Renderer
debug.Renderer
input.Restricter
Locale() language.Tag
SetHeldItems(right, left item.Stack)
SetHeldSlot(slot int) error
Move(deltaPos mgl64.Vec3, deltaYaw, deltaPitch float64)
Speed() float64
FlightSpeed() float64
VerticalFlightSpeed() float64
Sleep(pos cube.Pos)
Wake()
Chat(msg ...any)
ExecuteCommand(commandLine string)
GameMode() world.GameMode
SetGameMode(mode world.GameMode)
Effects() []effect.Effect
UseItem()
ReleaseItem()
UseItemOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3)
UseItemOnEntity(e world.Entity) bool
BreakBlock(pos cube.Pos)
PickBlock(pos cube.Pos)
AttackEntity(e world.Entity) bool
Drop(s item.Stack) (n int)
SwingArm()
PunchAir()
Health() float64
MaxHealth() float64
Absorption() float64
Food() int
ExperienceLevel() int
ExperienceProgress() float64
SetExperienceLevel(level int)
EnchantmentSeed() int64
ResetEnchantmentSeed()
Respawn() *world.EntityHandle
Dead() bool
StartSneaking()
Sneaking() bool
StopSneaking()
StartSprinting()
Sprinting() bool
StopSprinting()
StartSwimming()
Swimming() bool
StopSwimming()
StartCrawling()
Crawling() bool
StopCrawling()
StartFlying()
Flying() bool
StopFlying()
StartGliding()
Gliding() bool
StopGliding()
Jump()
StartBreaking(pos cube.Pos, face cube.Face)
ContinueBreaking(face cube.Face)
FinishBreaking()
AbortBreaking()
Exhaust(points float64)
OpenSign(pos cube.Pos, frontSide bool)
EditSign(pos cube.Pos, frontText, backText string) error
TurnLecternPage(pos cube.Pos, page int) error
EnderChestInventory() *inventory.Inventory
MoveItemsToInventory()
UUID() uuid.UUID
XUID() string
Skin() skin.Skin
SetSkin(skin.Skin)
UpdateDiagnostics(Diagnostics)
}
type Diagnostics ¶
type Diagnostics struct {
AverageFramesPerSecond float64
AverageServerSimTickTime float64
AverageClientSimTickTime float64
AverageBeginFrameTime float64
AverageInputTime float64
AverageRenderTime float64
AverageEndFrameTime float64
AverageRemainderTimePercent float64
AverageUnaccountedTimePercent float64
}
type EmoteHandler ¶
func (*EmoteHandler) Handle ¶
func (h *EmoteHandler) Handle(p packet.Packet, _ *Session, tx *world.Tx, c Controllable) error
type InteractHandler ¶
type InteractHandler struct{}
func (*InteractHandler) Handle ¶
func (h *InteractHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, c Controllable) error
type InventoryTransactionHandler ¶
type InventoryTransactionHandler struct{}
func (*InventoryTransactionHandler) Handle ¶
func (h *InventoryTransactionHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) (err error)
type ItemStackRequestHandler ¶
type ItemStackRequestHandler struct {
// contains filtered or unexported fields
}
func (*ItemStackRequestHandler) Handle ¶
func (h *ItemStackRequestHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error
type LecternUpdateHandler ¶
type LecternUpdateHandler struct{}
func (LecternUpdateHandler) Handle ¶
func (LecternUpdateHandler) Handle(p packet.Packet, _ *Session, tx *world.Tx, c Controllable) error
type MobEquipmentHandler ¶
type MobEquipmentHandler struct{}
func (*MobEquipmentHandler) Handle ¶
func (*MobEquipmentHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error
type ModalFormResponseHandler ¶
type ModalFormResponseHandler struct {
// contains filtered or unexported fields
}
func (*ModalFormResponseHandler) Handle ¶
func (h *ModalFormResponseHandler) Handle(p packet.Packet, _ *Session, tx *world.Tx, c Controllable) error
type NPCRequestHandler ¶
type NPCRequestHandler struct {
// contains filtered or unexported fields
}
func (*NPCRequestHandler) Handle ¶
func (h *NPCRequestHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error
type NetworkEncodeableEntity ¶
type NetworkEncodeableEntity interface {
NetworkEncodeEntity() string
}
type OffsetEntity ¶
type OffsetEntity interface {
NetworkOffset() float64
}
type PlayerActionHandler ¶
type PlayerActionHandler struct{}
func (*PlayerActionHandler) Handle ¶
func (*PlayerActionHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, c Controllable) error
type PlayerAuthInputHandler ¶
type PlayerAuthInputHandler struct{}
func (PlayerAuthInputHandler) Handle ¶
func (h PlayerAuthInputHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error
type PlayerSkinHandler ¶
type PlayerSkinHandler struct{}
func (PlayerSkinHandler) Handle ¶
func (PlayerSkinHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error
type RequestAbilityHandler ¶
type RequestAbilityHandler struct{}
func (RequestAbilityHandler) Handle ¶
func (a RequestAbilityHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, c Controllable) error
type RequestChunkRadiusHandler ¶
type RequestChunkRadiusHandler struct{}
func (*RequestChunkRadiusHandler) Handle ¶
func (*RequestChunkRadiusHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, _ Controllable) error
type RespawnHandler ¶
type RespawnHandler struct{}
func (*RespawnHandler) Handle ¶
func (*RespawnHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error
type ServerBoundDiagnosticsHandler ¶
type ServerBoundDiagnosticsHandler struct{}
func (*ServerBoundDiagnosticsHandler) Handle ¶
func (h *ServerBoundDiagnosticsHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error
type ServerBoundLoadingScreenHandler ¶
type ServerBoundLoadingScreenHandler struct {
// contains filtered or unexported fields
}
func (*ServerBoundLoadingScreenHandler) Handle ¶
func (h *ServerBoundLoadingScreenHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, _ Controllable) error
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) AddDebugShape ¶
func (*Session) ChangingDimension ¶
func (*Session) ChunkRadius ¶
func (*Session) ClearInputLocks ¶
func (s *Session) ClearInputLocks()
func (*Session) ClientData ¶
func (s *Session) ClientData() login.ClientData
func (*Session) CloseConnection ¶
func (s *Session) CloseConnection()
func (*Session) CloseDialogue ¶
func (s *Session) CloseDialogue()
func (*Session) Disconnect ¶
func (*Session) EnableCoordinates ¶
func (*Session) EnableInstantRespawn ¶
func (*Session) HandleInventories ¶
func (*Session) HideEntity ¶
func (*Session) HideHudElement ¶
func (*Session) OpenBlockContainer ¶
func (*Session) PlayLevelSoundEvent ¶
func (*Session) RefreshCommands ¶
func (s *Session) RefreshCommands()
func (*Session) RefreshCommandsFor ¶
func (s *Session) RefreshCommandsFor(c Controllable)
func (*Session) RemoveAllDebugShapes ¶
func (s *Session) RemoveAllDebugShapes()
func (*Session) RemoveBossBar ¶
func (s *Session) RemoveBossBar()
func (*Session) RemoveDebugShape ¶
func (*Session) RemoveScoreboard ¶
func (s *Session) RemoveScoreboard()
func (*Session) RemoveViewLayer ¶
func (*Session) SendAbilities ¶
func (s *Session) SendAbilities(c Controllable)
func (*Session) SendActionBarMessage ¶
func (*Session) SendAnnouncement ¶
func (*Session) SendBossBar ¶
func (*Session) SendChargeItemComplete ¶
func (s *Session) SendChargeItemComplete()
func (*Session) SendCommandOutput ¶
func (*Session) SendDebugShapes ¶
func (*Session) SendEffect ¶
func (*Session) SendEffectRemoval ¶
func (*Session) SendExperience ¶
func (*Session) SendGameMode ¶
func (s *Session) SendGameMode(c Controllable)
func (*Session) SendGameRule ¶
func (*Session) SendGameRuleInt ¶
func (*Session) SendHealth ¶
func (*Session) SendHeldSlot ¶
func (s *Session) SendHeldSlot(slot int, c Controllable, force bool)
func (*Session) SendHudUpdates ¶
func (s *Session) SendHudUpdates()
func (*Session) SendInputLocks ¶
func (s *Session) SendInputLocks()
func (*Session) SendJukeboxPopup ¶
func (*Session) SendMessage ¶
func (*Session) SendPlayerSpawn ¶
func (*Session) SendRespawn ¶
func (s *Session) SendRespawn(pos mgl64.Vec3, c Controllable)
func (*Session) SendScoreboard ¶
func (s *Session) SendScoreboard(sb *scoreboard.Scoreboard)
func (*Session) SendSubtitle ¶
func (*Session) SendTranslation ¶
func (*Session) SetProxyAddr ¶
func (*Session) SetTitleDurations ¶
func (*Session) ShowHudElement ¶
func (*Session) StartShowingEntity ¶
func (*Session) StopShowingEntity ¶
func (*Session) UnlockInput ¶
func (*Session) VerifyAndSetHeldSlot ¶
func (*Session) ViewAlwaysShowNameTag ¶
func (*Session) ViewBlockAction ¶
func (s *Session) ViewBlockAction(pos cube.Pos, a world.BlockAction)
func (*Session) ViewBlockUpdate ¶
func (*Session) ViewBrewingUpdate ¶
func (*Session) ViewEntity ¶
func (*Session) ViewEntityAction ¶
func (s *Session) ViewEntityAction(e world.Entity, a world.EntityAction)
func (*Session) ViewEntityAnimation ¶
func (s *Session) ViewEntityAnimation(e world.Entity, a world.EntityAnimation)
func (*Session) ViewEntityArmour ¶
func (*Session) ViewEntityDisplacement ¶
func (*Session) ViewEntityGameMode ¶
func (*Session) ViewEntityItems ¶
func (*Session) ViewEntityMovement ¶
func (*Session) ViewEntityState ¶
func (*Session) ViewEntityTeleport ¶
func (*Session) ViewEntityVelocity ¶
func (*Session) ViewEntityWake ¶
func (*Session) ViewFurnaceUpdate ¶
func (*Session) ViewItemCooldown ¶
func (*Session) ViewLayerEntityChanged ¶
func (*Session) ViewPublicAlwaysShowNameTag ¶
func (*Session) ViewPublicNameTag ¶
func (*Session) ViewPublicScoreTag ¶
func (*Session) ViewSleepingPlayers ¶
func (*Session) ViewSubChunks ¶
func (s *Session) ViewSubChunks(centre world.SubChunkPos, offsets []protocol.SubChunkOffset, tx *world.Tx)
func (*Session) ViewTimeCycle ¶
func (*Session) ViewVisibility ¶
func (s *Session) ViewVisibility(entity world.Entity, level world.VisibilityLevel)
func (*Session) ViewWeather ¶
func (*Session) ViewWorldSpawn ¶
func (*Session) VisibleDebugShapes ¶
type SubChunkRequestHandler ¶
type SubChunkRequestHandler struct{}
func (*SubChunkRequestHandler) Handle ¶
func (*SubChunkRequestHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, _ Controllable) error
type TextHandler ¶
type TextHandler struct{}
func (TextHandler) Handle ¶
func (TextHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, c Controllable) error
Source Files
¶
- chunk.go
- command.go
- controllable.go
- diagnostics.go
- enchantment_texts.go
- entity_metadata.go
- handler.go
- handler_anvil.go
- handler_beacon.go
- handler_block_actor_data.go
- handler_block_pick_request.go
- handler_book_edit.go
- handler_client_cache_blob_status.go
- handler_command_request.go
- handler_container_close.go
- handler_crafting.go
- handler_emote.go
- handler_enchanting.go
- handler_grindstone.go
- handler_interact.go
- handler_inventory_transaction.go
- handler_item_stack_request.go
- handler_lectern_update.go
- handler_loom.go
- handler_mob_equipment.go
- handler_modal_form_response.go
- handler_npc_request.go
- handler_player_action.go
- handler_player_auth_input.go
- handler_player_skin.go
- handler_request_ability.go
- handler_request_chunk_radius.go
- handler_respawn.go
- handler_server_bound_diagnostics.go
- handler_server_bound_loading_screen.go
- handler_smithing.go
- handler_stonecutter.go
- handler_sub_chunk_request.go
- handler_text.go
- player.go
- session.go
- session_list.go
- text.go
- view_layer.go
- world.go
Click to show internal directories.
Click to hide internal directories.