up3
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package session
|
||||
|
||||
import (
|
||||
"github.com/df-mc/dragonfly/server/world"
|
||||
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
|
||||
)
|
||||
|
||||
// RequestChunkRadiusHandler handles the RequestChunkRadius packet.
|
||||
type RequestChunkRadiusHandler struct{}
|
||||
|
||||
// Handle ...
|
||||
func (*RequestChunkRadiusHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, _ Controllable) error {
|
||||
pk := p.(*packet.RequestChunkRadius)
|
||||
|
||||
if pk.ChunkRadius > s.maxChunkRadius {
|
||||
pk.ChunkRadius = s.maxChunkRadius
|
||||
}
|
||||
s.chunkRadius = pk.ChunkRadius
|
||||
|
||||
s.chunkLoader.ChangeRadius(tx, int(pk.ChunkRadius))
|
||||
|
||||
s.writePacket(&packet.ChunkRadiusUpdated{ChunkRadius: s.chunkRadius})
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user