From bd6fb236659e689094fd5835645e2012f0eac491 Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Sat, 9 Dec 2023 19:04:02 -0800 Subject: [PATCH 1/7] workflows: Update actions --- .github/workflows/pr.yml | 8 ++++---- .github/workflows/push.yml | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 198c2874b..be470a410 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,15 +7,15 @@ jobs: runs-on: ubuntu-latest steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go 1.21 - uses: actions/setup-go@v1 + uses: actions/setup-go@v5 with: go-version: 1.21 id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - name: Get dependencies run: | mkdir -p $GOPATH/bin diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index da7fbfe7e..416f04d4c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,15 +7,15 @@ jobs: runs-on: ubuntu-latest steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go 1.21 - uses: actions/setup-go@v1 + uses: actions/setup-go@v5 with: go-version: 1.21 id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - name: Get dependencies run: | mkdir -p $GOPATH/bin @@ -42,14 +42,14 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.19 - uses: actions/setup-go@v1 + - name: Set up Go 1.21 + uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.21 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get dependencies run: | @@ -101,6 +101,6 @@ jobs: echo $CONTRIBUTOR_DATA if [ $(echo $CONTRIBUTOR_DATA | jq type) == '"array"' ]; then echo -e "// Code generated by .github/workflows/push.yml; DO NOT EDIT\n\npackage session\n\n// enchantNames are names translated to the 'Standard Galactic Alphabet' client-side. The names generally have no meaning\n// on the vanilla server implementation, so we can sneak some easter eggs in here without anyone noticing.\nvar enchantNames = []string{"$(echo $CONTRIBUTOR_DATA | jq .[].login | sed -r -e "s/([^A-Z\"])([A-Z])/\1 \2/g" | sed "s/./\L&/g" | sort | sed -z "s/\n/,/g")"}" > server/session/enchantment_texts.go && gofmt -w server/session/enchantment_texts.go; fi - name: Push Changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "updated contributor list" From db42c3a1a9d7afe79083cb0b4db855ae04cc9ef5 Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Sat, 9 Dec 2023 19:18:41 -0800 Subject: [PATCH 2/7] chunk/paletted_storage.go: Replace usage of deprecated `reflect.SliceHeader` --- server/world/chunk/paletted_storage.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/world/chunk/paletted_storage.go b/server/world/chunk/paletted_storage.go index 89a7e4538..f7964ea44 100644 --- a/server/world/chunk/paletted_storage.go +++ b/server/world/chunk/paletted_storage.go @@ -2,7 +2,6 @@ package chunk import ( "bytes" - "reflect" "unsafe" ) @@ -46,7 +45,7 @@ func newPalettedStorage(indices []uint32, palette *Palette) *PalettedStorage { var ( bitsPerIndex = uint16(len(indices) / uint32BitSize / uint32ByteSize) indexMask = (uint32(1) << bitsPerIndex) - 1 - indicesStart = (unsafe.Pointer)((*reflect.SliceHeader)(unsafe.Pointer(&indices)).Data) + indicesStart = (unsafe.Pointer)(unsafe.SliceData(indices)) filledBitsPerIndex uint16 ) if bitsPerIndex != 0 { From 9cf056c0e51a8a5128389f24e3308c849551dc9e Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Sat, 9 Dec 2023 20:00:10 -0800 Subject: [PATCH 3/7] block/ender_chest.go: Use `df-mc/atomic` --- go.mod | 1 - go.sum | 4 ++-- server/block/ender_chest.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index ae3ef8ec4..161c1fa5a 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,6 @@ require ( github.com/sandertv/gophertunnel v1.34.0 github.com/segmentio/fasthash v1.0.3 github.com/sirupsen/logrus v1.9.0 - go.uber.org/atomic v1.10.0 golang.org/x/exp v0.0.0-20230206171751-46f607a40771 golang.org/x/text v0.7.0 ) diff --git a/go.sum b/go.sum index 64c2ed10d..e68375dcf 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= diff --git a/server/block/ender_chest.go b/server/block/ender_chest.go index 313423b28..1073b9a54 100644 --- a/server/block/ender_chest.go +++ b/server/block/ender_chest.go @@ -1,13 +1,13 @@ package block import ( + "github.com/df-mc/atomic" "github.com/df-mc/dragonfly/server/block/cube" "github.com/df-mc/dragonfly/server/item" "github.com/df-mc/dragonfly/server/item/inventory" "github.com/df-mc/dragonfly/server/world" "github.com/df-mc/dragonfly/server/world/sound" "github.com/go-gl/mathgl/mgl64" - "go.uber.org/atomic" ) // enderChestOwner represents an entity that has an ender chest inventory. From 4a5bc25b1fb4b9a62164186cca486e224aeadfcd Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Sun, 10 Dec 2023 04:32:38 -0800 Subject: [PATCH 4/7] go.mod: Bump various packages --- go.mod | 16 ++++++++-------- go.sum | 40 +++++++++++++++++++++------------------- server/session/chunk.go | 2 +- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 161c1fa5a..3f8da3ce7 100644 --- a/go.mod +++ b/go.mod @@ -4,22 +4,23 @@ go 1.21 require ( github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9 - github.com/cespare/xxhash v1.1.0 + github.com/cespare/xxhash/v2 v2.2.0 github.com/df-mc/atomic v1.10.0 github.com/df-mc/goleveldb v1.1.9 github.com/df-mc/worldupgrader v1.0.11 - github.com/go-gl/mathgl v1.0.0 - github.com/google/uuid v1.3.0 + github.com/go-gl/mathgl v1.1.0 + github.com/google/uuid v1.4.0 github.com/pelletier/go-toml v1.9.5 - github.com/rogpeppe/go-internal v1.9.0 - github.com/sandertv/gophertunnel v1.34.0 + github.com/rogpeppe/go-internal v1.11.0 + github.com/sandertv/gophertunnel v1.34.1 github.com/segmentio/fasthash v1.0.3 - github.com/sirupsen/logrus v1.9.0 + github.com/sirupsen/logrus v1.9.3 golang.org/x/exp v0.0.0-20230206171751-46f607a40771 - golang.org/x/text v0.7.0 + golang.org/x/text v0.14.0 ) require ( + github.com/go-jose/go-jose/v3 v3.0.1 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/klauspost/compress v1.15.15 // indirect @@ -32,6 +33,5 @@ require ( golang.org/x/sys v0.5.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect ) diff --git a/go.sum b/go.sum index e68375dcf..023d3986f 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,7 @@ -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9 h1:/G0ghZwrhou0Wq21qc1vXXMm/t/aKWkALWwITptKbE0= github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9/go.mod h1:TOk10ahXejq9wkEaym3KPRNeuR/h5Jx+s8QRWIa2oTM= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -14,8 +12,10 @@ github.com/df-mc/goleveldb v1.1.9/go.mod h1:+NHCup03Sci5q84APIA21z3iPZCuk6m6ABtg github.com/df-mc/worldupgrader v1.0.11 h1:7dlebxDXY8QND3MnDPnty7qeAqtxJE8kVqvs6VDs1YI= github.com/df-mc/worldupgrader v1.0.11/go.mod h1:tsSOLTRm9mpG7VHvYpAjjZrkRHWmSbKZAm9bOLNnlDk= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/go-gl/mathgl v1.0.0 h1:t9DznWJlXxxjeeKLIdovCOVJQk/GzDEL7h/h+Ro2B68= -github.com/go-gl/mathgl v1.0.0/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ= +github.com/go-gl/mathgl v1.1.0 h1:0lzZ+rntPX3/oGrDzYGdowSLC2ky8Osirvf5uAwfIEA= +github.com/go-gl/mathgl v1.1.0/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ= +github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= +github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= @@ -24,11 +24,12 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= @@ -45,19 +46,18 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/sandertv/go-raknet v1.12.0 h1:olUzZlIJyX/pgj/mrsLCZYjKLNDsYiWdvQ4NIm3z0DA= github.com/sandertv/go-raknet v1.12.0/go.mod h1:Gx+WgZBMQ0V2UoouGoJ8Wj6CDrMBQ4SB2F/ggpl5/+Y= -github.com/sandertv/gophertunnel v1.34.0 h1:fHXTPL4+hUJFF5xObM9T07GpXkTdSvKmYAvx65k0IAw= -github.com/sandertv/gophertunnel v1.34.0/go.mod h1:+Dbhj3bs74gZoSkyab7kglx1Rbq8S5G7sJd/wr5Qm9g= +github.com/sandertv/gophertunnel v1.34.1 h1:gRU9KVT8GewlSPRCn3sQNw6RbTGyd02yyXZOXyIjz+o= +github.com/sandertv/gophertunnel v1.34.1/go.mod h1:4El8ZfEpUmOMIJhPt5SCc1PyLNiuQ2+grWczrBvSGVs= 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/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -65,6 +65,7 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= @@ -75,6 +76,7 @@ golang.org/x/image v0.5.0 h1:5JMiNunQeQw++mMOz48/ISeNu3Iweh/JaZU8ZLqHRrI= golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -88,6 +90,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -101,8 +104,9 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -117,8 +121,6 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw 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/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= -gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/server/session/chunk.go b/server/session/chunk.go index 054ed64b7..604e88497 100644 --- a/server/session/chunk.go +++ b/server/session/chunk.go @@ -2,7 +2,7 @@ package session import ( "bytes" - "github.com/cespare/xxhash" + "github.com/cespare/xxhash/v2" "github.com/df-mc/dragonfly/server/block/cube" "github.com/df-mc/dragonfly/server/world" "github.com/df-mc/dragonfly/server/world/chunk" From 2bc3ab50ab68ac94be58c17c04a3b5c437455e8c Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Sun, 10 Dec 2023 04:45:21 -0800 Subject: [PATCH 5/7] workflows/push.yml: Use `dominikh/staticcheck-action` action --- .github/workflows/pr.yml | 7 +++---- .github/workflows/push.yml | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index be470a410..342e5d635 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -31,7 +31,6 @@ jobs: run: test -z $(go fmt ./...) - name: Staticcheck - run: | - go get honnef.co/go/tools/cmd/staticcheck - GOBIN=$PWD/bin go install honnef.co/go/tools/cmd/staticcheck - ./bin/staticcheck ./... \ No newline at end of file + uses: dominikh/staticcheck-action@v1.3.0 + with: + install-go: false \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 416f04d4c..5d6217ba8 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -31,10 +31,9 @@ jobs: run: test -z $(go fmt ./...) - name: Staticcheck - run: | - go get honnef.co/go/tools/cmd/staticcheck@v0.3 - GOBIN=$PWD/bin go install honnef.co/go/tools/cmd/staticcheck@v0.3 - ./bin/staticcheck ./... + uses: dominikh/staticcheck-action@v1.3.0 + with: + install-go: false deploy: name: Deploy From 28165eee2979aa3bf980e009754a0bae0ad19073 Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Sun, 10 Dec 2023 04:57:45 -0800 Subject: [PATCH 6/7] server/server.go: Remove deprecated usage of `rand.Seed` As of Go 1.20, the global `math/rand` is automatically seeded. --- server/server.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/server/server.go b/server/server.go index adf2700d9..e8bae1f35 100644 --- a/server/server.go +++ b/server/server.go @@ -27,7 +27,6 @@ import ( "github.com/sandertv/gophertunnel/minecraft/text" "github.com/sirupsen/logrus" "golang.org/x/exp/maps" - "math/rand" "os" "os/exec" "os/signal" @@ -35,7 +34,6 @@ import ( "strings" "sync" "syscall" - "time" ) // Server implements a Dragonfly server. It runs the main server loop and @@ -608,8 +606,5 @@ var ( // values in the runtime ID maps. init also seeds the global `rand` with the // current time. func init() { - // Seeding the random for things like lightning that need to use RNG. - rand.Seed(time.Now().UnixNano()) - _ = nbt.Unmarshal(itemRuntimeIDData, &itemRuntimeIDs) } From fa4fca036f0f520f09ea8b24738a67a751ffa9bd Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Sun, 10 Dec 2023 05:02:12 -0800 Subject: [PATCH 7/7] README.md: Update minimum Go version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc6e3792f..9288c32e6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Minecraft server software, Dragonfly is generally used as a library to extend. [![Discord Banner 2](https://discordapp.com/api/guilds/623638955262345216/widget.png?style=banner2)](https://discord.gg/U4kFWHhTNR) ## Getting started -Running Dragonfly requires at least **Go 1.18**. After starting the server through one of the methods below, +Running Dragonfly requires at least **Go 1.21**. After starting the server through one of the methods below, **ctrl+c** may be used to shut down the server. Also check out the [wiki](https://github.com/df-mc/dragonfly/wiki) for more detailed info.