Add support for protocol version 1.21.100 (#12)

This commit is contained in:
Akmal Fairuz
2025-08-13 21:37:46 +07:00
committed by GitHub
parent d3fae5d3be
commit d9d8b0bc75
50 changed files with 9667 additions and 135 deletions

View File

@@ -2,10 +2,11 @@ package internal
import (
"fmt"
"github.com/df-mc/worldupgrader/blockupgrader"
"sort"
"strings"
"unsafe"
"github.com/df-mc/worldupgrader/blockupgrader"
)
// StateHash is a struct that may be used as a map key for block states. It contains the name of the block state

View File

@@ -1,8 +1,9 @@
package chunk
import (
"github.com/df-mc/dragonfly/server/block/cube"
"sync"
"github.com/df-mc/dragonfly/server/block/cube"
)
// Chunk is a segment in the world with a size of 16x16x256 blocks. A chunk contains multiple sub chunks

View File

@@ -3,6 +3,7 @@ package chunk
import (
"bytes"
"fmt"
"github.com/df-mc/dragonfly/server/block/cube"
)

View File

@@ -2,8 +2,9 @@ package chunk
import (
"bytes"
"github.com/df-mc/dragonfly/server/block/cube"
"sync"
"github.com/df-mc/dragonfly/server/block/cube"
)
// pool is used to pool byte buffers used for encoding chunks.

View File

@@ -4,9 +4,10 @@ import (
"bytes"
"encoding/binary"
"fmt"
"github.com/akmalfairuz/legacy-version/mapping"
"strings"
"github.com/akmalfairuz/legacy-version/mapping"
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/worldupgrader/blockupgrader"
"github.com/sandertv/gophertunnel/minecraft/nbt"

View File

@@ -4,12 +4,13 @@ import (
"bytes"
"embed"
"encoding/json"
"github.com/df-mc/worldupgrader/blockupgrader"
"github.com/sandertv/gophertunnel/minecraft/nbt"
"github.com/sandertv/gophertunnel/minecraft/protocol"
"regexp"
"sort"
"strconv"
"github.com/df-mc/worldupgrader/blockupgrader"
"github.com/sandertv/gophertunnel/minecraft/nbt"
"github.com/sandertv/gophertunnel/minecraft/protocol"
)
var (

13
internal/pool.go Normal file
View File

@@ -0,0 +1,13 @@
package internal
import (
"bytes"
"sync"
)
// BufferPool is a sync.Pool for buffers used to write compressed data to.
var BufferPool = sync.Pool{
New: func() any {
return bytes.NewBuffer(make([]byte, 0, 256))
},
}