Skip to content

Commit

Permalink
dragonfly: Use Go 1.21 and use std slices package
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Nov 5, 2023
1 parent 21e8df6 commit 884aaa5
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/df-mc/dragonfly

go 1.19
go 1.21

require (
github.com/brentp/intintmap v0.0.0-20190211203843-30dc0ade9af9
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ 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.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/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
Expand Down Expand Up @@ -59,6 +60,7 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
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=
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=
Expand Down Expand Up @@ -124,3 +126,4 @@ gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion server/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/google/uuid"
"github.com/sandertv/gophertunnel/minecraft/resource"
"github.com/sirupsen/logrus"
"golang.org/x/exp/slices"
"os"
"path/filepath"
"slices"
)

// Config contains options for starting a Minecraft server.
Expand Down
2 changes: 1 addition & 1 deletion server/entity/experience_orb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/df-mc/dragonfly/server/internal/nbtconv"
"github.com/df-mc/dragonfly/server/world"
"github.com/go-gl/mathgl/mgl64"
"golang.org/x/exp/slices"
"slices"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion server/internal/blockinternal/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package blockinternal
import (
"github.com/df-mc/dragonfly/server/item/category"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"slices"
)

// ComponentBuilder represents a builder that can be used to construct a block components map to be sent to a client.
Expand Down
2 changes: 1 addition & 1 deletion server/internal/sliceutil/sliceutil.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sliceutil

import "golang.org/x/exp/slices"
import "slices"

Check failure on line 3 in server/internal/sliceutil/sliceutil.go

View workflow job for this annotation

GitHub Actions / Build

package slices is not in GOROOT (/opt/hostedtoolcache/go/1.19.13/x64/src/slices)

Check failure on line 3 in server/internal/sliceutil/sliceutil.go

View workflow job for this annotation

GitHub Actions / Build

package slices is not in GOROOT (/opt/hostedtoolcache/go/1.19.13/x64/src/slices)

// Convert converts a slice of type B to a slice of type A. Convert panics if B
// cannot be type asserted to type A.
Expand Down
2 changes: 1 addition & 1 deletion server/item/book_and_quill.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package item

import "golang.org/x/exp/slices"
import "slices"

// BookAndQuill is an item used to write WrittenBook(s).
type BookAndQuill struct {
Expand Down
2 changes: 1 addition & 1 deletion server/item/inventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"fmt"
"github.com/df-mc/dragonfly/server/item"
"golang.org/x/exp/slices"
"math"
"slices"
"strings"
"sync"
)
Expand Down
2 changes: 1 addition & 1 deletion server/item/recipe/register.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package recipe

import (
"golang.org/x/exp/slices"
"slices"
)

// recipes is a list of each recipe.
Expand Down
2 changes: 1 addition & 1 deletion server/item/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package item
import (
"fmt"
"github.com/df-mc/dragonfly/server/world"
"golang.org/x/exp/slices"
"reflect"
"slices"
"sort"
"strings"
"sync/atomic"
Expand Down
2 changes: 1 addition & 1 deletion server/player/scoreboard/scoreboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package scoreboard

import (
"fmt"
"golang.org/x/exp/slices"
"slices"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion server/session/handler_crafting.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/df-mc/dragonfly/server/item/recipe"
"github.com/df-mc/dragonfly/server/world"
"github.com/sandertv/gophertunnel/minecraft/protocol"
"golang.org/x/exp/slices"
"math"
"slices"
)

// handleCraft handles the CraftRecipe request action.
Expand Down
2 changes: 1 addition & 1 deletion server/session/handler_enchanting.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/df-mc/dragonfly/server/world"
"github.com/sandertv/gophertunnel/minecraft/protocol"
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
"golang.org/x/exp/slices"
"math"
"math/rand"
"slices"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion server/world/block_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/df-mc/dragonfly/server/world/chunk"
"github.com/sandertv/gophertunnel/minecraft/nbt"
"github.com/segmentio/fasthash/fnv1"
"golang.org/x/exp/slices"
"math"
"slices"
"sort"
"strings"
"unsafe"
Expand Down
2 changes: 1 addition & 1 deletion server/world/tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/dragonfly/server/internal/sliceutil"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"math/rand"
"slices"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion server/world/world.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/go-gl/mathgl/mgl64"
"github.com/google/uuid"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"slices"
)

// World implements a Minecraft world. It manages all aspects of what players can see, such as blocks,
Expand Down

0 comments on commit 884aaa5

Please sign in to comment.