diff --git a/server/block/banner.go b/server/block/banner.go index 97bd8b32c..6efa952b9 100644 --- a/server/block/banner.go +++ b/server/block/banner.go @@ -9,7 +9,7 @@ import ( "time" ) -// Banner is a tall decorative block that can be customized. +// Banner is a tall decorative block that can be customised. type Banner struct { empty transparent diff --git a/server/block/banner_pattern_type.go b/server/block/banner_pattern_type.go index df62bb8bc..b577124c6 100644 --- a/server/block/banner_pattern_type.go +++ b/server/block/banner_pattern_type.go @@ -2,7 +2,7 @@ package block import "github.com/df-mc/dragonfly/server/item" -// BannerPatternType represents a type of banner pattern, used to customize banners. +// BannerPatternType represents a type of banner pattern, used to customise banners. type BannerPatternType struct { bannerPatternType } @@ -142,8 +142,8 @@ func StripeBottomBannerPattern() BannerPatternType { return BannerPatternType{26} } -// StripeCenterBannerPattern represents the 'Stripe Center' banner pattern type. -func StripeCenterBannerPattern() BannerPatternType { +// StripeCentreBannerPattern represents the 'Stripe Center' banner pattern type. +func StripeCentreBannerPattern() BannerPatternType { return BannerPatternType{27} } @@ -247,7 +247,7 @@ func BannerPatternTypes() []BannerPatternType { SquareTopRightBannerPattern(), StraightCrossBannerPattern(), StripeBottomBannerPattern(), - StripeCenterBannerPattern(), + StripeCentreBannerPattern(), StripeDownLeftBannerPattern(), StripeDownRightBannerPattern(), StripeLeftBannerPattern(), diff --git a/server/block/banner_pattern_type_register.go b/server/block/banner_pattern_type_register.go index 50348d10a..f6a6d9014 100644 --- a/server/block/banner_pattern_type_register.go +++ b/server/block/banner_pattern_type_register.go @@ -5,7 +5,7 @@ var ( bannerPatternIDs = map[BannerPatternType]string{} ) -// init initializes all default banner patterns to the registry. +// init initialises all default banner patterns to the registry. func init() { registerBannerPattern("bo", BorderBannerPattern()) registerBannerPattern("bri", BricksBannerPattern()) @@ -34,7 +34,7 @@ func init() { registerBannerPattern("tr", SquareTopRightBannerPattern()) registerBannerPattern("sc", StraightCrossBannerPattern()) registerBannerPattern("bs", StripeBottomBannerPattern()) - registerBannerPattern("cs", StripeCenterBannerPattern()) + registerBannerPattern("cs", StripeCentreBannerPattern()) registerBannerPattern("dls", StripeDownLeftBannerPattern()) registerBannerPattern("drs", StripeDownRightBannerPattern()) registerBannerPattern("ls", StripeLeftBannerPattern()) diff --git a/server/block/blast_furnace.go b/server/block/blast_furnace.go index f76f5c8b2..8ada6f2fa 100644 --- a/server/block/blast_furnace.go +++ b/server/block/blast_furnace.go @@ -11,8 +11,8 @@ import ( "time" ) -// BlastFurnace is a block that smelts ores, raw metals, iron and gold armor and tools, similar to a furnace, but at -// twice the speed. It also serves as an armorer's job site block. +// BlastFurnace is a block that smelts ores, raw metals, iron and gold armour and tools, similar to a furnace, but at +// twice the speed. It also serves as an armourer's job site block. // The empty value of BlastFurnace is not valid. It must be created using block.NewBlastFurnace(cube.Face). type BlastFurnace struct { solid diff --git a/server/block/block.go b/server/block/block.go index 2c55d99b9..c89d76304 100644 --- a/server/block/block.go +++ b/server/block/block.go @@ -239,11 +239,11 @@ func (g gravityAffected) fall(b world.Block, pos cube.Pos, tx *world.Tx) { // Flammable is an interface for blocks that can catch on fire. type Flammable interface { - // FlammabilityInfo returns information about a block's behavior involving fire. + // FlammabilityInfo returns information about a block's behaviour involving fire. FlammabilityInfo() FlammabilityInfo } -// FlammabilityInfo contains values related to block behaviors involving fire. +// FlammabilityInfo contains values related to block behaviours involving fire. type FlammabilityInfo struct { // Encouragement is the chance a block will catch on fire during attempted fire spread. Encouragement int diff --git a/server/block/enchanting_table.go b/server/block/enchanting_table.go index 8ccdb626c..dbba12fc4 100644 --- a/server/block/enchanting_table.go +++ b/server/block/enchanting_table.go @@ -8,7 +8,7 @@ import ( ) // EnchantingTable is a block that allows players to spend their experience point levels to enchant tools, weapons, -// books, armor, and certain other items. +// books, armour, and certain other items. type EnchantingTable struct { transparent bassDrum diff --git a/server/block/smelter.go b/server/block/smelter.go index a88062462..f0aff4aa9 100644 --- a/server/block/smelter.go +++ b/server/block/smelter.go @@ -25,7 +25,7 @@ type smelter struct { experience int } -// newSmelter initializes a new smelter with the given remaining, maximum, and cook durations and XP, and returns it. +// newSmelter initialises a new smelter with the given remaining, maximum, and cook durations and XP, and returns it. func newSmelter() *smelter { s := &smelter{viewers: make(map[ContainerViewer]struct{})} s.inventory = inventory.New(3, func(slot int, _, item item.Stack) { @@ -189,13 +189,13 @@ func (s *smelter) tickSmelting(requirement, decrement time.Duration, lit bool, s fuel, _ := s.inventory.Item(1) product, _ := s.inventory.Item(2) - // Initialize some default smelt info, and update it if we can smelt the item. + // Initialise some default smelt info, and update it if we can smelt the item. var inputInfo item.SmeltInfo if i, ok := input.Item().(item.Smeltable); ok && supported(i.SmeltInfo()) { inputInfo = i.SmeltInfo() } - // Initialize some default fuel info, and update it if it can be used as fuel. + // Initialise some default fuel info, and update it if it can be used as fuel. var fuelInfo item.FuelInfo if f, ok := fuel.Item().(item.Fuel); ok { fuelInfo = f.FuelInfo() diff --git a/server/block/vine.go b/server/block/vine.go index c753b9b00..66e32b451 100644 --- a/server/block/vine.go +++ b/server/block/vine.go @@ -286,7 +286,7 @@ func (Vines) canSpreadTo(tx *world.Tx, pos cube.Pos) bool { // canSpread returns true if the vines can spread from the given position. Vines // may only spread horizontally or upwards if there are fewer than 4 vines within -// a 9x9x3 area centered around the Vines. +// a 9x9x3 area centred around the Vines. func (v Vines) canSpread(tx *world.Tx, pos cube.Pos) bool { var count int for x := -4; x <= 4; x++ { @@ -294,7 +294,7 @@ func (v Vines) canSpread(tx *world.Tx, pos cube.Pos) bool { for y := -1; y <= 1; y++ { if _, ok := tx.Block(pos.Add(cube.Pos{x, y, z})).(Vines); ok { count++ - // The center vine is counted, for a max of 4+1=5. + // The centre vine is counted, for a max of 4+1=5. if count >= 5 { return false } diff --git a/server/item/armour.go b/server/item/armour.go index d866d236f..935c453ac 100644 --- a/server/item/armour.go +++ b/server/item/armour.go @@ -9,7 +9,7 @@ type ( Armour interface { // DefencePoints returns the defence points that the armour provides when worn. DefencePoints() float64 - // Toughness returns the toughness that the armor provides when worn. The toughness reduces defense reduction + // Toughness returns the toughness that the armour provides when worn. The toughness reduces defence reduction // caused by increased damage. Toughness() float64 // KnockBackResistance returns a number from 0-1 that decides the amount of knock back force that is @@ -22,7 +22,7 @@ type ( // BaseDurability is the base durability of armour with this tier. This is otherwise the durability of // the helmet with this tier. BaseDurability() float64 - // Toughness reduces the defense reduction caused by damage increases. + // Toughness reduces the defence reduction caused by damage increases. Toughness() float64 // KnockBackResistance is a number from 0-1 that decides the amount of knock back force that is resisted // upon being attacked. 1 knock back resistance point client-side translates to 10% knock back reduction. diff --git a/server/item/banner_pattern.go b/server/item/banner_pattern.go index 564f938b9..efd0f84dd 100644 --- a/server/item/banner_pattern.go +++ b/server/item/banner_pattern.go @@ -1,6 +1,6 @@ package item -// BannerPattern is an item used to customize banners inside looms. +// BannerPattern is an item used to customise banners inside looms. type BannerPattern struct { // Type represents the type of banner pattern. These types do not include all patterns that can be applied to a // banner. diff --git a/server/item/inventory/armour.go b/server/item/inventory/armour.go index 86871eb0d..87ea2d10f 100644 --- a/server/item/inventory/armour.go +++ b/server/item/inventory/armour.go @@ -125,8 +125,8 @@ func (a *Armour) DamageReduction(dmg float64, src world.DamageSource) float64 { dmg -= dmg * enchantment.ProtectionFactor(src, enchantments) if src.ReducedByArmour() { // Armour in Bedrock edition reduces the damage taken by 4% for each effective armour point. Effective - // armour point decreases as damage increases, with 1 point lost for every 2 HP of damage. The defense - // reduction is decreased by the toughness armor value. Effective armour points will at minimum be 20% of + // armour point decreases as damage increases, with 1 point lost for every 2 HP of damage. The defence + // reduction is decreased by the toughness armour value. Effective armour points will at minimum be 20% of // armour points. dmg -= dmg * 0.04 * math.Max(defencePoints*0.2, defencePoints-dmg/(2+toughness/4)) } diff --git a/server/item/iron_nugget.go b/server/item/iron_nugget.go index f2fc759c1..a3d06c93e 100644 --- a/server/item/iron_nugget.go +++ b/server/item/iron_nugget.go @@ -1,6 +1,6 @@ package item -// IronNugget is a piece of iron that can be obtained by smelting iron tools/weapons or iron/chainmail armor. +// IronNugget is a piece of iron that can be obtained by smelting iron tools/weapons or iron/chainmail armour. type IronNugget struct{} // EncodeItem ... diff --git a/server/item/leather.go b/server/item/leather.go index 1eee7e242..c2492d09b 100644 --- a/server/item/leather.go +++ b/server/item/leather.go @@ -1,6 +1,6 @@ package item -// Leather is an animal skin used to make item frames, armor and books. +// Leather is an animal skin used to make item frames, armour and books. type Leather struct{} // EncodeItem ... diff --git a/server/item/resin_brick.go b/server/item/resin_brick.go index c5c2c91d2..b039f0e80 100644 --- a/server/item/resin_brick.go +++ b/server/item/resin_brick.go @@ -3,7 +3,7 @@ package item import "github.com/sandertv/gophertunnel/minecraft/text" // ResinBrick is an item used to create resin bricks. It can also be used as a -// smithing ingredient, giving orange details to pieces of armor. +// smithing ingredient, giving orange details to pieces of armour. type ResinBrick struct{} // EncodeItem ... diff --git a/server/player/debug/shape.go b/server/player/debug/shape.go index ad37efe31..fecd55af8 100644 --- a/server/player/debug/shape.go +++ b/server/player/debug/shape.go @@ -16,7 +16,7 @@ type Shape interface { } // shape is a base type for all shapes that implements the Shape interface. It contains a unique identifier -// that is lazily initialized when the ShapeID method is called for the first time. +// that is lazily initialised when the ShapeID method is called for the first time. type shape struct { id *int } diff --git a/server/player/playerdb/inventory.go b/server/player/playerdb/inventory.go index aaf60a7f2..435b56eef 100644 --- a/server/player/playerdb/inventory.go +++ b/server/player/playerdb/inventory.go @@ -10,9 +10,9 @@ import ( // InventoryData is a struct that contains all data of the player inventories. type InventoryData struct { // Items contains all the items in the player's main inventory. - // This excludes armor and offhand. + // This excludes armour and offhand. Items []item.Stack - // Boots, Leggings, Chestplate, Helmet are armor pieces that belong to the slot corresponding to the name. + // Boots, Leggings, Chestplate, Helmet are armour pieces that belong to the slot corresponding to the name. Boots item.Stack Leggings item.Stack Chestplate item.Stack diff --git a/server/server.go b/server/server.go index b02676693..63c673617 100644 --- a/server/server.go +++ b/server/server.go @@ -370,7 +370,7 @@ func (srv *Server) startListening() { } } -// makeBlockEntries initializes the server's block components map using the +// makeBlockEntries initialises the server's block components map using the // registered custom blocks. It allows block components to be created only once // at startup. func (srv *Server) makeBlockEntries() { @@ -386,7 +386,7 @@ func (srv *Server) makeBlockEntries() { } } -// makeItemComponents initializes the server's item components map using the +// makeItemComponents initialises the server's item components map using the // registered custom items. It allows item components to be created only once // at startup func (srv *Server) makeItemComponents() { diff --git a/server/session/chunk.go b/server/session/chunk.go index e2b3b337b..45159531d 100644 --- a/server/session/chunk.go +++ b/server/session/chunk.go @@ -26,20 +26,20 @@ func (s *Session) ViewChunk(pos world.ChunkPos, dim world.Dimension, blockEntiti } // ViewSubChunks ... -func (s *Session) ViewSubChunks(center world.SubChunkPos, offsets []protocol.SubChunkOffset, tx *world.Tx) { +func (s *Session) ViewSubChunks(centre world.SubChunkPos, offsets []protocol.SubChunkOffset, tx *world.Tx) { r := tx.Range() entries := make([]protocol.SubChunkEntry, 0, len(offsets)) transaction := make(map[uint64]struct{}) for _, offset := range offsets { - ind := int16(center.Y()) + int16(offset[1]) - int16(r[0])>>4 + ind := int16(centre.Y()) + int16(offset[1]) - int16(r[0])>>4 if ind < 0 || ind > int16(r.Height()>>4) { entries = append(entries, protocol.SubChunkEntry{Result: protocol.SubChunkResultIndexOutOfBounds, Offset: offset}) continue } col, ok := s.chunkLoader.Chunk(world.ChunkPos{ - center.X() + int32(offset[0]), - center.Z() + int32(offset[2]), + centre.X() + int32(offset[0]), + centre.Z() + int32(offset[2]), }) if !ok { entries = append(entries, protocol.SubChunkEntry{Result: protocol.SubChunkResultChunkNotFound, Offset: offset}) @@ -55,7 +55,7 @@ func (s *Session) ViewSubChunks(center world.SubChunkPos, offsets []protocol.Sub dim, _ := world.DimensionID(tx.World().Dimension()) s.writePacket(&packet.SubChunk{ Dimension: int32(dim), - Position: protocol.SubChunkPos(center), + Position: protocol.SubChunkPos(centre), CacheEnabled: s.conn.ClientCacheEnabled(), SubChunkEntries: entries, }) diff --git a/server/session/handler_enchanting.go b/server/session/handler_enchanting.go index 81db41bbb..59b782a4c 100644 --- a/server/session/handler_enchanting.go +++ b/server/session/handler_enchanting.go @@ -267,7 +267,7 @@ func searchBookshelves(tx *world.Tx, pos cube.Pos) (shelves int) { for z := -1; z <= 1; z++ { for y := 0; y <= 1; y++ { if x == 0 && z == 0 { - // Ignore the center block. + // Ignore the centre block. continue } if _, ok := tx.Block(pos.Add(cube.Pos{x, y, z})).(block.Air); !ok { diff --git a/server/session/session.go b/server/session/session.go index f63988a02..15e9208d0 100644 --- a/server/session/session.go +++ b/server/session/session.go @@ -566,9 +566,9 @@ func (s *Session) sendAvailableEntities(w *world.World) { for _, t := range w.EntityRegistry().Types() { identifiers = append(identifiers, actorIdentifier{ID: t.EncodeEntity()}) } - serializedEntityData, err := nbt.Marshal(map[string]any{"idlist": identifiers}) + serialisedEntityData, err := nbt.Marshal(map[string]any{"idlist": identifiers}) if err != nil { panic("should never happen") } - s.writePacket(&packet.AvailableActorIdentifiers{SerialisedEntityIdentifiers: serializedEntityData}) + s.writePacket(&packet.AvailableActorIdentifiers{SerialisedEntityIdentifiers: serialisedEntityData}) } diff --git a/server/world/loader.go b/server/world/loader.go index 7b9b8b39b..e76e86774 100644 --- a/server/world/loader.go +++ b/server/world/loader.go @@ -166,7 +166,7 @@ func (l *Loader) evictUnused(tx *Tx) { // which chunks around the position the loader is now in should be loaded. Chunks are ordered to be loaded // from the middle outwards. func (l *Loader) populateLoadQueue() { - // We'll first load the chunk positions to load in a map indexed by the distance to the center (basically, + // We'll first load the chunk positions to load in a map indexed by the distance to the centre (basically, // what precedence it should have), and put them in the loadQueue in that order. queue := map[int32][]ChunkPos{} diff --git a/server/world/mcdb/leveldat/data.go b/server/world/mcdb/leveldat/data.go index e8ec12595..bf9e2ce6a 100644 --- a/server/world/mcdb/leveldat/data.go +++ b/server/world/mcdb/leveldat/data.go @@ -16,7 +16,7 @@ type Data struct { BaseGameVersion string `nbt:"baseGameVersion"` BiomeOverride string ConfirmedPlatformLockedContent bool - CenterMapsToOrigin bool + CentreMapsToOrigin bool `nbt:"CenterMapsToOrigin"` CheatsEnabled bool `nbt:"cheatsEnabled"` DaylightCycle int32 `nbt:"daylightCycle"` Difficulty int32 diff --git a/server/world/mcdb/leveldat/version.go b/server/world/mcdb/leveldat/version.go index 7d9b0b558..53de90b51 100644 --- a/server/world/mcdb/leveldat/version.go +++ b/server/world/mcdb/leveldat/version.go @@ -13,7 +13,7 @@ const Version = 10 // required by the latest Minecraft data provider. var minimumCompatibleClientVersion []int32 -// init initializes the minimum compatible client version. +// init initialises the minimum compatible client version. func init() { fullVersion := append(strings.Split(protocol.CurrentVersion, "."), "0", "0") for _, v := range fullVersion { diff --git a/server/world/provider.go b/server/world/provider.go index 150bfa4ee..713c38bfb 100644 --- a/server/world/provider.go +++ b/server/world/provider.go @@ -36,7 +36,7 @@ var _ Provider = (*NopProvider)(nil) // NopProvider implements a Provider that does not perform any disk I/O. It generates values on the run and // dynamically, instead of reading and writing data, and otherwise returns empty values. A Settings struct can be passed -// to initialize a world with specific settings. Since Settings is a pointer, using the same NopProvider for multiple +// to initialise a world with specific settings. Since Settings is a pointer, using the same NopProvider for multiple // worlds means those worlds will share the same settings. type NopProvider struct { Set *Settings diff --git a/server/world/world.go b/server/world/world.go index 87e0ac8f3..17e3fc9b0 100644 --- a/server/world/world.go +++ b/server/world/world.go @@ -785,7 +785,7 @@ func (w *World) Spawn() cube.Pos { } // SetSpawn sets the spawn of the world to a different position. The player -// will be spawned in the center of this position when newly joining. +// will be spawned in the centre of this position when newly joining. func (w *World) SetSpawn(pos cube.Pos) { if w == nil { return