Merge pull request #19 from AkmalFairuz/feature/1.21.120

Feature/1.21.120
This commit is contained in:
Akmal Fairuz
2025-10-30 09:53:20 +07:00
committed by GitHub
16 changed files with 9807 additions and 49 deletions

View File

@@ -5,6 +5,7 @@ A gophertunnel protocol interface implementation to support older Minecraft Bedr
## Supported Versions ## Supported Versions
| Protocol ID | Version | Support | | Protocol ID | Version | Support |
|-------------|----------|---------| |-------------|----------|---------|
| 859 | 1.21.120 | ✅ |
| 844 | 1.21.111 | ✅ | | 844 | 1.21.111 | ✅ |
| 827 | 1.21.100 | ✅ | | 827 | 1.21.100 | ✅ |
| 819 | 1.21.93 | ✅ | | 819 | 1.21.93 | ✅ |

20
go.mod
View File

@@ -3,18 +3,18 @@ module github.com/akmalfairuz/legacy-version
go 1.24.0 go 1.24.0
require ( require (
github.com/df-mc/dragonfly v0.10.6-0.20250817203556-60bcf6b7432b github.com/df-mc/dragonfly v0.10.9
github.com/df-mc/worldupgrader v1.0.19 github.com/df-mc/worldupgrader v1.0.20
github.com/go-gl/mathgl v1.2.0 github.com/go-gl/mathgl v1.2.0
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
github.com/pelletier/go-toml v1.9.5 github.com/pelletier/go-toml v1.9.5
github.com/rogpeppe/go-internal v1.14.1 github.com/rogpeppe/go-internal v1.14.1
github.com/samber/lo v1.49.1 github.com/samber/lo v1.49.1
github.com/sandertv/gophertunnel v1.50.0 github.com/sandertv/gophertunnel v1.51.0
github.com/segmentio/fasthash v1.0.3 github.com/segmentio/fasthash v1.0.3
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b
golang.org/x/image v0.25.0 golang.org/x/image v0.25.0
golang.org/x/oauth2 v0.31.0 golang.org/x/oauth2 v0.32.0
) )
require ( require (
@@ -22,13 +22,13 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/df-mc/goleveldb v1.1.9 // indirect github.com/df-mc/goleveldb v1.1.9 // indirect
github.com/df-mc/jsonc v1.0.5 // indirect github.com/df-mc/jsonc v1.0.5 // indirect
github.com/go-jose/go-jose/v4 v4.1.2 // indirect github.com/go-jose/go-jose/v4 v4.1.3 // indirect
github.com/golang/snappy v1.0.0 // indirect github.com/golang/snappy v1.0.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect github.com/klauspost/compress v1.18.1 // indirect
github.com/muhammadmuzzammil1998/jsonc v1.0.0 // indirect github.com/muhammadmuzzammil1998/jsonc v1.0.0 // indirect
github.com/sandertv/go-raknet v1.14.3-0.20250305181847-6af3e95113d6 // indirect github.com/sandertv/go-raknet v1.14.3-0.20250305181847-6af3e95113d6 // indirect
golang.org/x/crypto v0.42.0 // indirect golang.org/x/crypto v0.43.0 // indirect
golang.org/x/mod v0.27.0 // indirect golang.org/x/mod v0.28.0 // indirect
golang.org/x/net v0.44.0 // indirect golang.org/x/net v0.46.0 // indirect
golang.org/x/text v0.29.0 // indirect golang.org/x/text v0.30.0 // indirect
) )

22
go.sum
View File

@@ -2,6 +2,8 @@ github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9 h1:/G0ghZwrhou0Wq
github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9/go.mod h1:TOk10ahXejq9wkEaym3KPRNeuR/h5Jx+s8QRWIa2oTM= github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9/go.mod h1:TOk10ahXejq9wkEaym3KPRNeuR/h5Jx+s8QRWIa2oTM=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cjmustard/gophertunnel v0.0.0-20251029052631-ee1e364af15f h1:d+l0wkZ9j9Bya25hECwMEJMZfNLH+HSpnjNvlMO9qow=
github.com/cjmustard/gophertunnel v0.0.0-20251029052631-ee1e364af15f/go.mod h1:WjTvUo02TmvPULY1y5oxxAhZIeH8ew31/LUkSUD6ABw=
github.com/cooldogedev/gophertunnel v0.0.0-20250805131657-cc74f1797ff7 h1:IvKtI+ka2fAVh+QFEuLjLTQPyYARaem3q9pr+Y7wJCI= github.com/cooldogedev/gophertunnel v0.0.0-20250805131657-cc74f1797ff7 h1:IvKtI+ka2fAVh+QFEuLjLTQPyYARaem3q9pr+Y7wJCI=
github.com/cooldogedev/gophertunnel v0.0.0-20250805131657-cc74f1797ff7/go.mod h1:lmRarAmn25V/+QeiUbUDXeA26bEaNlX1wGEM/rj39ew= github.com/cooldogedev/gophertunnel v0.0.0-20250805131657-cc74f1797ff7/go.mod h1:lmRarAmn25V/+QeiUbUDXeA26bEaNlX1wGEM/rj39ew=
github.com/cooldogedev/gophertunnel v0.0.0-20250806215416-758d5047d822 h1:cW4FrZUxjdJBoSD3Fpw7Z86LQJHtTK7o9lIgGXuaZ3Q= github.com/cooldogedev/gophertunnel v0.0.0-20250806215416-758d5047d822 h1:cW4FrZUxjdJBoSD3Fpw7Z86LQJHtTK7o9lIgGXuaZ3Q=
@@ -16,6 +18,8 @@ github.com/df-mc/dragonfly v0.10.5 h1:vn3Mwh7vWPDtIdss4QEOP8vSZGHRAjyLvrOEM5mEUI
github.com/df-mc/dragonfly v0.10.5/go.mod h1:/KjoqvIe5+ZxuFUPSRey9UzQS3GkTgAyTH0jTYFMs/g= github.com/df-mc/dragonfly v0.10.5/go.mod h1:/KjoqvIe5+ZxuFUPSRey9UzQS3GkTgAyTH0jTYFMs/g=
github.com/df-mc/dragonfly v0.10.6-0.20250817203556-60bcf6b7432b h1:i3nfD4EFsuIZJfod6W9/lovMw8rzwCjGHRVKOBu1nXo= github.com/df-mc/dragonfly v0.10.6-0.20250817203556-60bcf6b7432b h1:i3nfD4EFsuIZJfod6W9/lovMw8rzwCjGHRVKOBu1nXo=
github.com/df-mc/dragonfly v0.10.6-0.20250817203556-60bcf6b7432b/go.mod h1:1B3NiEGWj0S9U4QlsL58HPvnmgPlaFCm/pCVWdnrMH0= github.com/df-mc/dragonfly v0.10.6-0.20250817203556-60bcf6b7432b/go.mod h1:1B3NiEGWj0S9U4QlsL58HPvnmgPlaFCm/pCVWdnrMH0=
github.com/df-mc/dragonfly v0.10.9 h1:LEja8+EdU753W0eNbaQGyfntTWyL/Nz7blOUTZysW4k=
github.com/df-mc/dragonfly v0.10.9/go.mod h1:pL3nqPtOGVdExu3+LkqWRaa89Trdpf22EjCGexqMus8=
github.com/df-mc/goleveldb v1.1.9 h1:ihdosZyy5jkQKrxucTQmN90jq/2lUwQnJZjIYIC/9YU= github.com/df-mc/goleveldb v1.1.9 h1:ihdosZyy5jkQKrxucTQmN90jq/2lUwQnJZjIYIC/9YU=
github.com/df-mc/goleveldb v1.1.9/go.mod h1:+NHCup03Sci5q84APIA21z3iPZCuk6m6ABtg4nANCSk= github.com/df-mc/goleveldb v1.1.9/go.mod h1:+NHCup03Sci5q84APIA21z3iPZCuk6m6ABtg4nANCSk=
github.com/df-mc/jsonc v1.0.5 h1:O7oh07kbS5AYY+l2Fji6l4h0iHcdjKbxCtK5VlZlLMU= github.com/df-mc/jsonc v1.0.5 h1:O7oh07kbS5AYY+l2Fji6l4h0iHcdjKbxCtK5VlZlLMU=
@@ -24,6 +28,8 @@ github.com/df-mc/worldupgrader v1.0.18 h1:Q34X9ID/hGuDyj9oiq+dpyjOaJdNxhVmVUepf/
github.com/df-mc/worldupgrader v1.0.18/go.mod h1:tsSOLTRm9mpG7VHvYpAjjZrkRHWmSbKZAm9bOLNnlDk= github.com/df-mc/worldupgrader v1.0.18/go.mod h1:tsSOLTRm9mpG7VHvYpAjjZrkRHWmSbKZAm9bOLNnlDk=
github.com/df-mc/worldupgrader v1.0.19 h1:BnwRe/lVv9IhwRWZK5olvTYNTKWh7rhFdqNPDMnoKFM= github.com/df-mc/worldupgrader v1.0.19 h1:BnwRe/lVv9IhwRWZK5olvTYNTKWh7rhFdqNPDMnoKFM=
github.com/df-mc/worldupgrader v1.0.19/go.mod h1:tsSOLTRm9mpG7VHvYpAjjZrkRHWmSbKZAm9bOLNnlDk= github.com/df-mc/worldupgrader v1.0.19/go.mod h1:tsSOLTRm9mpG7VHvYpAjjZrkRHWmSbKZAm9bOLNnlDk=
github.com/df-mc/worldupgrader v1.0.20 h1:wfJyG3bFeaM/HXy7TCiO4HKVw3Mf3N4gPFmgxMHsKnc=
github.com/df-mc/worldupgrader v1.0.20/go.mod h1:tsSOLTRm9mpG7VHvYpAjjZrkRHWmSbKZAm9bOLNnlDk=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-gl/mathgl v1.2.0 h1:v2eOj/y1B2afDxF6URV1qCYmo1KW08lAMtTbOn3KXCY= github.com/go-gl/mathgl v1.2.0 h1:v2eOj/y1B2afDxF6URV1qCYmo1KW08lAMtTbOn3KXCY=
github.com/go-gl/mathgl v1.2.0/go.mod h1:pf9+b5J3LFP7iZ4XXaVzZrCle0Q/vNpB/vDe5+3ulRE= github.com/go-gl/mathgl v1.2.0/go.mod h1:pf9+b5J3LFP7iZ4XXaVzZrCle0Q/vNpB/vDe5+3ulRE=
@@ -33,6 +39,8 @@ github.com/go-jose/go-jose/v4 v4.1.0 h1:cYSYxd3pw5zd2FSXk2vGdn9igQU2PS8MuxrCOCl0
github.com/go-jose/go-jose/v4 v4.1.0/go.mod h1:GG/vqmYm3Von2nYiB2vGTXzdoNKE5tix5tuc6iAd+sw= github.com/go-jose/go-jose/v4 v4.1.0/go.mod h1:GG/vqmYm3Von2nYiB2vGTXzdoNKE5tix5tuc6iAd+sw=
github.com/go-jose/go-jose/v4 v4.1.2 h1:TK/7NqRQZfgAh+Td8AlsrvtPoUyiHh0LqVvokh+1vHI= github.com/go-jose/go-jose/v4 v4.1.2 h1:TK/7NqRQZfgAh+Td8AlsrvtPoUyiHh0LqVvokh+1vHI=
github.com/go-jose/go-jose/v4 v4.1.2/go.mod h1:22cg9HWM1pOlnRiY+9cQYJ9XHmya1bYW8OeDM6Ku6Oo= github.com/go-jose/go-jose/v4 v4.1.2/go.mod h1:22cg9HWM1pOlnRiY+9cQYJ9XHmya1bYW8OeDM6Ku6Oo=
github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs=
github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
@@ -47,6 +55,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co=
github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0=
github.com/muhammadmuzzammil1998/jsonc v1.0.0 h1:8o5gBQn4ZA3NBA9DlTujCj2a4w0tqWrPVjDwhzkgTIs= github.com/muhammadmuzzammil1998/jsonc v1.0.0 h1:8o5gBQn4ZA3NBA9DlTujCj2a4w0tqWrPVjDwhzkgTIs=
github.com/muhammadmuzzammil1998/jsonc v1.0.0/go.mod h1:saF2fIVw4banK0H4+/EuqfFLpRnoy5S+ECwTOCcRcSU= github.com/muhammadmuzzammil1998/jsonc v1.0.0/go.mod h1:saF2fIVw4banK0H4+/EuqfFLpRnoy5S+ECwTOCcRcSU=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
@@ -84,6 +94,8 @@ github.com/sandertv/gophertunnel v1.49.2-0.20251001025512-8f35332755bf h1:bqPdup
github.com/sandertv/gophertunnel v1.49.2-0.20251001025512-8f35332755bf/go.mod h1:WjTvUo02TmvPULY1y5oxxAhZIeH8ew31/LUkSUD6ABw= github.com/sandertv/gophertunnel v1.49.2-0.20251001025512-8f35332755bf/go.mod h1:WjTvUo02TmvPULY1y5oxxAhZIeH8ew31/LUkSUD6ABw=
github.com/sandertv/gophertunnel v1.50.0 h1:uoXQBWOD823T8snohPjIkFo+pcYrlIalEmcY2S1FUPM= github.com/sandertv/gophertunnel v1.50.0 h1:uoXQBWOD823T8snohPjIkFo+pcYrlIalEmcY2S1FUPM=
github.com/sandertv/gophertunnel v1.50.0/go.mod h1:WjTvUo02TmvPULY1y5oxxAhZIeH8ew31/LUkSUD6ABw= github.com/sandertv/gophertunnel v1.50.0/go.mod h1:WjTvUo02TmvPULY1y5oxxAhZIeH8ew31/LUkSUD6ABw=
github.com/sandertv/gophertunnel v1.51.0 h1:16YmOR6AwtreQjbDynFD5kWt7sm+MwdCs79Yl7RGrPc=
github.com/sandertv/gophertunnel v1.51.0/go.mod h1:IhLg93aMPY/rKgB7lKxTzOZ6i11OgkL0WinVs+gMvlI=
github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM= github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM=
github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
@@ -100,6 +112,8 @@ golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI= golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8= golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo= golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
@@ -122,6 +136,8 @@ golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg=
golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ=
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U=
golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
@@ -135,12 +151,16 @@ golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc=
golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo= golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo=
golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=
golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
@@ -159,6 +179,8 @@ golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=

View File

@@ -21,6 +21,7 @@ var (
// must be set to true if you're using Dragonfly. // must be set to true if you're using Dragonfly.
func All(dragonflyMapping bool) []minecraft.Protocol { func All(dragonflyMapping bool) []minecraft.Protocol {
return []minecraft.Protocol{ return []minecraft.Protocol{
New844(dragonflyMapping),
New827(dragonflyMapping), New827(dragonflyMapping),
New819(dragonflyMapping), New819(dragonflyMapping),
New818(dragonflyMapping), New818(dragonflyMapping),

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
package legacypacket
import (
"github.com/akmalfairuz/legacy-version/legacyver/proto"
"github.com/sandertv/gophertunnel/minecraft/protocol"
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
)
// Animate is sent by the server to send a player animation from one player to all viewers of that player. It
// is used for a couple of actions, such as arm swimming and critical hits.
type Animate struct {
// ActionType is the ID of the animation action to execute. It is one of the action type constants that
// may be found above.
ActionType int32
// EntityRuntimeID is the runtime ID of the player that the animation should be played upon. The runtime
// ID is unique for each world session, and entities are generally identified in packets using this
// runtime ID.
EntityRuntimeID uint64
// Data ...
Data float32
// RowingTime is the time for rowing actions.
RowingTime float32
}
// ID ...
func (*Animate) ID() uint32 {
return packet.IDAnimate
}
func (pk *Animate) Marshal(io protocol.IO) {
io.Varint32(&pk.ActionType)
io.Varuint64(&pk.EntityRuntimeID)
if proto.IsProtoGTE(io, proto.ID859) {
io.Float32(&pk.Data)
if pk.ActionType == packet.AnimateActionRowLeft || pk.ActionType == packet.AnimateActionRowRight {
io.Float32(&pk.RowingTime)
}
} else {
if pk.ActionType&0x80 != 0 {
io.Float32(&pk.RowingTime)
}
}
}

View File

@@ -20,6 +20,12 @@ type CameraInstruction struct {
RemoveTarget protocol.Optional[bool] RemoveTarget protocol.Optional[bool]
// FieldOfView is a camera instruction that updates the field of view for the camera. // FieldOfView is a camera instruction that updates the field of view for the camera.
FieldOfView protocol.Optional[protocol.CameraInstructionFieldOfView] FieldOfView protocol.Optional[protocol.CameraInstructionFieldOfView]
// Spline is a camera instruction that creates a spline path for the camera to follow.
Spline protocol.Optional[protocol.CameraSplineInstruction]
// AttachToEntity is the entity ID to attach the camera to.
AttachToEntity protocol.Optional[int64]
// DetachFromEntity can be set to true to detach the camera from the current entity.
DetachFromEntity protocol.Optional[bool]
} }
// ID ... // ID ...
@@ -38,4 +44,9 @@ func (pk *CameraInstruction) Marshal(io protocol.IO) {
if proto.IsProtoGTE(io, proto.ID827) { if proto.IsProtoGTE(io, proto.ID827) {
protocol.OptionalMarshaler(io, &pk.FieldOfView) protocol.OptionalMarshaler(io, &pk.FieldOfView)
} }
if proto.IsProtoGTE(io, proto.ID859) {
protocol.OptionalMarshaler(io, &pk.Spline)
protocol.OptionalFunc(io, &pk.AttachToEntity, io.Int64)
protocol.OptionalFunc(io, &pk.DetachFromEntity, io.Bool)
}
} }

View File

@@ -55,7 +55,7 @@ type CommandBlockUpdate struct {
ShouldTrackOutput bool ShouldTrackOutput bool
// TickDelay is the delay in ticks between executions of a command block, if it is a repeating command // TickDelay is the delay in ticks between executions of a command block, if it is a repeating command
// block. // block.
TickDelay int32 TickDelay uint32
// ExecuteOnFirstTick specifies if the command block should execute on the first tick, AKA as soon as the // ExecuteOnFirstTick specifies if the command block should execute on the first tick, AKA as soon as the
// command block is enabled. // command block is enabled.
ExecuteOnFirstTick bool ExecuteOnFirstTick bool
@@ -83,6 +83,6 @@ func (pk *CommandBlockUpdate) Marshal(io protocol.IO) {
io.String(&pk.FilteredName) io.String(&pk.FilteredName)
} }
io.Bool(&pk.ShouldTrackOutput) io.Bool(&pk.ShouldTrackOutput)
io.Int32(&pk.TickDelay) io.Uint32(&pk.TickDelay)
io.Bool(&pk.ExecuteOnFirstTick) io.Bool(&pk.ExecuteOnFirstTick)
} }

View File

@@ -31,7 +31,7 @@ func (pk *PlayerArmourDamage) Marshal(io protocol.IO) {
for _, flag := range flags { for _, flag := range flags {
if bitset&flag != 0 { if bitset&flag != 0 {
v := protocol.PlayerArmourDamageEntry{ v := protocol.PlayerArmourDamageEntry{
ArmourSlot: flag, ArmourSlot: int32(flag),
} }
v2 := int32(0) v2 := int32(0)
io.Varint32(&v2) io.Varint32(&v2)
@@ -53,7 +53,7 @@ func (pk *PlayerArmourDamage) Marshal(io protocol.IO) {
if bitset&flag != 0 { if bitset&flag != 0 {
damage := int32(0) damage := int32(0)
for _, entry := range pk.List { for _, entry := range pk.List {
if entry.ArmourSlot == flag { if entry.ArmourSlot == int32(flag) {
damage = int32(entry.Damage) damage = int32(entry.Damage)
break break
} }

View File

@@ -175,7 +175,7 @@ type StartGame struct {
EducationSharedResourceURI protocol.EducationSharedResourceURI EducationSharedResourceURI protocol.EducationSharedResourceURI
// ForceExperimentalGameplay specifies if experimental gameplay should be force enabled. For servers this // ForceExperimentalGameplay specifies if experimental gameplay should be force enabled. For servers this
// should always be set to false. // should always be set to false.
ForceExperimentalGameplay protocol.Optional[bool] ForceExperimentalGameplay bool
// LevelID is a base64 encoded world ID that is used to identify the world. // LevelID is a base64 encoded world ID that is used to identify the world.
LevelID string LevelID string
// WorldName is the name of the world that the player is joining. Note that this field shows up above the // WorldName is the name of the world that the player is joining. Note that this field shows up above the
@@ -306,7 +306,7 @@ func (pk *StartGame) Marshal(io protocol.IO) {
io.Int32(&pk.LimitedWorldDepth) io.Int32(&pk.LimitedWorldDepth)
io.Bool(&pk.NewNether) io.Bool(&pk.NewNether)
protocol.Single(io, &pk.EducationSharedResourceURI) protocol.Single(io, &pk.EducationSharedResourceURI)
protocol.OptionalFunc(io, &pk.ForceExperimentalGameplay, io.Bool) io.Bool(&pk.ForceExperimentalGameplay)
io.Uint8(&pk.ChatRestrictionLevel) io.Uint8(&pk.ChatRestrictionLevel)
io.Bool(&pk.DisablePlayerInteractions) io.Bool(&pk.DisablePlayerInteractions)
if proto.IsProtoGTE(io, proto.ID685) { if proto.IsProtoGTE(io, proto.ID685) {

View File

@@ -37,7 +37,7 @@ type BiomeDefinition struct {
// ChunkGeneration is optional information to assist in client-side chunk generation. Almost all servers // ChunkGeneration is optional information to assist in client-side chunk generation. Almost all servers
// can and should leave this empty to greatly reduce the size of this packet. Only BDS and servers which // can and should leave this empty to greatly reduce the size of this packet. Only BDS and servers which
// *exactly* match the vanilla chunk generation can benefit from this. // *exactly* match the vanilla chunk generation can benefit from this.
ChunkGeneration protocol.Optional[protocol.BiomeChunkGeneration] ChunkGeneration protocol.Optional[BiomeChunkGeneration]
} }
func (x *BiomeDefinition) Marshal(r protocol.IO) { func (x *BiomeDefinition) Marshal(r protocol.IO) {
@@ -88,12 +88,14 @@ func (x *BiomeDefinition) FromLatest(bd protocol.BiomeDefinition) BiomeDefinitio
x.MapWaterColour = bd.MapWaterColour x.MapWaterColour = bd.MapWaterColour
x.Rain = bd.Rain x.Rain = bd.Rain
x.Tags = bd.Tags x.Tags = bd.Tags
x.ChunkGeneration = bd.ChunkGeneration if v, ok := bd.ChunkGeneration.Value(); ok {
x.ChunkGeneration = protocol.Option((&BiomeChunkGeneration{}).FromLatest(v))
}
return *x return *x
} }
func (x *BiomeDefinition) ToLatest() protocol.BiomeDefinition { func (x *BiomeDefinition) ToLatest() protocol.BiomeDefinition {
return protocol.BiomeDefinition{ ret := protocol.BiomeDefinition{
NameIndex: x.NameIndex, NameIndex: x.NameIndex,
BiomeID: x.BiomeID, BiomeID: x.BiomeID,
Temperature: x.Temperature, Temperature: x.Temperature,
@@ -108,6 +110,112 @@ func (x *BiomeDefinition) ToLatest() protocol.BiomeDefinition {
MapWaterColour: x.MapWaterColour, MapWaterColour: x.MapWaterColour,
Rain: x.Rain, Rain: x.Rain,
Tags: x.Tags, Tags: x.Tags,
ChunkGeneration: x.ChunkGeneration, }
if v, ok := x.ChunkGeneration.Value(); ok {
ret.ChunkGeneration = protocol.Option(v.ToLatest())
}
return ret
}
// BiomeChunkGeneration represents the information required for the client to generate chunks itself
// to create the illusion of a larger render distance.
type BiomeChunkGeneration struct {
// Climate is optional information to specify the biome's climate.
Climate protocol.Optional[protocol.BiomeClimate]
// ConsolidatedFeatures is a list of features that are consolidated into a single feature.
ConsolidatedFeatures protocol.Optional[[]protocol.BiomeConsolidatedFeature]
// MountainParameters is optional information to specify the biome's mountain parameters.
MountainParameters protocol.Optional[protocol.BiomeMountainParameters]
// SurfaceMaterialAdjustments is a list of surface material adjustments.
SurfaceMaterialAdjustments protocol.Optional[[]protocol.BiomeElementData]
// SurfaceMaterials is a set of materials to use for the surface layers of the biome.
SurfaceMaterials protocol.Optional[protocol.BiomeSurfaceMaterial]
// HasDefaultOverworldSurface is true if the biome has a default overworld surface.
HasDefaultOverworldSurface bool
// HasSwampSurface is true if the biome has a swamp surface.
HasSwampSurface bool
// HasFrozenOceanSurface is true if the biome has a frozen ocean surface.
HasFrozenOceanSurface bool
// HasEndSurface is true if the biome has an end surface.
HasEndSurface bool
// MesaSurface is optional information to specify the biome's mesa surface.
MesaSurface protocol.Optional[protocol.BiomeMesaSurface]
// CappedSurface is optional information to specify the biome's capped surface, i.e. in the Nether.
CappedSurface protocol.Optional[protocol.BiomeCappedSurface]
// OverworldRules is optional information to specify the biome's overworld rules, such as rivers and hills.
OverworldRules protocol.Optional[protocol.BiomeOverworldRules]
// MultiNoiseRules is optional information to specify the biome's multi-noise rules.
MultiNoiseRules protocol.Optional[protocol.BiomeMultiNoiseRules]
// LegacyRules is a list of legacy rules for the biomes using an older format, which is just a list of
// weighted biomes.
LegacyRules protocol.Optional[[]protocol.BiomeConditionalTransformation]
// ReplacementsData is a list of biome replacement data.
ReplacementsData protocol.Optional[[]protocol.BiomeReplacementData]
}
func (x *BiomeChunkGeneration) Marshal(r protocol.IO) {
protocol.OptionalMarshaler(r, &x.Climate)
protocol.OptionalFunc(r, &x.ConsolidatedFeatures, func(s *[]protocol.BiomeConsolidatedFeature) {
protocol.Slice(r, s)
})
protocol.OptionalMarshaler(r, &x.MountainParameters)
protocol.OptionalFunc(r, &x.SurfaceMaterialAdjustments, func(s *[]protocol.BiomeElementData) {
protocol.Slice(r, s)
})
protocol.OptionalMarshaler(r, &x.SurfaceMaterials)
r.Bool(&x.HasDefaultOverworldSurface)
r.Bool(&x.HasSwampSurface)
r.Bool(&x.HasFrozenOceanSurface)
r.Bool(&x.HasEndSurface)
protocol.OptionalMarshaler(r, &x.MesaSurface)
protocol.OptionalMarshaler(r, &x.CappedSurface)
protocol.OptionalMarshaler(r, &x.OverworldRules)
protocol.OptionalMarshaler(r, &x.MultiNoiseRules)
protocol.OptionalFunc(r, &x.LegacyRules, func(s *[]protocol.BiomeConditionalTransformation) {
protocol.Slice(r, s)
})
if IsProtoGTE(r, ID859) {
protocol.OptionalFunc(r, &x.ReplacementsData, func(s *[]protocol.BiomeReplacementData) {
protocol.Slice(r, s)
})
}
}
func (x *BiomeChunkGeneration) FromLatest(bcg protocol.BiomeChunkGeneration) BiomeChunkGeneration {
x.Climate = bcg.Climate
x.ConsolidatedFeatures = bcg.ConsolidatedFeatures
x.MountainParameters = bcg.MountainParameters
x.SurfaceMaterialAdjustments = bcg.SurfaceMaterialAdjustments
x.SurfaceMaterials = bcg.SurfaceMaterials
x.HasDefaultOverworldSurface = bcg.HasDefaultOverworldSurface
x.HasSwampSurface = bcg.HasSwampSurface
x.HasFrozenOceanSurface = bcg.HasFrozenOceanSurface
x.HasEndSurface = bcg.HasEndSurface
x.MesaSurface = bcg.MesaSurface
x.CappedSurface = bcg.CappedSurface
x.OverworldRules = bcg.OverworldRules
x.MultiNoiseRules = bcg.MultiNoiseRules
x.LegacyRules = bcg.LegacyRules
x.ReplacementsData = bcg.ReplacementsData
return *x
}
func (x *BiomeChunkGeneration) ToLatest() protocol.BiomeChunkGeneration {
return protocol.BiomeChunkGeneration{
Climate: x.Climate,
ConsolidatedFeatures: x.ConsolidatedFeatures,
MountainParameters: x.MountainParameters,
SurfaceMaterialAdjustments: x.SurfaceMaterialAdjustments,
SurfaceMaterials: x.SurfaceMaterials,
HasDefaultOverworldSurface: x.HasDefaultOverworldSurface,
HasSwampSurface: x.HasSwampSurface,
HasFrozenOceanSurface: x.HasFrozenOceanSurface,
HasEndSurface: x.HasEndSurface,
MesaSurface: x.MesaSurface,
CappedSurface: x.CappedSurface,
OverworldRules: x.OverworldRules,
MultiNoiseRules: x.MultiNoiseRules,
LegacyRules: x.LegacyRules,
ReplacementsData: x.ReplacementsData,
} }
} }

View File

@@ -3,6 +3,7 @@ package proto
import "github.com/sandertv/gophertunnel/minecraft/protocol" import "github.com/sandertv/gophertunnel/minecraft/protocol"
const ( const (
ID859 = 859 // v1.21.120
ID844 = 844 // v1.21.110 ID844 = 844 // v1.21.110
ID827 = 827 // v1.21.100 ID827 = 827 // v1.21.100
ID819 = 819 // v1.21.93 ID819 = 819 // v1.21.93

View File

@@ -129,6 +129,8 @@ func convertPacketFunc(pid uint32, cur func() packet.Packet) func() packet.Packe
return func() packet.Packet { return &legacypacket.SubChunk{} } return func() packet.Packet { return &legacypacket.SubChunk{} }
case packet.IDGameRulesChanged: case packet.IDGameRulesChanged:
return func() packet.Packet { return &legacypacket.GameRulesChanged{} } return func() packet.Packet { return &legacypacket.GameRulesChanged{} }
case packet.IDAnimate:
return func() packet.Packet { return &legacypacket.Animate{} }
default: default:
return cur return cur
} }
@@ -397,6 +399,9 @@ func (p *Protocol) downgradePackets(pks []packet.Packet, conn *minecraft.Conn) [
Target: pk.Target, Target: pk.Target,
RemoveTarget: pk.RemoveTarget, RemoveTarget: pk.RemoveTarget,
FieldOfView: pk.FieldOfView, FieldOfView: pk.FieldOfView,
Spline: pk.Spline,
AttachToEntity: pk.AttachToEntity,
DetachFromEntity: pk.DetachFromEntity,
} }
case *packet.ChangeDimension: case *packet.ChangeDimension:
pks[pkIndex] = &legacypacket.ChangeDimension{ pks[pkIndex] = &legacypacket.ChangeDimension{
@@ -754,6 +759,13 @@ func (p *Protocol) downgradePackets(pks []packet.Packet, conn *minecraft.Conn) [
pks[pkIndex] = &legacypacket.GameRulesChanged{ pks[pkIndex] = &legacypacket.GameRulesChanged{
GameRules: pk.GameRules, GameRules: pk.GameRules,
} }
case *packet.Animate:
pks[pkIndex] = &legacypacket.Animate{
ActionType: pk.ActionType,
EntityRuntimeID: pk.EntityRuntimeID,
Data: pk.Data,
RowingTime: pk.RowingTime,
}
} }
} }
@@ -977,6 +989,9 @@ func (p *Protocol) upgradePackets(pks []packet.Packet, conn *minecraft.Conn) []p
Target: pk.Target, Target: pk.Target,
RemoveTarget: pk.RemoveTarget, RemoveTarget: pk.RemoveTarget,
FieldOfView: pk.FieldOfView, FieldOfView: pk.FieldOfView,
Spline: pk.Spline,
AttachToEntity: pk.AttachToEntity,
DetachFromEntity: pk.DetachFromEntity,
} }
case *legacypacket.ChangeDimension: case *legacypacket.ChangeDimension:
pks[pkIndex] = &packet.ChangeDimension{ pks[pkIndex] = &packet.ChangeDimension{
@@ -1296,6 +1311,13 @@ func (p *Protocol) upgradePackets(pks []packet.Packet, conn *minecraft.Conn) []p
pks[pkIndex] = &packet.GameRulesChanged{ pks[pkIndex] = &packet.GameRulesChanged{
GameRules: pk.GameRules, GameRules: pk.GameRules,
} }
case *legacypacket.Animate:
pks[pkIndex] = &packet.Animate{
ActionType: pk.ActionType,
EntityRuntimeID: pk.EntityRuntimeID,
Data: pk.Data,
RowingTime: pk.RowingTime,
}
} }
} }
return pks return pks

View File

@@ -3,6 +3,7 @@ package legacyver
import ( import (
_ "embed" _ "embed"
"github.com/akmalfairuz/legacy-version/legacyver/proto"
"github.com/akmalfairuz/legacy-version/mapping" "github.com/akmalfairuz/legacy-version/mapping"
) )
@@ -10,25 +11,23 @@ const (
// ItemVersion844 ... // ItemVersion844 ...
ItemVersion844 = 241 ItemVersion844 = 241
// BlockVersion844 ... // BlockVersion844 ...
BlockVersion844 int32 = (1 << 24) | (21 << 16) | (110 << 8) BlockVersion844 int32 = (1 << 24) | (21 << 16) | (111 << 8)
) )
var ( var (
//go:embed data/dragonfly_items.json
dragonflyLatestItemList []byte
//go:embed data/required_item_list_844.json //go:embed data/required_item_list_844.json
requiredItemList844 []byte requiredItemList844 []byte
//go:embed data/block_states_844.nbt //go:embed data/block_states_844.nbt
blockStateData844 []byte blockStateData844 []byte
itemMappingLatestPocketMine = mapping.NewItemMapping(requiredItemList844, ItemVersion844)
itemMappingLatestDragonfly = mapping.NewItemMapping(dragonflyLatestItemList, ItemVersion844)
blockMappingLatest = mapping.NewBlockMapping(blockStateData844)
) )
func itemMappingLatest(dragonflyMapping bool) mapping.Item { func New844(dragonflyMapping bool) *Protocol {
if dragonflyMapping { itemMapping := mapping.NewItemMapping(requiredItemList844, ItemVersion844)
return itemMappingLatestDragonfly blockTranslator := lookupOrCreateBlockTranslator(844, BlockVersion844, blockStateData844)
return &Protocol{
ver: "1.21.111",
id: proto.ID844,
blockTranslator: blockTranslator,
itemTranslator: NewItemTranslator(itemMapping, itemMappingLatest(dragonflyMapping), blockTranslator.BlockMapping(), blockMappingLatest),
} }
return itemMappingLatestPocketMine
} }

34
legacyver/v859.go Normal file
View File

@@ -0,0 +1,34 @@
package legacyver
import (
_ "embed"
"github.com/akmalfairuz/legacy-version/mapping"
)
const (
// ItemVersion859 ...
ItemVersion859 = 241
// BlockVersion859 ...
BlockVersion859 int32 = (1 << 24) | (21 << 16) | (120 << 8)
)
var (
//go:embed data/dragonfly_items.json
dragonflyLatestItemList []byte
//go:embed data/required_item_list_859.json
requiredItemList859 []byte
//go:embed data/block_states_859.nbt
blockStateData859 []byte
itemMappingLatestPocketMine = mapping.NewItemMapping(requiredItemList859, ItemVersion859)
itemMappingLatestDragonfly = mapping.NewItemMapping(dragonflyLatestItemList, ItemVersion859)
blockMappingLatest = mapping.NewBlockMapping(blockStateData859)
)
func itemMappingLatest(dragonflyMapping bool) mapping.Item {
if dragonflyMapping {
return itemMappingLatestDragonfly
}
return itemMappingLatestPocketMine
}