From 4cf7559ea07a58719dffd37c6925655d456573c1 Mon Sep 17 00:00:00 2001 From: Sandertv Date: Mon, 25 Nov 2024 18:49:39 +0100 Subject: [PATCH] Changed all unused parameter names to _. --- server/block/anvil.go | 6 +++--- server/block/banner.go | 4 ++-- server/block/barrel.go | 4 ++-- server/block/basalt.go | 2 +- server/block/beacon.go | 2 +- server/block/beetroot_seeds.go | 2 +- server/block/blast_furnace.go | 6 +++--- server/block/bone.go | 2 +- server/block/cactus.go | 8 ++++---- server/block/cake.go | 6 +++--- server/block/campfire.go | 10 +++++----- server/block/carpet.go | 4 ++-- server/block/carrot.go | 4 ++-- server/block/chain.go | 2 +- server/block/chest.go | 4 ++-- server/block/cocoa_bean.go | 4 ++-- server/block/composter.go | 4 ++-- server/block/concrete_powder.go | 2 +- server/block/coral.go | 6 +++--- server/block/coral_block.go | 4 ++-- server/block/crafting_table.go | 2 +- server/block/crop.go | 2 +- server/block/cube/bbox.go | 12 ++++++------ server/block/deadbush.go | 4 ++-- server/block/decorated_pot.go | 2 +- server/block/deepslate.go | 2 +- server/block/dirt_path.go | 2 +- server/block/double_flower.go | 4 ++-- server/block/double_tall_grass.go | 4 ++-- server/block/dragon_egg.go | 6 +++--- server/block/enchanting_table.go | 2 +- server/block/ender_chest.go | 4 ++-- server/block/farmland.go | 6 +++--- server/block/fern.go | 4 ++-- server/block/fire.go | 2 +- server/block/flower.go | 6 +++--- server/block/froglight.go | 2 +- server/block/furnace.go | 6 +++--- server/block/glazed_terracotta.go | 2 +- server/block/gravel.go | 2 +- server/block/grindstone.go | 6 +++--- server/block/hay_bale.go | 4 ++-- server/block/hopper.go | 8 ++++---- server/block/item_frame.go | 8 ++++---- server/block/jukebox.go | 4 ++-- server/block/kelp.go | 2 +- server/block/ladder.go | 6 +++--- server/block/lantern.go | 4 ++-- server/block/lava.go | 6 +++--- server/block/leaves.go | 6 +++--- server/block/lectern.go | 6 +++--- server/block/lit_pumpkin.go | 2 +- server/block/log.go | 2 +- server/block/loom.go | 4 ++-- server/block/melon_seeds.go | 4 ++-- server/block/moss_carpet.go | 4 ++-- server/block/muddy_mangrove_roots.go | 2 +- server/block/nether_sprouts.go | 4 ++-- server/block/nether_wart.go | 4 ++-- server/block/note.go | 2 +- server/block/potato.go | 4 ++-- server/block/pumpkin.go | 2 +- server/block/pumpkin_seeds.go | 4 ++-- server/block/purpur.go | 2 +- server/block/quartz.go | 2 +- server/block/sand.go | 2 +- server/block/sea_pickle.go | 4 ++-- server/block/short_grass.go | 4 ++-- server/block/sign.go | 6 +++--- server/block/skull.go | 2 +- server/block/slab.go | 2 +- server/block/smelter.go | 4 ++-- server/block/smithing_table.go | 2 +- server/block/smoker.go | 6 +++--- server/block/sponge.go | 4 ++-- server/block/spore_blossom.go | 4 ++-- server/block/stonecutter.go | 4 ++-- server/block/sugar_cane.go | 6 +++--- server/block/tnt.go | 4 ++-- server/block/torch.go | 4 ++-- server/block/wall.go | 4 ++-- server/block/water.go | 6 +++--- server/block/wheat_seeds.go | 2 +- server/block/wood.go | 2 +- server/block/wood_door.go | 6 +++--- server/block/wood_fence_gate.go | 6 +++--- server/block/wood_trapdoor.go | 2 +- server/entity/area_effect_cloud_behaviour.go | 4 ++-- server/entity/bottle_of_enchanting.go | 4 ++-- server/entity/egg.go | 4 ++-- server/entity/text.go | 2 +- server/item/apple.go | 2 +- server/item/armour_trim.go | 2 +- server/item/axe.go | 2 +- server/item/baked_potato.go | 2 +- server/item/beef.go | 2 +- server/item/beetroot.go | 2 +- server/item/beetroot_soup.go | 2 +- server/item/bone_meal.go | 2 +- server/item/boots.go | 2 +- server/item/bread.go | 2 +- server/item/bucket.go | 4 ++-- server/item/chestplate.go | 2 +- server/item/chicken.go | 2 +- server/item/cod.go | 2 +- server/item/cookie.go | 2 +- server/item/dried_kelp.go | 2 +- server/item/dye.go | 2 +- server/item/elytra.go | 2 +- server/item/enchanted_apple.go | 2 +- server/item/enchantment/vanishing.go | 2 +- server/item/fire_charge.go | 2 +- server/item/firework.go | 2 +- server/item/flint_and_steel.go | 2 +- server/item/glass_bottle.go | 2 +- server/item/goat_horn.go | 2 +- server/item/golden_apple.go | 2 +- server/item/golden_carrot.go | 2 +- server/item/helmet.go | 2 +- server/item/hoe.go | 2 +- server/item/honeycomb.go | 2 +- server/item/ink_sac.go | 2 +- server/item/leggings.go | 2 +- server/item/melon_slice.go | 2 +- server/item/mushroom_stew.go | 2 +- server/item/mutton.go | 2 +- server/item/poisonous_potato.go | 2 +- server/item/porkchop.go | 2 +- server/item/potion.go | 2 +- server/item/pufferfish.go | 2 +- server/item/pumpkin_pie.go | 2 +- server/item/rabbit.go | 2 +- server/item/rabbit_stew.go | 2 +- server/item/rotten_flesh.go | 2 +- server/item/salmon.go | 2 +- server/item/shears.go | 2 +- server/item/shovel.go | 2 +- server/item/spider_eye.go | 2 +- server/item/suspicious_stew.go | 2 +- server/item/suspicious_stew_type.go | 3 +-- server/item/tropical_fish.go | 2 +- server/item/turtle_shell.go | 2 +- server/session/handler_block_pick_request.go | 2 +- server/session/handler_book_edit.go | 2 +- server/session/handler_client_cache_blob_status.go | 2 +- server/session/handler_command_request.go | 2 +- server/session/handler_emote.go | 2 +- server/session/handler_interact.go | 2 +- server/session/handler_inventory_transaction.go | 4 ++-- server/session/handler_item_stack_request.go | 2 +- server/session/handler_lectern_update.go | 2 +- server/session/handler_loom.go | 2 +- server/session/handler_modal_form_response.go | 2 +- server/session/handler_player_action.go | 2 +- server/session/handler_player_skin.go | 2 +- server/session/handler_request_ability.go | 2 +- server/session/handler_request_chunk_radius.go | 2 +- server/session/handler_server_bound_diagnostics.go | 2 +- .../session/handler_server_bound_loading_screen.go | 2 +- server/session/handler_sub_chunk_request.go | 2 +- 160 files changed, 253 insertions(+), 254 deletions(-) diff --git a/server/block/anvil.go b/server/block/anvil.go index d28befab4..a4e5f043a 100644 --- a/server/block/anvil.go +++ b/server/block/anvil.go @@ -31,7 +31,7 @@ func (a Anvil) BreakInfo() BreakInfo { } // Activate ... -func (Anvil) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (Anvil) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true @@ -40,7 +40,7 @@ func (Anvil) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item. } // UseOnBlock ... -func (a Anvil) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (a Anvil) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, a) if !used { return @@ -51,7 +51,7 @@ func (a Anvil) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx } // NeighbourUpdateTick ... -func (a Anvil) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (a Anvil) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { a.fall(a, pos, tx) } diff --git a/server/block/banner.go b/server/block/banner.go index d6a50be80..f1c43ab0c 100644 --- a/server/block/banner.go +++ b/server/block/banner.go @@ -41,7 +41,7 @@ func (Banner) FuelInfo() item.FuelInfo { } // UseOnBlock ... -func (b Banner) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (b Banner) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, b) if !used || face == cube.FaceDown { return false @@ -58,7 +58,7 @@ func (b Banner) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx } // NeighbourUpdateTick ... -func (b Banner) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (b Banner) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if b.Attach.hanging { if _, ok := tx.Block(pos.Side(b.Attach.facing.Opposite().Face())).(Air); ok { tx.SetBlock(pos, nil, nil) diff --git a/server/block/barrel.go b/server/block/barrel.go index 665ee1fc2..fb1e39d72 100644 --- a/server/block/barrel.go +++ b/server/block/barrel.go @@ -100,7 +100,7 @@ func (b Barrel) RemoveViewer(v ContainerViewer, tx *world.Tx, pos cube.Pos) { } // Activate ... -func (b Barrel) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (b Barrel) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true @@ -109,7 +109,7 @@ func (b Barrel) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u it } // UseOnBlock ... -func (b Barrel) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (b Barrel) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, b) if !used { return diff --git a/server/block/basalt.go b/server/block/basalt.go index 2711849da..eb66d5080 100644 --- a/server/block/basalt.go +++ b/server/block/basalt.go @@ -19,7 +19,7 @@ type Basalt struct { } // UseOnBlock ... -func (b Basalt) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (b Basalt) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, b) if !used { return diff --git a/server/block/beacon.go b/server/block/beacon.go index 0d706fa73..78633ad10 100644 --- a/server/block/beacon.go +++ b/server/block/beacon.go @@ -39,7 +39,7 @@ func (b Beacon) BreakInfo() BreakInfo { } // Activate manages the opening of a beacon by activating it. -func (b Beacon) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (b Beacon) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true diff --git a/server/block/beetroot_seeds.go b/server/block/beetroot_seeds.go index adcd081a0..ed2da0483 100644 --- a/server/block/beetroot_seeds.go +++ b/server/block/beetroot_seeds.go @@ -34,7 +34,7 @@ func (b BeetrootSeeds) BoneMeal(pos cube.Pos, tx *world.Tx) bool { } // UseOnBlock ... -func (b BeetrootSeeds) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (b BeetrootSeeds) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, b) if !used { return false diff --git a/server/block/blast_furnace.go b/server/block/blast_furnace.go index 910d2dc4e..91ef43c5d 100644 --- a/server/block/blast_furnace.go +++ b/server/block/blast_furnace.go @@ -34,7 +34,7 @@ func NewBlastFurnace(face cube.Direction) BlastFurnace { } // Tick is called to check if the blast furnace should update and start or stop smelting. -func (b BlastFurnace) Tick(currentTick int64, pos cube.Pos, tx *world.Tx) { +func (b BlastFurnace) Tick(_ int64, pos cube.Pos, tx *world.Tx) { if b.Lit && rand.Float64() <= 0.016 { // Every three or so seconds. tx.PlaySound(pos.Vec3Centre(), sound.BlastFurnaceCrackle{}) } @@ -60,7 +60,7 @@ func (b BlastFurnace) EncodeBlock() (name string, properties map[string]interfac } // UseOnBlock ... -func (b BlastFurnace) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (b BlastFurnace) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, b) if !used { return false @@ -81,7 +81,7 @@ func (b BlastFurnace) BreakInfo() BreakInfo { } // Activate ... -func (b BlastFurnace) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (b BlastFurnace) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true diff --git a/server/block/bone.go b/server/block/bone.go index 9063a9c6e..346d6adfa 100644 --- a/server/block/bone.go +++ b/server/block/bone.go @@ -22,7 +22,7 @@ func (b Bone) Instrument() sound.Instrument { } // UseOnBlock handles the rotational placing of bone blocks. -func (b Bone) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (b Bone) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, b) if !used { return diff --git a/server/block/cactus.go b/server/block/cactus.go index d9c1dc988..7f06110b2 100644 --- a/server/block/cactus.go +++ b/server/block/cactus.go @@ -19,7 +19,7 @@ type Cactus struct { } // UseOnBlock handles making sure the neighbouring blocks are air. -func (c Cactus) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (c Cactus) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, c) if !used { return false @@ -33,7 +33,7 @@ func (c Cactus) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx } // NeighbourUpdateTick ... -func (c Cactus) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c Cactus) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !c.canGrowHere(pos, tx, true) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: c}) @@ -42,7 +42,7 @@ func (c Cactus) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx } // RandomTick ... -func (c Cactus) RandomTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (c Cactus) RandomTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if c.Age < 15 { c.Age++ } else if c.Age == 15 { @@ -75,7 +75,7 @@ func (c Cactus) canGrowHere(pos cube.Pos, tx *world.Tx, recursive bool) bool { } // EntityInside ... -func (c Cactus) EntityInside(pos cube.Pos, tx *world.Tx, e world.Entity) { +func (c Cactus) EntityInside(_ cube.Pos, _ *world.Tx, e world.Entity) { if l, ok := e.(livingEntity); ok && !l.AttackImmune() { l.Hurt(0.5, DamageSource{Block: c}) } diff --git a/server/block/cake.go b/server/block/cake.go index f77bc00b2..ed7090a23 100644 --- a/server/block/cake.go +++ b/server/block/cake.go @@ -25,7 +25,7 @@ func (c Cake) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool { } // UseOnBlock ... -func (c Cake) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (c Cake) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, c) if !used { return false @@ -40,7 +40,7 @@ func (c Cake) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx * } // NeighbourUpdateTick ... -func (c Cake) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c Cake) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, air := tx.Block(pos.Side(cube.FaceDown)).(Air); air { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: c}) @@ -48,7 +48,7 @@ func (c Cake) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) } // Activate ... -func (c Cake) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (c Cake) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if i, ok := u.(interface { Saturate(food int, saturation float64) }); ok { diff --git a/server/block/campfire.go b/server/block/campfire.go index f2426152b..057a8279a 100644 --- a/server/block/campfire.go +++ b/server/block/campfire.go @@ -80,7 +80,7 @@ func (c Campfire) LightEmissionLevel() uint8 { } // Ignite ... -func (c Campfire) Ignite(pos cube.Pos, tx *world.Tx, igniter world.Entity) bool { +func (c Campfire) Ignite(pos cube.Pos, tx *world.Tx, _ world.Entity) bool { tx.PlaySound(pos.Vec3(), sound.Ignite{}) if !c.Extinguished { return false @@ -116,7 +116,7 @@ func (c Campfire) extinguish(pos cube.Pos, tx *world.Tx) { } // Activate ... -func (c Campfire) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (c Campfire) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { held, _ := u.HeldItems() if held.Empty() { return false @@ -151,7 +151,7 @@ func (c Campfire) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u } // UseOnBlock ... -func (c Campfire) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (c Campfire) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, c) if !used { return @@ -165,7 +165,7 @@ func (c Campfire) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, } // Tick is called to cook the items within the campfire. -func (c Campfire) Tick(currentTick int64, pos cube.Pos, tx *world.Tx) { +func (c Campfire) Tick(_ int64, pos cube.Pos, tx *world.Tx) { if c.Extinguished { // Extinguished, do nothing. return @@ -197,7 +197,7 @@ func (c Campfire) Tick(currentTick int64, pos cube.Pos, tx *world.Tx) { } // NeighbourUpdateTick ... -func (c Campfire) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c Campfire) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { _, ok := tx.Liquid(pos) liquid, okTwo := tx.Liquid(pos.Side(cube.FaceUp)) if (ok || (okTwo && liquid.LiquidType() == "water")) && !c.Extinguished { diff --git a/server/block/carpet.go b/server/block/carpet.go index 925a0d407..d6871ac34 100644 --- a/server/block/carpet.go +++ b/server/block/carpet.go @@ -48,7 +48,7 @@ func (Carpet) HasLiquidDrops() bool { } // NeighbourUpdateTick ... -func (c Carpet) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c Carpet) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, ok := tx.Block(pos.Side(cube.FaceDown)).(Air); ok { tx.SetBlock(pos, nil, nil) dropItem(tx, item.NewStack(c, 1), pos.Vec3Centre()) @@ -56,7 +56,7 @@ func (c Carpet) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx } // UseOnBlock handles not placing carpets on top of air blocks. -func (c Carpet) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (c Carpet) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, c) if !used { return diff --git a/server/block/carrot.go b/server/block/carrot.go index 6287a53d4..7ec3be0d6 100644 --- a/server/block/carrot.go +++ b/server/block/carrot.go @@ -32,7 +32,7 @@ func (c Carrot) ConsumeDuration() time.Duration { } // Consume ... -func (c Carrot) Consume(tx *world.Tx, co item.Consumer) item.Stack { +func (c Carrot) Consume(_ *world.Tx, co item.Consumer) item.Stack { co.Saturate(3, 3.6) return item.Stack{} } @@ -48,7 +48,7 @@ func (c Carrot) BoneMeal(pos cube.Pos, tx *world.Tx) bool { } // UseOnBlock ... -func (c Carrot) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (c Carrot) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, c) if !used { return false diff --git a/server/block/chain.go b/server/block/chain.go index 2a27e870a..2773e9855 100644 --- a/server/block/chain.go +++ b/server/block/chain.go @@ -23,7 +23,7 @@ func (Chain) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool { } // UseOnBlock ... -func (c Chain) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (c Chain) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, c) if !used { return diff --git a/server/block/chest.go b/server/block/chest.go index ce71a0756..136b37ea1 100644 --- a/server/block/chest.go +++ b/server/block/chest.go @@ -146,7 +146,7 @@ func (c Chest) RemoveViewer(v ContainerViewer, tx *world.Tx, pos cube.Pos) { } // Activate ... -func (c Chest) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (c Chest) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { if c.paired { if d, ok := tx.Block(c.pairPos(pos).Side(cube.FaceUp)).(LightDiffuser); !ok || d.LightDiffusionLevel() > 2 { @@ -162,7 +162,7 @@ func (c Chest) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u ite } // UseOnBlock ... -func (c Chest) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (c Chest) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, c) if !used { return diff --git a/server/block/cocoa_bean.go b/server/block/cocoa_bean.go index fd887d574..b30707fd0 100644 --- a/server/block/cocoa_bean.go +++ b/server/block/cocoa_bean.go @@ -35,7 +35,7 @@ func (c CocoaBean) HasLiquidDrops() bool { } // NeighbourUpdateTick ... -func (c CocoaBean) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c CocoaBean) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { var woodType WoodType switch b := tx.Block(pos.Side(c.Facing.Face())).(type) { case Log: @@ -49,7 +49,7 @@ func (c CocoaBean) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world } // UseOnBlock ... -func (c CocoaBean) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (c CocoaBean) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, c) if !used { return false diff --git a/server/block/composter.go b/server/block/composter.go index 505392e24..a13bcb0b7 100644 --- a/server/block/composter.go +++ b/server/block/composter.go @@ -90,7 +90,7 @@ func (c Composter) BreakInfo() BreakInfo { } // Activate ... -func (c Composter) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (c Composter) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { if c.Level >= 7 { if c.Level == 8 { c.Level = 0 @@ -130,7 +130,7 @@ func (c Composter) fill(it item.Stack, pos cube.Pos, tx *world.Tx) bool { } // ScheduledTick ... -func (c Composter) ScheduledTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (c Composter) ScheduledTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if c.Level == 7 { c.Level = 8 tx.SetBlock(pos, c, nil) diff --git a/server/block/concrete_powder.go b/server/block/concrete_powder.go index c45e87a92..4ce97bcd4 100644 --- a/server/block/concrete_powder.go +++ b/server/block/concrete_powder.go @@ -24,7 +24,7 @@ func (c ConcretePowder) Solidifies(pos cube.Pos, tx *world.Tx) bool { } // NeighbourUpdateTick ... -func (c ConcretePowder) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c ConcretePowder) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { for i := cube.Face(0); i < 6; i++ { if _, ok := tx.Block(pos.Side(i)).(Water); ok { tx.SetBlock(pos, Concrete{Colour: c.Colour}, nil) diff --git a/server/block/coral.go b/server/block/coral.go index 98625ae1b..7837e0e36 100644 --- a/server/block/coral.go +++ b/server/block/coral.go @@ -24,7 +24,7 @@ type Coral struct { } // UseOnBlock ... -func (c Coral) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (c Coral) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, c) if !used { return false @@ -55,7 +55,7 @@ func (c Coral) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool { } // NeighbourUpdateTick ... -func (c Coral) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c Coral) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !tx.Block(pos.Side(cube.FaceDown)).Model().FaceSolid(pos.Side(cube.FaceDown), cube.FaceUp, tx) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: c}) @@ -68,7 +68,7 @@ func (c Coral) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) } // ScheduledTick ... -func (c Coral) ScheduledTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (c Coral) ScheduledTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if c.Dead { return } diff --git a/server/block/coral_block.go b/server/block/coral_block.go index 46c54090d..f2899d6ac 100644 --- a/server/block/coral_block.go +++ b/server/block/coral_block.go @@ -19,7 +19,7 @@ type CoralBlock struct { } // NeighbourUpdateTick ... -func (c CoralBlock) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c CoralBlock) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if c.Dead { return } @@ -27,7 +27,7 @@ func (c CoralBlock) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *worl } // ScheduledTick ... -func (c CoralBlock) ScheduledTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (c CoralBlock) ScheduledTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if c.Dead { return } diff --git a/server/block/crafting_table.go b/server/block/crafting_table.go index f8fad24d2..933ff0c58 100644 --- a/server/block/crafting_table.go +++ b/server/block/crafting_table.go @@ -34,7 +34,7 @@ func (CraftingTable) FuelInfo() item.FuelInfo { } // Activate ... -func (c CraftingTable) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (c CraftingTable) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true diff --git a/server/block/crop.go b/server/block/crop.go index 6b46bbc67..e2953a59c 100644 --- a/server/block/crop.go +++ b/server/block/crop.go @@ -24,7 +24,7 @@ type crop struct { } // NeighbourUpdateTick ... -func (c crop) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c crop) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, ok := tx.Block(pos.Side(cube.FaceDown)).(Farmland); !ok { b := tx.Block(pos) tx.SetBlock(pos, nil, nil) diff --git a/server/block/cube/bbox.go b/server/block/cube/bbox.go index 9690cd099..e73d0d2a7 100644 --- a/server/block/cube/bbox.go +++ b/server/block/cube/bbox.go @@ -290,12 +290,12 @@ func (box BBox) Corners() []mgl64.Vec3 { return []mgl64.Vec3{ box.min, box.max, - mgl64.Vec3{min[0], min[1], max[2]}, - mgl64.Vec3{min[0], max[1], min[2]}, - mgl64.Vec3{min[0], max[1], max[2]}, - mgl64.Vec3{max[0], max[1], min[2]}, - mgl64.Vec3{max[0], min[1], max[2]}, - mgl64.Vec3{max[0], min[1], min[2]}, + {min[0], min[1], max[2]}, + {min[0], max[1], min[2]}, + {min[0], max[1], max[2]}, + {max[0], max[1], min[2]}, + {max[0], min[1], max[2]}, + {max[0], min[1], min[2]}, } } diff --git a/server/block/deadbush.go b/server/block/deadbush.go index 252478403..f3a762c50 100644 --- a/server/block/deadbush.go +++ b/server/block/deadbush.go @@ -18,7 +18,7 @@ type DeadBush struct { } // NeighbourUpdateTick ... -func (d DeadBush) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (d DeadBush) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !supportsVegetation(d, tx.Block(pos.Side(cube.FaceDown))) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: d}) @@ -29,7 +29,7 @@ func (d DeadBush) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world. } // UseOnBlock ... -func (d DeadBush) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (d DeadBush) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, d) if !used { return false diff --git a/server/block/decorated_pot.go b/server/block/decorated_pot.go index beb8473a0..eda618601 100644 --- a/server/block/decorated_pot.go +++ b/server/block/decorated_pot.go @@ -52,7 +52,7 @@ func (p DecoratedPot) Model() world.BlockModel { } // UseOnBlock ... -func (p DecoratedPot) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (p DecoratedPot) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, p) if !used { return diff --git a/server/block/deepslate.go b/server/block/deepslate.go index 63a9a4fbf..b5055dfc5 100644 --- a/server/block/deepslate.go +++ b/server/block/deepslate.go @@ -35,7 +35,7 @@ func (d Deepslate) SmeltInfo() item.SmeltInfo { } // UseOnBlock ... -func (d Deepslate) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (d Deepslate) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, d) if !used { return diff --git a/server/block/dirt_path.go b/server/block/dirt_path.go index a311ae732..96b4f9aa5 100644 --- a/server/block/dirt_path.go +++ b/server/block/dirt_path.go @@ -17,7 +17,7 @@ func (p DirtPath) Till() (world.Block, bool) { } // NeighbourUpdateTick handles the turning from dirt path into dirt if a block is placed on top of it. -func (p DirtPath) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (p DirtPath) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { up := pos.Side(cube.FaceUp) if tx.Block(up).Model().FaceSolid(up, cube.FaceDown, tx) { // A block with a solid side at the bottom was placed onto this one. diff --git a/server/block/double_flower.go b/server/block/double_flower.go index f62af4ab8..cee1e4278 100644 --- a/server/block/double_flower.go +++ b/server/block/double_flower.go @@ -31,7 +31,7 @@ func (d DoubleFlower) BoneMeal(pos cube.Pos, tx *world.Tx) bool { } // NeighbourUpdateTick ... -func (d DoubleFlower) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (d DoubleFlower) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if d.UpperPart { if bottom, ok := tx.Block(pos.Side(cube.FaceDown)).(DoubleFlower); !ok || bottom.Type != d.Type || bottom.UpperPart { tx.SetBlock(pos, nil, nil) @@ -52,7 +52,7 @@ func (d DoubleFlower) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *wo } // UseOnBlock ... -func (d DoubleFlower) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (d DoubleFlower) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, d) if !used { return false diff --git a/server/block/double_tall_grass.go b/server/block/double_tall_grass.go index 80ea55a13..be9a4d81c 100644 --- a/server/block/double_tall_grass.go +++ b/server/block/double_tall_grass.go @@ -27,7 +27,7 @@ func (d DoubleTallGrass) HasLiquidDrops() bool { } // NeighbourUpdateTick ... -func (d DoubleTallGrass) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (d DoubleTallGrass) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if d.UpperPart { if bottom, ok := tx.Block(pos.Side(cube.FaceDown)).(DoubleTallGrass); !ok || bottom.Type != d.Type || bottom.UpperPart { tx.SetBlock(pos, nil, nil) @@ -47,7 +47,7 @@ func (d DoubleTallGrass) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx } // UseOnBlock ... -func (d DoubleTallGrass) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (d DoubleTallGrass) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, d) if !used { return false diff --git a/server/block/dragon_egg.go b/server/block/dragon_egg.go index d0711fe07..276ce417f 100644 --- a/server/block/dragon_egg.go +++ b/server/block/dragon_egg.go @@ -18,7 +18,7 @@ type DragonEgg struct { } // NeighbourUpdateTick ... -func (d DragonEgg) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (d DragonEgg) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { d.fall(d, pos, tx) } @@ -47,7 +47,7 @@ func (d DragonEgg) LightEmissionLevel() uint8 { } // Punch ... -func (d DragonEgg) Punch(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User) { +func (d DragonEgg) Punch(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User) { if gm, ok := u.(interface{ GameMode() world.GameMode }); ok && gm.GameMode().CreativeInventory() { return } @@ -55,7 +55,7 @@ func (d DragonEgg) Punch(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u it } // Activate ... -func (d DragonEgg) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (d DragonEgg) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, _ item.User, _ *item.UseContext) bool { d.teleport(pos, tx) return true } diff --git a/server/block/enchanting_table.go b/server/block/enchanting_table.go index 41cc1c0e8..8ccdb626c 100644 --- a/server/block/enchanting_table.go +++ b/server/block/enchanting_table.go @@ -36,7 +36,7 @@ func (EnchantingTable) LightEmissionLevel() uint8 { } // Activate ... -func (EnchantingTable) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (EnchantingTable) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true diff --git a/server/block/ender_chest.go b/server/block/ender_chest.go index 0add187a4..054b075ca 100644 --- a/server/block/ender_chest.go +++ b/server/block/ender_chest.go @@ -51,7 +51,7 @@ func (EnderChest) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool { } // UseOnBlock ... -func (c EnderChest) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (c EnderChest) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, c) if !used { return @@ -65,7 +65,7 @@ func (c EnderChest) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3 } // Activate ... -func (c EnderChest) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (c EnderChest) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(enderChestOwner); ok { opener.OpenBlockContainer(pos, tx) return true diff --git a/server/block/farmland.go b/server/block/farmland.go index 411135212..33d53d05c 100644 --- a/server/block/farmland.go +++ b/server/block/farmland.go @@ -28,14 +28,14 @@ func (f Farmland) SoilFor(block world.Block) bool { } // NeighbourUpdateTick ... -func (f Farmland) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (f Farmland) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if solid := tx.Block(pos.Side(cube.FaceUp)).Model().FaceSolid(pos.Side(cube.FaceUp), cube.FaceDown, tx); solid { tx.SetBlock(pos, Dirt{}, nil) } } // RandomTick ... -func (f Farmland) RandomTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (f Farmland) RandomTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if !f.hydrated(pos, tx) { if f.Hydration > 0 { f.Hydration-- @@ -70,7 +70,7 @@ func (f Farmland) hydrated(pos cube.Pos, tx *world.Tx) bool { } // EntityLand ... -func (f Farmland) EntityLand(pos cube.Pos, tx *world.Tx, e world.Entity, distance *float64) { +func (f Farmland) EntityLand(pos cube.Pos, tx *world.Tx, e world.Entity, _ *float64) { if living, ok := e.(livingEntity); ok { if fall, ok := living.(fallDistanceEntity); ok && rand.Float64() < fall.FallDistance()-0.5 { ctx := event.C(tx) diff --git a/server/block/fern.go b/server/block/fern.go index 48611a37c..d0d3131c1 100644 --- a/server/block/fern.go +++ b/server/block/fern.go @@ -51,7 +51,7 @@ func (g Fern) CompostChance() float64 { } // NeighbourUpdateTick ... -func (g Fern) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (g Fern) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !supportsVegetation(g, tx.Block(pos.Side(cube.FaceDown))) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: g}) @@ -64,7 +64,7 @@ func (g Fern) HasLiquidDrops() bool { } // UseOnBlock ... -func (g Fern) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (g Fern) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, g) if !used { return false diff --git a/server/block/fire.go b/server/block/fire.go index 470e9c4c1..0cf5d09c6 100644 --- a/server/block/fire.go +++ b/server/block/fire.go @@ -189,7 +189,7 @@ func (f Fire) spread(from, to cube.Pos, tx *world.Tx, r *rand.Rand) { } // EntityInside ... -func (f Fire) EntityInside(pos cube.Pos, tx *world.Tx, e world.Entity) { +func (f Fire) EntityInside(_ cube.Pos, _ *world.Tx, e world.Entity) { if flammable, ok := e.(flammableEntity); ok { if l, ok := e.(livingEntity); ok && !l.AttackImmune() { l.Hurt(f.Type.Damage(), FireDamageSource{}) diff --git a/server/block/flower.go b/server/block/flower.go index ce28c058c..6d32300fe 100644 --- a/server/block/flower.go +++ b/server/block/flower.go @@ -22,7 +22,7 @@ type Flower struct { } // EntityInside ... -func (f Flower) EntityInside(pos cube.Pos, tx *world.Tx, e world.Entity) { +func (f Flower) EntityInside(_ cube.Pos, _ *world.Tx, e world.Entity) { if f.Type == WitherRose() { if living, ok := e.(interface { AddEffect(effect.Effect) @@ -61,7 +61,7 @@ func (f Flower) BoneMeal(pos cube.Pos, tx *world.Tx) (success bool) { } // NeighbourUpdateTick ... -func (f Flower) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (f Flower) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !supportsVegetation(f, tx.Block(pos.Side(cube.FaceDown))) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: f}) @@ -70,7 +70,7 @@ func (f Flower) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx } // UseOnBlock ... -func (f Flower) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (f Flower) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, f) if !used { return false diff --git a/server/block/froglight.go b/server/block/froglight.go index 4c724cd2b..5d8736ce6 100644 --- a/server/block/froglight.go +++ b/server/block/froglight.go @@ -23,7 +23,7 @@ func (f Froglight) LightEmissionLevel() uint8 { } // UseOnBlock ... -func (f Froglight) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (f Froglight) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, f) if !used { return diff --git a/server/block/furnace.go b/server/block/furnace.go index 6bd6996ef..0b2e190e9 100644 --- a/server/block/furnace.go +++ b/server/block/furnace.go @@ -33,7 +33,7 @@ func NewFurnace(face cube.Direction) Furnace { } // Tick is called to check if the furnace should update and start or stop smelting. -func (f Furnace) Tick(currentTick int64, pos cube.Pos, tx *world.Tx) { +func (f Furnace) Tick(_ int64, pos cube.Pos, tx *world.Tx) { if f.Lit && rand.Float64() <= 0.016 { // Every three or so seconds. tx.PlaySound(pos.Vec3Centre(), sound.FurnaceCrackle{}) } @@ -59,7 +59,7 @@ func (f Furnace) EncodeBlock() (name string, properties map[string]interface{}) } // UseOnBlock ... -func (f Furnace) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (f Furnace) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, f) if !used { return false @@ -80,7 +80,7 @@ func (f Furnace) BreakInfo() BreakInfo { } // Activate ... -func (f Furnace) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (f Furnace) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true diff --git a/server/block/glazed_terracotta.go b/server/block/glazed_terracotta.go index f563b8c53..5fec06c5e 100644 --- a/server/block/glazed_terracotta.go +++ b/server/block/glazed_terracotta.go @@ -34,7 +34,7 @@ func (t GlazedTerracotta) EncodeBlock() (name string, properties map[string]any) } // UseOnBlock ensures the proper facing is used when placing a glazed terracotta block, by using the opposite of the player. -func (t GlazedTerracotta) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (t GlazedTerracotta) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, t) if !used { return diff --git a/server/block/gravel.go b/server/block/gravel.go index 282193082..9d98c757b 100644 --- a/server/block/gravel.go +++ b/server/block/gravel.go @@ -15,7 +15,7 @@ type Gravel struct { } // NeighbourUpdateTick ... -func (g Gravel) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (g Gravel) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { g.fall(g, pos, tx) } diff --git a/server/block/grindstone.go b/server/block/grindstone.go index 9d19785f1..30c0ee22e 100644 --- a/server/block/grindstone.go +++ b/server/block/grindstone.go @@ -26,7 +26,7 @@ func (g Grindstone) BreakInfo() BreakInfo { } // Activate ... -func (g Grindstone) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (g Grindstone) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true @@ -35,7 +35,7 @@ func (g Grindstone) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, } // UseOnBlock ... -func (g Grindstone) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (g Grindstone) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, g) if !used { return false @@ -52,7 +52,7 @@ func (g Grindstone) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3 } // NeighbourUpdateTick ... -func (g Grindstone) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (g Grindstone) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { supportFace := g.Facing.Face().Opposite() if g.Attach == HangingGrindstoneAttachment() { supportFace = cube.FaceUp diff --git a/server/block/hay_bale.go b/server/block/hay_bale.go index e8fea0a78..e0ddfae48 100644 --- a/server/block/hay_bale.go +++ b/server/block/hay_bale.go @@ -23,14 +23,14 @@ func (HayBale) Instrument() sound.Instrument { } // EntityLand ... -func (h HayBale) EntityLand(pos cube.Pos, tx *world.Tx, e world.Entity, distance *float64) { +func (h HayBale) EntityLand(_ cube.Pos, _ *world.Tx, e world.Entity, distance *float64) { if _, ok := e.(fallDistanceEntity); ok { *distance *= 0.2 } } // UseOnBlock ... -func (h HayBale) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (h HayBale) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, h) if !used { return diff --git a/server/block/hopper.go b/server/block/hopper.go index d35140141..feba5cbe5 100644 --- a/server/block/hopper.go +++ b/server/block/hopper.go @@ -88,21 +88,21 @@ func (h Hopper) WithName(a ...any) world.Item { } // AddViewer adds a viewer to the hopper, so that it is updated whenever the inventory of the hopper is changed. -func (h Hopper) AddViewer(v ContainerViewer, tx *world.Tx, pos cube.Pos) { +func (h Hopper) AddViewer(v ContainerViewer, _ *world.Tx, _ cube.Pos) { h.viewerMu.Lock() defer h.viewerMu.Unlock() h.viewers[v] = struct{}{} } // RemoveViewer removes a viewer from the hopper, so that slot updates in the inventory are no longer sent to it. -func (h Hopper) RemoveViewer(v ContainerViewer, tx *world.Tx, pos cube.Pos) { +func (h Hopper) RemoveViewer(v ContainerViewer, _ *world.Tx, _ cube.Pos) { h.viewerMu.Lock() defer h.viewerMu.Unlock() delete(h.viewers, v) } // Activate ... -func (Hopper) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (Hopper) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true @@ -111,7 +111,7 @@ func (Hopper) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item } // UseOnBlock ... -func (h Hopper) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (h Hopper) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, h) if !used { return false diff --git a/server/block/item_frame.go b/server/block/item_frame.go index 0b3395c69..b7b23f59b 100644 --- a/server/block/item_frame.go +++ b/server/block/item_frame.go @@ -32,7 +32,7 @@ type ItemFrame struct { } // Activate ... -func (i ItemFrame) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (i ItemFrame) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { if !i.Item.Empty() { // TODO: Item frames with maps can only be rotated four times. i.Rotations = (i.Rotations + 1) % 8 @@ -51,7 +51,7 @@ func (i ItemFrame) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u } // Punch ... -func (i ItemFrame) Punch(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User) { +func (i ItemFrame) Punch(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User) { if i.Item.Empty() { return } @@ -69,7 +69,7 @@ func (i ItemFrame) Punch(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u it } // UseOnBlock ... -func (i ItemFrame) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (i ItemFrame) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, face, used := firstReplaceable(tx, pos, face, i) if !used { return false @@ -149,7 +149,7 @@ func (ItemFrame) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool { } // NeighbourUpdateTick ... -func (i ItemFrame) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (i ItemFrame) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, ok := tx.Block(pos.Side(i.Facing)).Model().(model.Empty); ok { // TODO: Allow exceptions for pressure plates. tx.SetBlock(pos, nil, nil) diff --git a/server/block/jukebox.go b/server/block/jukebox.go index 2dcd947ca..4928d0ea3 100644 --- a/server/block/jukebox.go +++ b/server/block/jukebox.go @@ -43,7 +43,7 @@ func (j Jukebox) InsertItem(h Hopper, pos cube.Pos, tx *world.Tx) bool { } // ExtractItem ... -func (j Jukebox) ExtractItem(h Hopper, pos cube.Pos, tx *world.Tx) bool { +func (j Jukebox) ExtractItem(_ Hopper, _ cube.Pos, _ *world.Tx) bool { // TODO: This functionality requires redstone to be implemented. return false } @@ -75,7 +75,7 @@ type jukeboxUser interface { } // Activate ... -func (j Jukebox) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (j Jukebox) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { if _, hasDisc := j.Disc(); hasDisc { dropItem(tx, j.Item, pos.Side(cube.FaceUp).Vec3Middle()) diff --git a/server/block/kelp.go b/server/block/kelp.go index 6d8b8fa70..336c509ed 100644 --- a/server/block/kelp.go +++ b/server/block/kelp.go @@ -75,7 +75,7 @@ func (k Kelp) withRandomAge() Kelp { } // UseOnBlock ... -func (k Kelp) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (k Kelp) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, k) if !used { return diff --git a/server/block/ladder.go b/server/block/ladder.go index 56caf9324..50dfe9de3 100644 --- a/server/block/ladder.go +++ b/server/block/ladder.go @@ -22,7 +22,7 @@ type Ladder struct { } // NeighbourUpdateTick ... -func (l Ladder) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (l Ladder) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, ok := tx.Block(pos.Side(l.Facing.Opposite())).(LightDiffuser); ok { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: l}) @@ -31,7 +31,7 @@ func (l Ladder) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx } // UseOnBlock ... -func (l Ladder) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (l Ladder) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, face, used := firstReplaceable(tx, pos, face, l) if !used { return false @@ -59,7 +59,7 @@ func (l Ladder) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx } // EntityInside ... -func (l Ladder) EntityInside(pos cube.Pos, tx *world.Tx, e world.Entity) { +func (l Ladder) EntityInside(_ cube.Pos, _ *world.Tx, e world.Entity) { if fallEntity, ok := e.(fallDistanceEntity); ok { fallEntity.ResetFallDistance() } diff --git a/server/block/lantern.go b/server/block/lantern.go index 206c838ab..047e7a7df 100644 --- a/server/block/lantern.go +++ b/server/block/lantern.go @@ -25,7 +25,7 @@ func (l Lantern) Model() world.BlockModel { } // NeighbourUpdateTick ... -func (l Lantern) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (l Lantern) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if l.Hanging { up := pos.Side(cube.FaceUp) if _, ok := tx.Block(up).(Chain); !ok && !tx.Block(up).Model().FaceSolid(up, cube.FaceDown, tx) { @@ -47,7 +47,7 @@ func (l Lantern) LightEmissionLevel() uint8 { } // UseOnBlock ... -func (l Lantern) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (l Lantern) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, face, used := firstReplaceable(tx, pos, face, l) if !used { return false diff --git a/server/block/lava.go b/server/block/lava.go index 85bb55744..5f6afe79a 100644 --- a/server/block/lava.go +++ b/server/block/lava.go @@ -36,7 +36,7 @@ func neighboursLavaFlammable(pos cube.Pos, tx *world.Tx) bool { } // EntityInside ... -func (l Lava) EntityInside(pos cube.Pos, tx *world.Tx, e world.Entity) { +func (l Lava) EntityInside(_ cube.Pos, _ *world.Tx, e world.Entity) { if fallEntity, ok := e.(fallDistanceEntity); ok { fallEntity.ResetFallDistance() } @@ -88,14 +88,14 @@ func (Lava) LightEmissionLevel() uint8 { } // NeighbourUpdateTick ... -func (l Lava) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (l Lava) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !l.Harden(pos, tx, nil) { tx.ScheduleBlockUpdate(pos, tx.World().Dimension().LavaSpreadDuration()) } } // ScheduledTick ... -func (l Lava) ScheduledTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (l Lava) ScheduledTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if !l.Harden(pos, tx, nil) { tickLiquid(l, pos, tx) } diff --git a/server/block/leaves.go b/server/block/leaves.go index f8868615b..bf485d7d1 100644 --- a/server/block/leaves.go +++ b/server/block/leaves.go @@ -24,7 +24,7 @@ type Leaves struct { } // UseOnBlock makes leaves persistent when they are placed so that they don't decay. -func (l Leaves) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (l Leaves) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, l) if !used { return @@ -60,7 +60,7 @@ func findLog(pos cube.Pos, tx *world.Tx, visited *[]cube.Pos, distance int) bool } // RandomTick ... -func (l Leaves) RandomTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (l Leaves) RandomTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if !l.Persistent && l.ShouldUpdate { if findLog(pos, tx, &[]cube.Pos{}, 0) { l.ShouldUpdate = false @@ -72,7 +72,7 @@ func (l Leaves) RandomTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { } // NeighbourUpdateTick ... -func (l Leaves) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (l Leaves) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !l.Persistent && !l.ShouldUpdate { l.ShouldUpdate = true tx.SetBlock(pos, l, nil) diff --git a/server/block/lectern.go b/server/block/lectern.go index 17844c86a..45e4d3a6a 100644 --- a/server/block/lectern.go +++ b/server/block/lectern.go @@ -52,7 +52,7 @@ func (l Lectern) BreakInfo() BreakInfo { } // UseOnBlock ... -func (l Lectern) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (l Lectern) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, l) if !used { return false @@ -72,7 +72,7 @@ type readableBook interface { } // Activate ... -func (l Lectern) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (l Lectern) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { if !l.Book.Empty() { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) @@ -96,7 +96,7 @@ func (l Lectern) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u i } // Punch ... -func (l Lectern) Punch(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User) { +func (l Lectern) Punch(pos cube.Pos, _ cube.Face, tx *world.Tx, _ item.User) { if l.Book.Empty() { // We can't remove a book from the lectern if there isn't one. return diff --git a/server/block/lit_pumpkin.go b/server/block/lit_pumpkin.go index 4bdbf2cf7..5cd7ac750 100644 --- a/server/block/lit_pumpkin.go +++ b/server/block/lit_pumpkin.go @@ -21,7 +21,7 @@ func (l LitPumpkin) LightEmissionLevel() uint8 { } // UseOnBlock ... -func (l LitPumpkin) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (l LitPumpkin) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, l) if !used { return diff --git a/server/block/log.go b/server/block/log.go index eb58cc602..71401c018 100644 --- a/server/block/log.go +++ b/server/block/log.go @@ -52,7 +52,7 @@ func (Log) FuelInfo() item.FuelInfo { } // UseOnBlock handles the rotational placing of logs. -func (l Log) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (l Log) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, l) if !used { return diff --git a/server/block/loom.go b/server/block/loom.go index a3198a67f..69a82fec6 100644 --- a/server/block/loom.go +++ b/server/block/loom.go @@ -29,7 +29,7 @@ func (l Loom) BreakInfo() BreakInfo { } // Activate ... -func (Loom) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (Loom) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true @@ -38,7 +38,7 @@ func (Loom) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.U } // UseOnBlock ... -func (l Loom) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (l Loom) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, l) if !used { return diff --git a/server/block/melon_seeds.go b/server/block/melon_seeds.go index 21f2b1c6c..90688a19d 100644 --- a/server/block/melon_seeds.go +++ b/server/block/melon_seeds.go @@ -24,7 +24,7 @@ func (MelonSeeds) SameCrop(c Crop) bool { } // NeighbourUpdateTick ... -func (m MelonSeeds) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (m MelonSeeds) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, ok := tx.Block(pos.Side(cube.FaceDown)).(Farmland); !ok { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: m}) @@ -74,7 +74,7 @@ func (m MelonSeeds) BoneMeal(pos cube.Pos, tx *world.Tx) bool { } // UseOnBlock ... -func (m MelonSeeds) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (m MelonSeeds) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, m) if !used { return false diff --git a/server/block/moss_carpet.go b/server/block/moss_carpet.go index c0e5a5d13..8cddb7e07 100644 --- a/server/block/moss_carpet.go +++ b/server/block/moss_carpet.go @@ -25,14 +25,14 @@ func (MossCarpet) HasLiquidDrops() bool { } // NeighbourUpdateTick ... -func (MossCarpet) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (MossCarpet) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, ok := tx.Block(pos.Side(cube.FaceDown)).(Air); ok { tx.SetBlock(pos, nil, nil) } } // UseOnBlock ... -func (m MossCarpet) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (m MossCarpet) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, m) if !used { return diff --git a/server/block/muddy_mangrove_roots.go b/server/block/muddy_mangrove_roots.go index 1538f84e9..4bb5a3705 100644 --- a/server/block/muddy_mangrove_roots.go +++ b/server/block/muddy_mangrove_roots.go @@ -30,7 +30,7 @@ func (MuddyMangroveRoots) SoilFor(block world.Block) bool { } // UseOnBlock ... -func (m MuddyMangroveRoots) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (m MuddyMangroveRoots) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, m) if !used { return diff --git a/server/block/nether_sprouts.go b/server/block/nether_sprouts.go index 6cd4865da..1ec33e9c4 100644 --- a/server/block/nether_sprouts.go +++ b/server/block/nether_sprouts.go @@ -15,14 +15,14 @@ type NetherSprouts struct { } // NeighbourUpdateTick ... -func (n NetherSprouts) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (n NetherSprouts) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !supportsVegetation(n, tx.Block(pos.Side(cube.FaceDown))) { tx.SetBlock(pos, nil, nil) // TODO: Nylium & mycelium } } // UseOnBlock ... -func (n NetherSprouts) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (n NetherSprouts) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, n) if !used { return false diff --git a/server/block/nether_wart.go b/server/block/nether_wart.go index 9bd6250b9..a3bd0c1eb 100644 --- a/server/block/nether_wart.go +++ b/server/block/nether_wart.go @@ -31,7 +31,7 @@ func (n NetherWart) RandomTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { } // UseOnBlock ... -func (n NetherWart) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (n NetherWart) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, n) if !used { return false @@ -45,7 +45,7 @@ func (n NetherWart) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3 } // NeighbourUpdateTick ... -func (n NetherWart) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (n NetherWart) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, ok := tx.Block(pos.Side(cube.FaceDown)).(SoulSand); !ok { tx.SetBlock(pos, nil, nil) } diff --git a/server/block/note.go b/server/block/note.go index 72f399030..4f5d901d1 100644 --- a/server/block/note.go +++ b/server/block/note.go @@ -47,7 +47,7 @@ func (n Note) EncodeNBT() map[string]any { } // Activate ... -func (n Note) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (n Note) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, _ item.User, _ *item.UseContext) bool { if _, ok := tx.Block(pos.Side(cube.FaceUp)).(Air); !ok { return false } diff --git a/server/block/potato.go b/server/block/potato.go index dbe863d2d..4581be482 100644 --- a/server/block/potato.go +++ b/server/block/potato.go @@ -37,7 +37,7 @@ func (p Potato) ConsumeDuration() time.Duration { } // Consume ... -func (p Potato) Consume(tx *world.Tx, c item.Consumer) item.Stack { +func (p Potato) Consume(_ *world.Tx, c item.Consumer) item.Stack { c.Saturate(1, 0.6) return item.Stack{} } @@ -53,7 +53,7 @@ func (p Potato) BoneMeal(pos cube.Pos, tx *world.Tx) bool { } // UseOnBlock ... -func (p Potato) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (p Potato) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, p) if !used { return false diff --git a/server/block/pumpkin.go b/server/block/pumpkin.go index 76b7cebca..51777ef38 100644 --- a/server/block/pumpkin.go +++ b/server/block/pumpkin.go @@ -27,7 +27,7 @@ func (p Pumpkin) Instrument() sound.Instrument { } // UseOnBlock ... -func (p Pumpkin) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (p Pumpkin) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, p) if !used { return diff --git a/server/block/pumpkin_seeds.go b/server/block/pumpkin_seeds.go index fa90c7cd0..91e538c8d 100644 --- a/server/block/pumpkin_seeds.go +++ b/server/block/pumpkin_seeds.go @@ -24,7 +24,7 @@ func (PumpkinSeeds) SameCrop(c Crop) bool { } // NeighbourUpdateTick ... -func (p PumpkinSeeds) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (p PumpkinSeeds) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if _, ok := tx.Block(pos.Side(cube.FaceDown)).(Farmland); !ok { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: p}) @@ -74,7 +74,7 @@ func (p PumpkinSeeds) BoneMeal(pos cube.Pos, tx *world.Tx) bool { } // UseOnBlock ... -func (p PumpkinSeeds) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (p PumpkinSeeds) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, p) if !used { return false diff --git a/server/block/purpur.go b/server/block/purpur.go index 5ccd24d69..0d1dafee6 100644 --- a/server/block/purpur.go +++ b/server/block/purpur.go @@ -39,7 +39,7 @@ func (p Purpur) EncodeBlock() (name string, properties map[string]interface{}) { } // UseOnBlock ... -func (p PurpurPillar) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (p PurpurPillar) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, p) if !used { return diff --git a/server/block/quartz.go b/server/block/quartz.go index 5cb5686c7..dff4be6ee 100644 --- a/server/block/quartz.go +++ b/server/block/quartz.go @@ -31,7 +31,7 @@ type ( ) // UseOnBlock handles the rotational placing of quartz pillar blocks. -func (q QuartzPillar) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (q QuartzPillar) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, q) if !used { return diff --git a/server/block/sand.go b/server/block/sand.go index a188bf6df..f7ad54c69 100644 --- a/server/block/sand.go +++ b/server/block/sand.go @@ -26,7 +26,7 @@ func (s Sand) SoilFor(block world.Block) bool { } // NeighbourUpdateTick ... -func (s Sand) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (s Sand) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { s.fall(s, pos, tx) } diff --git a/server/block/sea_pickle.go b/server/block/sea_pickle.go index 27c2db570..4b4a28e33 100644 --- a/server/block/sea_pickle.go +++ b/server/block/sea_pickle.go @@ -74,7 +74,7 @@ func (s SeaPickle) BoneMeal(pos cube.Pos, tx *world.Tx) bool { } // UseOnBlock ... -func (s SeaPickle) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (s SeaPickle) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { if existing, ok := tx.Block(pos).(SeaPickle); ok { if existing.AdditionalCount >= 3 { return false @@ -104,7 +104,7 @@ func (s SeaPickle) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, } // NeighbourUpdateTick ... -func (s SeaPickle) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (s SeaPickle) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !s.canSurvive(pos, tx) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: s}) diff --git a/server/block/short_grass.go b/server/block/short_grass.go index 57147590a..4fadd7a34 100644 --- a/server/block/short_grass.go +++ b/server/block/short_grass.go @@ -53,7 +53,7 @@ func (g ShortGrass) CompostChance() float64 { } // NeighbourUpdateTick ... -func (g ShortGrass) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (g ShortGrass) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !supportsVegetation(g, tx.Block(pos.Side(cube.FaceDown))) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: g}) @@ -66,7 +66,7 @@ func (g ShortGrass) HasLiquidDrops() bool { } // UseOnBlock ... -func (g ShortGrass) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (g ShortGrass) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, g) if !used { return false diff --git a/server/block/sign.go b/server/block/sign.go index d84983831..5cd05a130 100644 --- a/server/block/sign.go +++ b/server/block/sign.go @@ -120,7 +120,7 @@ func (s Sign) Wax(cube.Pos, mgl64.Vec3) (world.Block, bool) { } // Activate ... -func (s Sign) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (s Sign) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if editor, ok := u.(SignEditor); ok && !s.Waxed { editor.OpenSign(pos, s.EditingFrontSide(pos, u.Position())) } else if s.Waxed { @@ -141,7 +141,7 @@ type SignEditor interface { } // UseOnBlock ... -func (s Sign) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (s Sign) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, s) if !used || face == cube.FaceDown { return false @@ -160,7 +160,7 @@ func (s Sign) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx * } // NeighbourUpdateTick ... -func (s Sign) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (s Sign) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if s.Attach.hanging { if _, ok := tx.Block(pos.Side(s.Attach.facing.Opposite().Face())).(Air); ok { tx.SetBlock(pos, nil, nil) diff --git a/server/block/skull.go b/server/block/skull.go index 7863df005..a23c5379c 100644 --- a/server/block/skull.go +++ b/server/block/skull.go @@ -51,7 +51,7 @@ func (s Skull) Model() world.BlockModel { } // UseOnBlock ... -func (s Skull) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (s Skull) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, s) if !used || face == cube.FaceDown { return false diff --git a/server/block/slab.go b/server/block/slab.go index 0be369a88..b952c9062 100644 --- a/server/block/slab.go +++ b/server/block/slab.go @@ -90,7 +90,7 @@ func (s Slab) CanDisplace(b world.Liquid) bool { } // SideClosed ... -func (s Slab) SideClosed(pos, side cube.Pos, tx *world.Tx) bool { +func (s Slab) SideClosed(pos, side cube.Pos, _ *world.Tx) bool { // Only returns true if the side is below the slab and if the slab is not upside down. return !s.Top && side[1] == pos[1]-1 } diff --git a/server/block/smelter.go b/server/block/smelter.go index cad90e06c..46d422eec 100644 --- a/server/block/smelter.go +++ b/server/block/smelter.go @@ -141,7 +141,7 @@ func (s *smelter) Inventory(*world.Tx, cube.Pos) *inventory.Inventory { } // AddViewer adds a viewer to the furnace, so that it is updated whenever the inventory of the furnace is changed. -func (s *smelter) AddViewer(v ContainerViewer, tx *world.Tx, pos cube.Pos) { +func (s *smelter) AddViewer(v ContainerViewer, _ *world.Tx, _ cube.Pos) { s.mu.Lock() defer s.mu.Unlock() s.viewers[v] = struct{}{} @@ -149,7 +149,7 @@ func (s *smelter) AddViewer(v ContainerViewer, tx *world.Tx, pos cube.Pos) { // RemoveViewer removes a viewer from the furnace, so that slot updates in the inventory are no longer sent to // it. -func (s *smelter) RemoveViewer(v ContainerViewer, tx *world.Tx, pos cube.Pos) { +func (s *smelter) RemoveViewer(v ContainerViewer, _ *world.Tx, _ cube.Pos) { s.mu.Lock() defer s.mu.Unlock() if len(s.viewers) == 0 { diff --git a/server/block/smithing_table.go b/server/block/smithing_table.go index 9826fb00a..3d190d572 100644 --- a/server/block/smithing_table.go +++ b/server/block/smithing_table.go @@ -29,7 +29,7 @@ func (s SmithingTable) BreakInfo() BreakInfo { } // Activate ... -func (SmithingTable) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (SmithingTable) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true diff --git a/server/block/smoker.go b/server/block/smoker.go index e3848dccb..f00830818 100644 --- a/server/block/smoker.go +++ b/server/block/smoker.go @@ -34,7 +34,7 @@ func NewSmoker(face cube.Direction) Smoker { } // Tick is called to check if the smoker should update and start or stop smelting. -func (s Smoker) Tick(currentTick int64, pos cube.Pos, tx *world.Tx) { +func (s Smoker) Tick(_ int64, pos cube.Pos, tx *world.Tx) { if s.Lit && rand.Float64() <= 0.016 { // Every three or so seconds. tx.PlaySound(pos.Vec3Centre(), sound.SmokerCrackle{}) } @@ -60,7 +60,7 @@ func (s Smoker) EncodeBlock() (name string, properties map[string]interface{}) { } // UseOnBlock ... -func (s Smoker) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (s Smoker) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, s) if !used { return false @@ -81,7 +81,7 @@ func (s Smoker) BreakInfo() BreakInfo { } // Activate ... -func (s Smoker) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (s Smoker) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true diff --git a/server/block/sponge.go b/server/block/sponge.go index 730975d8b..724ad0b54 100644 --- a/server/block/sponge.go +++ b/server/block/sponge.go @@ -48,7 +48,7 @@ func (s Sponge) EncodeBlock() (string, map[string]any) { // UseOnBlock places the sponge, absorbs nearby water if it's still dry and flags it as wet if any water has been // absorbed. -func (s Sponge) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (s Sponge) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { var particles = false pos, _, used = firstReplaceable(tx, pos, face, s) if !used { @@ -70,7 +70,7 @@ func (s Sponge) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx // NeighbourUpdateTick checks for nearby water flow. If water could be found and the sponge is dry, it will absorb the // water and be flagged as wet. -func (s Sponge) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (s Sponge) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { // The sponge is dry, so it can absorb nearby water. if !s.Wet { if s.absorbWater(pos, tx) > 0 { diff --git a/server/block/spore_blossom.go b/server/block/spore_blossom.go index 60ebb3582..08b310440 100644 --- a/server/block/spore_blossom.go +++ b/server/block/spore_blossom.go @@ -20,7 +20,7 @@ func (s SporeBlossom) HasLiquidDrops() bool { } // NeighbourUpdateTick ... -func (s SporeBlossom) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (s SporeBlossom) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !tx.Block(pos.Side(cube.FaceUp)).Model().FaceSolid(pos.Side(cube.FaceUp), cube.FaceDown, tx) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: s}) @@ -28,7 +28,7 @@ func (s SporeBlossom) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *wo } // UseOnBlock ... -func (s SporeBlossom) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (s SporeBlossom) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, s) if !used { return diff --git a/server/block/stonecutter.go b/server/block/stonecutter.go index de17cc19c..641279ac1 100644 --- a/server/block/stonecutter.go +++ b/server/block/stonecutter.go @@ -28,7 +28,7 @@ func (s Stonecutter) BreakInfo() BreakInfo { } // Activate ... -func (Stonecutter) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (Stonecutter) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { if opener, ok := u.(ContainerOpener); ok { opener.OpenBlockContainer(pos, tx) return true @@ -37,7 +37,7 @@ func (Stonecutter) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u } // UseOnBlock ... -func (s Stonecutter) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (s Stonecutter) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, s) if !used { return diff --git a/server/block/sugar_cane.go b/server/block/sugar_cane.go index 253a8bcb7..07a04a7f0 100644 --- a/server/block/sugar_cane.go +++ b/server/block/sugar_cane.go @@ -19,7 +19,7 @@ type SugarCane struct { } // UseOnBlock ensures the placement of the block is OK. -func (c SugarCane) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (c SugarCane) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, c) if !used { return false @@ -33,7 +33,7 @@ func (c SugarCane) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, } // NeighbourUpdateTick ... -func (c SugarCane) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (c SugarCane) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !c.canGrowHere(pos, tx, true) { tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: c}) @@ -42,7 +42,7 @@ func (c SugarCane) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world } // RandomTick ... -func (c SugarCane) RandomTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (c SugarCane) RandomTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if c.Age < 15 { c.Age++ } else if c.Age == 15 { diff --git a/server/block/tnt.go b/server/block/tnt.go index 0f9e9192b..da8cac362 100644 --- a/server/block/tnt.go +++ b/server/block/tnt.go @@ -17,7 +17,7 @@ type TNT struct { } // Activate ... -func (t TNT) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (t TNT) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { held, _ := u.HeldItems() if _, ok := held.Enchantment(enchantment.FireAspect{}); ok { t.Ignite(pos, tx, nil) @@ -34,7 +34,7 @@ func (t TNT) Ignite(pos cube.Pos, tx *world.Tx, _ world.Entity) bool { } // Explode ... -func (t TNT) Explode(explosionPos mgl64.Vec3, pos cube.Pos, tx *world.Tx, c ExplosionConfig) { +func (t TNT) Explode(_ mgl64.Vec3, pos cube.Pos, tx *world.Tx, _ ExplosionConfig) { spawnTnt(pos, tx, time.Second/2+time.Duration(rand.Intn(int(time.Second+time.Second/2)))) } diff --git a/server/block/torch.go b/server/block/torch.go index 24124a0aa..8b15a535d 100644 --- a/server/block/torch.go +++ b/server/block/torch.go @@ -34,7 +34,7 @@ func (t Torch) LightEmissionLevel() uint8 { } // UseOnBlock ... -func (t Torch) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (t Torch) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, face, used := firstReplaceable(tx, pos, face, t) if !used { return false @@ -65,7 +65,7 @@ func (t Torch) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx } // NeighbourUpdateTick ... -func (t Torch) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (t Torch) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if !tx.Block(pos.Side(t.Facing)).Model().FaceSolid(pos.Side(t.Facing), t.Facing.Opposite(), tx) { tx.SetBlock(pos, nil, nil) dropItem(tx, item.NewStack(t, 1), pos.Vec3Centre()) diff --git a/server/block/wall.go b/server/block/wall.go index 237db416e..56ab35dde 100644 --- a/server/block/wall.go +++ b/server/block/wall.go @@ -71,7 +71,7 @@ func (w Wall) BreakInfo() BreakInfo { } // NeighbourUpdateTick ... -func (w Wall) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (w Wall) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { w, connectionsUpdated := w.calculateConnections(tx, pos) w, postUpdated := w.calculatePost(tx, pos) if connectionsUpdated || postUpdated { @@ -80,7 +80,7 @@ func (w Wall) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) } // UseOnBlock ... -func (w Wall) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (w Wall) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, _, used = firstReplaceable(tx, pos, face, w) if !used { return diff --git a/server/block/water.go b/server/block/water.go index badde7087..ddbfb6a2c 100644 --- a/server/block/water.go +++ b/server/block/water.go @@ -27,7 +27,7 @@ type Water struct { } // EntityInside ... -func (w Water) EntityInside(pos cube.Pos, tx *world.Tx, e world.Entity) { +func (w Water) EntityInside(_ cube.Pos, _ *world.Tx, e world.Entity) { if fallEntity, ok := e.(fallDistanceEntity); ok { fallEntity.ResetFallDistance() } @@ -83,7 +83,7 @@ func (Water) LightDiffusionLevel() uint8 { } // ScheduledTick ... -func (w Water) ScheduledTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { +func (w Water) ScheduledTick(pos cube.Pos, tx *world.Tx, _ *rand.Rand) { if w.Depth == 7 { // Attempt to form new water source blocks. count := 0 @@ -113,7 +113,7 @@ func (w Water) ScheduledTick(pos cube.Pos, tx *world.Tx, r *rand.Rand) { } // NeighbourUpdateTick ... -func (Water) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (Water) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if tx.World().Dimension().WaterEvaporates() { // Particles are spawned client-side. tx.SetLiquid(pos, nil) diff --git a/server/block/wheat_seeds.go b/server/block/wheat_seeds.go index e8b78b9ee..9a9fc0987 100644 --- a/server/block/wheat_seeds.go +++ b/server/block/wheat_seeds.go @@ -31,7 +31,7 @@ func (s WheatSeeds) BoneMeal(pos cube.Pos, tx *world.Tx) bool { } // UseOnBlock ... -func (s WheatSeeds) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (s WheatSeeds) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, s) if !used { return false diff --git a/server/block/wood.go b/server/block/wood.go index f6f56bb2d..e0dc67244 100644 --- a/server/block/wood.go +++ b/server/block/wood.go @@ -51,7 +51,7 @@ func (Wood) FuelInfo() item.FuelInfo { } // UseOnBlock ... -func (w Wood) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { +func (w Wood) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) (used bool) { pos, face, used = firstReplaceable(tx, pos, face, w) if !used { return diff --git a/server/block/wood_door.go b/server/block/wood_door.go index eaef2910c..5eaa52590 100644 --- a/server/block/wood_door.go +++ b/server/block/wood_door.go @@ -49,7 +49,7 @@ func (d WoodDoor) Model() world.BlockModel { } // NeighbourUpdateTick ... -func (d WoodDoor) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (d WoodDoor) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if d.Top { if _, ok := tx.Block(pos.Side(cube.FaceDown)).(WoodDoor); !ok { tx.SetBlock(pos, nil, nil) @@ -67,7 +67,7 @@ func (d WoodDoor) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world. } // UseOnBlock handles the directional placing of doors -func (d WoodDoor) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (d WoodDoor) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { if face != cube.FaceUp { // Doors can only be placed when clicking the top face. return false @@ -105,7 +105,7 @@ func (d WoodDoor) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, } // Activate ... -func (d WoodDoor) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (d WoodDoor) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, _ item.User, _ *item.UseContext) bool { d.Open = !d.Open tx.SetBlock(pos, d, nil) diff --git a/server/block/wood_fence_gate.go b/server/block/wood_fence_gate.go index 863e79868..d4708b65b 100644 --- a/server/block/wood_fence_gate.go +++ b/server/block/wood_fence_gate.go @@ -46,7 +46,7 @@ func (WoodFenceGate) FuelInfo() item.FuelInfo { } // UseOnBlock ... -func (f WoodFenceGate) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { +func (f WoodFenceGate) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user item.User, ctx *item.UseContext) bool { pos, _, used := firstReplaceable(tx, pos, face, f) if !used { return false @@ -59,7 +59,7 @@ func (f WoodFenceGate) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.V } // NeighbourUpdateTick ... -func (f WoodFenceGate) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, tx *world.Tx) { +func (f WoodFenceGate) NeighbourUpdateTick(pos, _ cube.Pos, tx *world.Tx) { if f.shouldBeLowered(pos, tx) != f.Lowered { f.Lowered = !f.Lowered tx.SetBlock(pos, f, nil) @@ -75,7 +75,7 @@ func (f WoodFenceGate) shouldBeLowered(pos cube.Pos, tx *world.Tx) bool { } // Activate ... -func (f WoodFenceGate) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (f WoodFenceGate) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, _ *item.UseContext) bool { f.Open = !f.Open if f.Open && f.Facing.Opposite() == u.Rotation().Direction() { f.Facing = f.Facing.Opposite() diff --git a/server/block/wood_trapdoor.go b/server/block/wood_trapdoor.go index 594ceedf5..48e745e1c 100644 --- a/server/block/wood_trapdoor.go +++ b/server/block/wood_trapdoor.go @@ -56,7 +56,7 @@ func (t WoodTrapdoor) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Ve } // Activate ... -func (t WoodTrapdoor) Activate(pos cube.Pos, clickedFace cube.Face, tx *world.Tx, u item.User, ctx *item.UseContext) bool { +func (t WoodTrapdoor) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, _ item.User, _ *item.UseContext) bool { t.Open = !t.Open tx.SetBlock(pos, t, nil) if t.Open { diff --git a/server/entity/area_effect_cloud_behaviour.go b/server/entity/area_effect_cloud_behaviour.go index 98b4abb66..056b94443 100644 --- a/server/entity/area_effect_cloud_behaviour.go +++ b/server/entity/area_effect_cloud_behaviour.go @@ -86,7 +86,7 @@ func (a *AreaEffectCloudBehaviour) Tick(e *Ent, tx *world.Tx) *Movement { } pos := e.Position() - if a.subtractTickRadius(e) { + if a.subtractTickRadius() { for _, v := range tx.Viewers(pos) { v.ViewEntityState(e) } @@ -155,7 +155,7 @@ func (a *AreaEffectCloudBehaviour) applyEffects(pos mgl64.Vec3, ent *Ent, entiti // subtractTickRadius grows the cloud's radius by the radiusTickGrowth value. If the // radius goes under 1/2, it will close the entity. -func (a *AreaEffectCloudBehaviour) subtractTickRadius(e *Ent) bool { +func (a *AreaEffectCloudBehaviour) subtractTickRadius() bool { a.radius += a.conf.RadiusTickGrowth if a.radius < 0.5 { a.stationary.close = true diff --git a/server/entity/bottle_of_enchanting.go b/server/entity/bottle_of_enchanting.go index e69c053da..e268d3e11 100644 --- a/server/entity/bottle_of_enchanting.go +++ b/server/entity/bottle_of_enchanting.go @@ -27,7 +27,7 @@ var bottleOfEnchantingConf = ProjectileBehaviourConfig{ // spawnExperience spawns experience orbs with a value of 3-11 at the target of // a trace.Result. -func spawnExperience(e *Ent, tx *world.Tx, target trace.Result) { +func spawnExperience(_ *Ent, tx *world.Tx, target trace.Result) { for _, orb := range NewExperienceOrbs(target.Position(), rand.Intn(9)+3) { tx.AddEntity(orb) } @@ -58,6 +58,6 @@ func (bottleOfEnchantingType) DecodeNBT(_ map[string]any, data *world.EntityData data.Data = bottleOfEnchantingConf.New() } -func (bottleOfEnchantingType) EncodeNBT(data *world.EntityData) map[string]any { +func (bottleOfEnchantingType) EncodeNBT(_ *world.EntityData) map[string]any { return nil } diff --git a/server/entity/egg.go b/server/entity/egg.go index 08f98f254..ae64b5956 100644 --- a/server/entity/egg.go +++ b/server/entity/egg.go @@ -36,5 +36,5 @@ func (eggType) BBox(world.Entity) cube.BBox { return cube.Box(-0.125, 0, -0.125, 0.125, 0.25, 0.125) } -func (eggType) DecodeNBT(m map[string]any, data *world.EntityData) { data.Data = eggConf.New() } -func (eggType) EncodeNBT(data *world.EntityData) map[string]any { return nil } +func (eggType) DecodeNBT(_ map[string]any, data *world.EntityData) { data.Data = eggConf.New() } +func (eggType) EncodeNBT(_ *world.EntityData) map[string]any { return nil } diff --git a/server/entity/text.go b/server/entity/text.go index a5556358a..bd919e744 100644 --- a/server/entity/text.go +++ b/server/entity/text.go @@ -26,4 +26,4 @@ func (textType) BBox(world.Entity) cube.BBox { return cube.BBox{} } func (textType) NetworkEncodeEntity() string { return "minecraft:falling_block" } func (textType) DecodeNBT(_ map[string]any, data *world.EntityData) { data.Data = textConf.New() } -func (textType) EncodeNBT(data *world.EntityData) map[string]any { return nil } +func (textType) EncodeNBT(_ *world.EntityData) map[string]any { return nil } diff --git a/server/item/apple.go b/server/item/apple.go index fdc63fce9..defce89e1 100644 --- a/server/item/apple.go +++ b/server/item/apple.go @@ -10,7 +10,7 @@ type Apple struct { } // Consume ... -func (a Apple) Consume(tx *world.Tx, c Consumer) Stack { +func (a Apple) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(4, 2.4) return Stack{} } diff --git a/server/item/armour_trim.go b/server/item/armour_trim.go index c0e87cf04..db60e1b17 100644 --- a/server/item/armour_trim.go +++ b/server/item/armour_trim.go @@ -37,7 +37,7 @@ func ArmourTrimMaterialFromString(name string) ArmourTrimMaterial { return NetherQuartz{} } - //TODO: add redstone material once pr is merged + // TODO: add redstone material once pr is merged panic("should not happen") } diff --git a/server/item/axe.go b/server/item/axe.go index a3c646ceb..87e64f6c6 100644 --- a/server/item/axe.go +++ b/server/item/axe.go @@ -16,7 +16,7 @@ type Axe struct { } // UseOnBlock handles the stripping of logs when a player clicks a log with an axe. -func (a Axe) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (a Axe) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool { if s, ok := tx.Block(pos).(Strippable); ok { if res, so, ok := s.Strip(); ok { tx.SetBlock(pos, res, nil) diff --git a/server/item/baked_potato.go b/server/item/baked_potato.go index d4e5ada8f..2a0e43482 100644 --- a/server/item/baked_potato.go +++ b/server/item/baked_potato.go @@ -8,7 +8,7 @@ type BakedPotato struct { } // Consume ... -func (BakedPotato) Consume(tx *world.Tx, c Consumer) Stack { +func (BakedPotato) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(5, 6) return Stack{} } diff --git a/server/item/beef.go b/server/item/beef.go index 42fc40d60..83370ac57 100644 --- a/server/item/beef.go +++ b/server/item/beef.go @@ -11,7 +11,7 @@ type Beef struct { } // Consume ... -func (b Beef) Consume(tx *world.Tx, c Consumer) Stack { +func (b Beef) Consume(_ *world.Tx, c Consumer) Stack { if b.Cooked { c.Saturate(8, 12.8) } else { diff --git a/server/item/beetroot.go b/server/item/beetroot.go index dc1bf7766..57aa4f256 100644 --- a/server/item/beetroot.go +++ b/server/item/beetroot.go @@ -10,7 +10,7 @@ type Beetroot struct { } // Consume ... -func (b Beetroot) Consume(tx *world.Tx, c Consumer) Stack { +func (b Beetroot) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(1, 1.2) return Stack{} } diff --git a/server/item/beetroot_soup.go b/server/item/beetroot_soup.go index 5586474d4..4cd75062e 100644 --- a/server/item/beetroot_soup.go +++ b/server/item/beetroot_soup.go @@ -15,7 +15,7 @@ func (BeetrootSoup) MaxCount() int { } // Consume ... -func (BeetrootSoup) Consume(tx *world.Tx, c Consumer) Stack { +func (BeetrootSoup) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(6, 7.2) return NewStack(Bowl{}, 1) } diff --git a/server/item/bone_meal.go b/server/item/bone_meal.go index bf003e249..ec1151da0 100644 --- a/server/item/bone_meal.go +++ b/server/item/bone_meal.go @@ -17,7 +17,7 @@ type BoneMealAffected interface { } // UseOnBlock ... -func (b BoneMeal) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (b BoneMeal) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool { if bm, ok := tx.Block(pos).(BoneMealAffected); ok && bm.BoneMeal(pos, tx) { ctx.SubtractFromCount(1) tx.AddParticle(pos.Vec3(), particle.BoneMeal{}) diff --git a/server/item/boots.go b/server/item/boots.go index 76ce8f4a1..7f9a40e81 100644 --- a/server/item/boots.go +++ b/server/item/boots.go @@ -13,7 +13,7 @@ type Boots struct { } // Use handles the auto-equipping of boots in the armour slot when using it. -func (b Boots) Use(tx *world.Tx, user User, ctx *UseContext) bool { +func (b Boots) Use(_ *world.Tx, _ User, ctx *UseContext) bool { ctx.SwapHeldWithArmour(3) return false } diff --git a/server/item/bread.go b/server/item/bread.go index f7bc4923e..f98e33788 100644 --- a/server/item/bread.go +++ b/server/item/bread.go @@ -8,7 +8,7 @@ type Bread struct { } // Consume ... -func (Bread) Consume(tx *world.Tx, c Consumer) Stack { +func (Bread) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(5, 6) return Stack{} } diff --git a/server/item/bucket.go b/server/item/bucket.go index 177b704a9..31c830904 100644 --- a/server/item/bucket.go +++ b/server/item/bucket.go @@ -78,7 +78,7 @@ func (b Bucket) ConsumeDuration() time.Duration { } // Consume ... -func (b Bucket) Consume(tx *world.Tx, c Consumer) Stack { +func (b Bucket) Consume(_ *world.Tx, c Consumer) Stack { for _, effect := range c.Effects() { c.RemoveEffect(effect.Type()) } @@ -99,7 +99,7 @@ func (b Bucket) FuelInfo() FuelInfo { } // UseOnBlock handles the bucket filling and emptying logic. -func (b Bucket) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (b Bucket) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool { if b.Content.milk { return false } diff --git a/server/item/chestplate.go b/server/item/chestplate.go index b0e01c03e..546208de4 100644 --- a/server/item/chestplate.go +++ b/server/item/chestplate.go @@ -13,7 +13,7 @@ type Chestplate struct { } // Use handles the using of a chestplate to auto-equip it in the designated armour slot. -func (c Chestplate) Use(tx *world.Tx, user User, ctx *UseContext) bool { +func (c Chestplate) Use(_ *world.Tx, _ User, ctx *UseContext) bool { ctx.SwapHeldWithArmour(1) return false } diff --git a/server/item/chicken.go b/server/item/chicken.go index ce5e361a5..25445a9b1 100644 --- a/server/item/chicken.go +++ b/server/item/chicken.go @@ -16,7 +16,7 @@ type Chicken struct { } // Consume ... -func (c Chicken) Consume(tx *world.Tx, co Consumer) Stack { +func (c Chicken) Consume(_ *world.Tx, co Consumer) Stack { if c.Cooked { co.Saturate(6, 7.2) } else { diff --git a/server/item/cod.go b/server/item/cod.go index 75ad79f49..735c87079 100644 --- a/server/item/cod.go +++ b/server/item/cod.go @@ -11,7 +11,7 @@ type Cod struct { } // Consume ... -func (c Cod) Consume(tx *world.Tx, co Consumer) Stack { +func (c Cod) Consume(_ *world.Tx, co Consumer) Stack { if c.Cooked { co.Saturate(5, 6) } else { diff --git a/server/item/cookie.go b/server/item/cookie.go index febe8d7fc..ac69e5e7a 100644 --- a/server/item/cookie.go +++ b/server/item/cookie.go @@ -8,7 +8,7 @@ type Cookie struct { } // Consume ... -func (Cookie) Consume(tx *world.Tx, c Consumer) Stack { +func (Cookie) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(2, 0.4) return Stack{} } diff --git a/server/item/dried_kelp.go b/server/item/dried_kelp.go index aebc7cd8c..0a483b584 100644 --- a/server/item/dried_kelp.go +++ b/server/item/dried_kelp.go @@ -19,7 +19,7 @@ func (DriedKelp) ConsumeDuration() time.Duration { } // Consume ... -func (DriedKelp) Consume(tx *world.Tx, c Consumer) Stack { +func (DriedKelp) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(1, 0.2) return Stack{} } diff --git a/server/item/dye.go b/server/item/dye.go index 0c94e7f04..602aaf9ee 100644 --- a/server/item/dye.go +++ b/server/item/dye.go @@ -13,7 +13,7 @@ type Dye struct { } // UseOnBlock implements the colouring behaviour of signs. -func (d Dye) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (d Dye) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { if dy, ok := tx.Block(pos).(dyeable); ok { if res, ok := dy.Dye(pos, user.Position(), d.Colour); ok { tx.SetBlock(pos, res, nil) diff --git a/server/item/elytra.go b/server/item/elytra.go index 893a8c08d..21e7099d3 100644 --- a/server/item/elytra.go +++ b/server/item/elytra.go @@ -6,7 +6,7 @@ import "github.com/df-mc/dragonfly/server/world" type Elytra struct{} // Use handles the using of an elytra to auto-equip it in an armour slot. -func (Elytra) Use(tx *world.Tx, user User, ctx *UseContext) bool { +func (Elytra) Use(_ *world.Tx, _ User, ctx *UseContext) bool { ctx.SwapHeldWithArmour(1) return false } diff --git a/server/item/enchanted_apple.go b/server/item/enchanted_apple.go index 45bbcceaf..901b09178 100644 --- a/server/item/enchanted_apple.go +++ b/server/item/enchanted_apple.go @@ -20,7 +20,7 @@ func (EnchantedApple) ConsumeDuration() time.Duration { } // Consume ... -func (EnchantedApple) Consume(tx *world.Tx, c Consumer) Stack { +func (EnchantedApple) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(4, 9.6) c.AddEffect(effect.New(effect.Absorption{}, 4, 2*time.Minute)) c.AddEffect(effect.New(effect.Regeneration{}, 2, 30*time.Second)) diff --git a/server/item/enchantment/vanishing.go b/server/item/enchantment/vanishing.go index 04eda9850..5f45f8555 100644 --- a/server/item/enchantment/vanishing.go +++ b/server/item/enchantment/vanishing.go @@ -29,7 +29,7 @@ func (CurseOfVanishing) Rarity() item.EnchantmentRarity { } // CompatibleWithEnchantment ... -func (CurseOfVanishing) CompatibleWithEnchantment(t item.EnchantmentType) bool { +func (CurseOfVanishing) CompatibleWithEnchantment(_ item.EnchantmentType) bool { return true } diff --git a/server/item/fire_charge.go b/server/item/fire_charge.go index e0e3ad456..d98e7133b 100644 --- a/server/item/fire_charge.go +++ b/server/item/fire_charge.go @@ -19,7 +19,7 @@ func (f FireCharge) EncodeItem() (name string, meta int16) { } // UseOnBlock ... -func (f FireCharge) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (f FireCharge) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { if l, ok := tx.Block(pos).(ignitable); ok && l.Ignite(pos, tx, user) { ctx.SubtractFromCount(1) tx.PlaySound(pos.Vec3Centre(), sound.FireCharge{}) diff --git a/server/item/firework.go b/server/item/firework.go index 6683dccf4..c6e42c4aa 100644 --- a/server/item/firework.go +++ b/server/item/firework.go @@ -38,7 +38,7 @@ func (f Firework) Use(tx *world.Tx, user User, ctx *UseContext) bool { } // UseOnBlock ... -func (f Firework) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (f Firework) UseOnBlock(pos cube.Pos, _ cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { fpos := pos.Vec3().Add(clickPos) create := tx.World().EntityRegistry().Config().Firework opts := world.EntitySpawnOpts{Position: fpos, Rotation: cube.Rotation{rand.Float64() * 360, 90}} diff --git a/server/item/flint_and_steel.go b/server/item/flint_and_steel.go index 03bb11448..4c3984c13 100644 --- a/server/item/flint_and_steel.go +++ b/server/item/flint_and_steel.go @@ -32,7 +32,7 @@ type ignitable interface { } // UseOnBlock ... -func (f FlintAndSteel) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (f FlintAndSteel) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { ctx.DamageItem(1) if l, ok := tx.Block(pos).(ignitable); ok && l.Ignite(pos, tx, user) { return true diff --git a/server/item/glass_bottle.go b/server/item/glass_bottle.go index 1c28550ae..70eff88c7 100644 --- a/server/item/glass_bottle.go +++ b/server/item/glass_bottle.go @@ -19,7 +19,7 @@ type bottleFiller interface { } // UseOnBlock ... -func (g GlassBottle) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (g GlassBottle) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool { bl := tx.Block(pos) if b, ok := bl.(bottleFiller); ok { var res world.Block diff --git a/server/item/goat_horn.go b/server/item/goat_horn.go index 01d84884c..2a6e1759c 100644 --- a/server/item/goat_horn.go +++ b/server/item/goat_horn.go @@ -26,7 +26,7 @@ func (GoatHorn) Cooldown() time.Duration { } // Use ... -func (g GoatHorn) Use(tx *world.Tx, user User, ctx *UseContext) bool { +func (g GoatHorn) Use(tx *world.Tx, user User, _ *UseContext) bool { tx.PlaySound(user.Position(), sound.GoatHorn{Horn: g.Type}) time.AfterFunc(time.Second, func() { user.H().ExecWorld(g.releaseItem) diff --git a/server/item/golden_apple.go b/server/item/golden_apple.go index 807e945c1..20ba62073 100644 --- a/server/item/golden_apple.go +++ b/server/item/golden_apple.go @@ -20,7 +20,7 @@ func (e GoldenApple) ConsumeDuration() time.Duration { } // Consume ... -func (e GoldenApple) Consume(tx *world.Tx, c Consumer) Stack { +func (e GoldenApple) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(4, 9.6) c.AddEffect(effect.New(effect.Absorption{}, 1, 2*time.Minute)) c.AddEffect(effect.New(effect.Regeneration{}, 2, 5*time.Second)) diff --git a/server/item/golden_carrot.go b/server/item/golden_carrot.go index 03bef5429..0f51e4a8f 100644 --- a/server/item/golden_carrot.go +++ b/server/item/golden_carrot.go @@ -9,7 +9,7 @@ type GoldenCarrot struct { } // Consume ... -func (GoldenCarrot) Consume(tx *world.Tx, c Consumer) Stack { +func (GoldenCarrot) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(6, 14.4) return Stack{} } diff --git a/server/item/helmet.go b/server/item/helmet.go index 9ed907294..87bc5eced 100644 --- a/server/item/helmet.go +++ b/server/item/helmet.go @@ -13,7 +13,7 @@ type Helmet struct { } // Use handles the using of a helmet to auto-equip it in an armour slot. -func (h Helmet) Use(tx *world.Tx, user User, ctx *UseContext) bool { +func (h Helmet) Use(_ *world.Tx, _ User, ctx *UseContext) bool { ctx.SwapHeldWithArmour(0) return false } diff --git a/server/item/hoe.go b/server/item/hoe.go index 5720e98c8..d1b0b1701 100644 --- a/server/item/hoe.go +++ b/server/item/hoe.go @@ -15,7 +15,7 @@ type Hoe struct { } // UseOnBlock will turn a dirt or grass block into a farmland if the necessary properties are met. -func (h Hoe) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (h Hoe) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool { if b, ok := tx.Block(pos).(tillable); ok { if res, ok := b.Till(); ok { if face == cube.FaceDown { diff --git a/server/item/honeycomb.go b/server/item/honeycomb.go index 3ce1bf397..6938a31ce 100644 --- a/server/item/honeycomb.go +++ b/server/item/honeycomb.go @@ -12,7 +12,7 @@ type Honeycomb struct{} // UseOnBlock handles the logic of using an ink sac on a sign. Glowing ink sacs turn the text of these signs glowing, // whereas normal ink sacs revert them back to non-glowing text. -func (Honeycomb) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (Honeycomb) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { if wa, ok := tx.Block(pos).(waxable); ok { if res, ok := wa.Wax(pos, user.Position()); ok { tx.SetBlock(pos, res, nil) diff --git a/server/item/ink_sac.go b/server/item/ink_sac.go index d62de0058..f2e5e8d8a 100644 --- a/server/item/ink_sac.go +++ b/server/item/ink_sac.go @@ -15,7 +15,7 @@ type InkSac struct { // UseOnBlock handles the logic of using an ink sac on a sign. Glowing ink sacs turn the text of these signs glowing, // whereas normal ink sacs revert them back to non-glowing text. -func (i InkSac) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (i InkSac) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { if in, ok := tx.Block(pos).(inkable); ok { if res, ok := in.Ink(pos, user.Position(), i.Glowing); ok { tx.SetBlock(pos, res, nil) diff --git a/server/item/leggings.go b/server/item/leggings.go index 1b8c8ac62..6102e3b8a 100644 --- a/server/item/leggings.go +++ b/server/item/leggings.go @@ -13,7 +13,7 @@ type Leggings struct { } // Use handles the auto-equipping of leggings in an armour slot by using the item. -func (l Leggings) Use(tx *world.Tx, user User, ctx *UseContext) bool { +func (l Leggings) Use(_ *world.Tx, _ User, ctx *UseContext) bool { ctx.SwapHeldWithArmour(2) return false } diff --git a/server/item/melon_slice.go b/server/item/melon_slice.go index 817fe1ac4..5245243d5 100644 --- a/server/item/melon_slice.go +++ b/server/item/melon_slice.go @@ -19,7 +19,7 @@ func (m MelonSlice) ConsumeDuration() time.Duration { } // Consume ... -func (m MelonSlice) Consume(tx *world.Tx, c Consumer) Stack { +func (m MelonSlice) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(2, 1.2) return Stack{} } diff --git a/server/item/mushroom_stew.go b/server/item/mushroom_stew.go index 56354de91..0014ad604 100644 --- a/server/item/mushroom_stew.go +++ b/server/item/mushroom_stew.go @@ -15,7 +15,7 @@ func (MushroomStew) MaxCount() int { } // Consume ... -func (MushroomStew) Consume(tx *world.Tx, c Consumer) Stack { +func (MushroomStew) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(6, 7.2) return NewStack(Bowl{}, 1) } diff --git a/server/item/mutton.go b/server/item/mutton.go index 815b0d1db..133b35053 100644 --- a/server/item/mutton.go +++ b/server/item/mutton.go @@ -11,7 +11,7 @@ type Mutton struct { } // Consume ... -func (m Mutton) Consume(tx *world.Tx, c Consumer) Stack { +func (m Mutton) Consume(_ *world.Tx, c Consumer) Stack { if m.Cooked { c.Saturate(6, 9.6) } else { diff --git a/server/item/poisonous_potato.go b/server/item/poisonous_potato.go index c921a41a4..4f5c9c6b1 100644 --- a/server/item/poisonous_potato.go +++ b/server/item/poisonous_potato.go @@ -13,7 +13,7 @@ type PoisonousPotato struct { } // Consume ... -func (p PoisonousPotato) Consume(tx *world.Tx, c Consumer) Stack { +func (p PoisonousPotato) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(2, 1.2) if rand.Float64() < 0.6 { c.AddEffect(effect.New(effect.Poison{}, 1, 5*time.Second)) diff --git a/server/item/porkchop.go b/server/item/porkchop.go index d95bd23dd..310cd10bb 100644 --- a/server/item/porkchop.go +++ b/server/item/porkchop.go @@ -11,7 +11,7 @@ type Porkchop struct { } // Consume ... -func (p Porkchop) Consume(tx *world.Tx, c Consumer) Stack { +func (p Porkchop) Consume(_ *world.Tx, c Consumer) Stack { if p.Cooked { c.Saturate(8, 12.8) } else { diff --git a/server/item/potion.go b/server/item/potion.go index 7e877c0b6..d30983f72 100644 --- a/server/item/potion.go +++ b/server/item/potion.go @@ -28,7 +28,7 @@ func (p Potion) ConsumeDuration() time.Duration { } // Consume ... -func (p Potion) Consume(tx *world.Tx, c Consumer) Stack { +func (p Potion) Consume(_ *world.Tx, c Consumer) Stack { for _, effect := range p.Type.Effects() { c.AddEffect(effect) } diff --git a/server/item/pufferfish.go b/server/item/pufferfish.go index 292e6be89..c61a1966a 100644 --- a/server/item/pufferfish.go +++ b/server/item/pufferfish.go @@ -12,7 +12,7 @@ type Pufferfish struct { } // Consume ... -func (p Pufferfish) Consume(tx *world.Tx, c Consumer) Stack { +func (p Pufferfish) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(1, 0.2) c.AddEffect(effect.New(effect.Hunger{}, 3, 15*time.Second)) c.AddEffect(effect.New(effect.Poison{}, 2, time.Minute)) diff --git a/server/item/pumpkin_pie.go b/server/item/pumpkin_pie.go index f5bc82ab6..b3b6272b6 100644 --- a/server/item/pumpkin_pie.go +++ b/server/item/pumpkin_pie.go @@ -8,7 +8,7 @@ type PumpkinPie struct { } // Consume ... -func (PumpkinPie) Consume(tx *world.Tx, c Consumer) Stack { +func (PumpkinPie) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(8, 4.8) return Stack{} } diff --git a/server/item/rabbit.go b/server/item/rabbit.go index 2d25f6430..3e339b5c3 100644 --- a/server/item/rabbit.go +++ b/server/item/rabbit.go @@ -11,7 +11,7 @@ type Rabbit struct { } // Consume ... -func (r Rabbit) Consume(tx *world.Tx, c Consumer) Stack { +func (r Rabbit) Consume(_ *world.Tx, c Consumer) Stack { if r.Cooked { c.Saturate(5, 6) } else { diff --git a/server/item/rabbit_stew.go b/server/item/rabbit_stew.go index 800a83753..1de8a8900 100644 --- a/server/item/rabbit_stew.go +++ b/server/item/rabbit_stew.go @@ -15,7 +15,7 @@ func (RabbitStew) MaxCount() int { } // Consume ... -func (RabbitStew) Consume(tx *world.Tx, c Consumer) Stack { +func (RabbitStew) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(10, 12) return NewStack(Bowl{}, 1) } diff --git a/server/item/rotten_flesh.go b/server/item/rotten_flesh.go index 0ffd51cfd..d3737a5e9 100644 --- a/server/item/rotten_flesh.go +++ b/server/item/rotten_flesh.go @@ -13,7 +13,7 @@ type RottenFlesh struct { } // Consume ... -func (RottenFlesh) Consume(tx *world.Tx, c Consumer) Stack { +func (RottenFlesh) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(4, 0.8) if rand.Float64() < 0.8 { c.AddEffect(effect.New(effect.Hunger{}, 1, 30*time.Second)) diff --git a/server/item/salmon.go b/server/item/salmon.go index 216c28e3d..b31b959f7 100644 --- a/server/item/salmon.go +++ b/server/item/salmon.go @@ -11,7 +11,7 @@ type Salmon struct { } // Consume ... -func (s Salmon) Consume(tx *world.Tx, c Consumer) Stack { +func (s Salmon) Consume(_ *world.Tx, c Consumer) Stack { if s.Cooked { c.Saturate(6, 9.6) } else { diff --git a/server/item/shears.go b/server/item/shears.go index 583c97f44..a3b20d188 100644 --- a/server/item/shears.go +++ b/server/item/shears.go @@ -10,7 +10,7 @@ import ( type Shears struct{} // UseOnBlock ... -func (s Shears) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (s Shears) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool { if face == cube.FaceUp || face == cube.FaceDown { // Pumpkins can only be carved when one of the horizontal faces is clicked. return false diff --git a/server/item/shovel.go b/server/item/shovel.go index cbcebe4a2..6463b0c54 100644 --- a/server/item/shovel.go +++ b/server/item/shovel.go @@ -16,7 +16,7 @@ type Shovel struct { } // UseOnBlock handles the creation of dirt path blocks from dirt or grass blocks. -func (s Shovel) UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool { +func (s Shovel) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool { if b, ok := tx.Block(pos).(shovellable); ok { if res, ok := b.Shovel(); ok { if face == cube.FaceDown { diff --git a/server/item/spider_eye.go b/server/item/spider_eye.go index d64259bac..544a78f03 100644 --- a/server/item/spider_eye.go +++ b/server/item/spider_eye.go @@ -12,7 +12,7 @@ type SpiderEye struct { } // Consume ... -func (SpiderEye) Consume(tx *world.Tx, c Consumer) Stack { +func (SpiderEye) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(2, 3.2) c.AddEffect(effect.New(effect.Poison{}, 1, time.Second*5)) return Stack{} diff --git a/server/item/suspicious_stew.go b/server/item/suspicious_stew.go index d76d9cb19..60e5d83ac 100644 --- a/server/item/suspicious_stew.go +++ b/server/item/suspicious_stew.go @@ -28,7 +28,7 @@ func (s SuspiciousStew) EncodeItem() (name string, meta int16) { } // Consume ... -func (s SuspiciousStew) Consume(tx *world.Tx, c Consumer) Stack { +func (s SuspiciousStew) Consume(_ *world.Tx, c Consumer) Stack { for _, effect := range s.Type.Effects() { c.AddEffect(effect) } diff --git a/server/item/suspicious_stew_type.go b/server/item/suspicious_stew_type.go index 0fe833210..8d7bf7d03 100644 --- a/server/item/suspicious_stew_type.go +++ b/server/item/suspicious_stew_type.go @@ -75,8 +75,7 @@ func (s stewType) Uint8() uint8 { // Effects returns suspicious stew effects. func (s stewType) Effects() []effect.Effect { - effects := []effect.Effect{} - + var effects []effect.Effect switch s.Uint8() { case 0: effects = append(effects, effect.New(effect.NightVision{}, 1, time.Second*4)) diff --git a/server/item/tropical_fish.go b/server/item/tropical_fish.go index cf7d3759d..c33d8a631 100644 --- a/server/item/tropical_fish.go +++ b/server/item/tropical_fish.go @@ -8,7 +8,7 @@ type TropicalFish struct { } // Consume ... -func (TropicalFish) Consume(tx *world.Tx, c Consumer) Stack { +func (TropicalFish) Consume(_ *world.Tx, c Consumer) Stack { c.Saturate(1, 0.2) return Stack{} } diff --git a/server/item/turtle_shell.go b/server/item/turtle_shell.go index 4aacdaf4d..42ec89208 100644 --- a/server/item/turtle_shell.go +++ b/server/item/turtle_shell.go @@ -7,7 +7,7 @@ import "github.com/df-mc/dragonfly/server/world" type TurtleShell struct{} // Use handles the using of a turtle shell to auto-equip it in an armour slot. -func (TurtleShell) Use(tx *world.Tx, user User, ctx *UseContext) bool { +func (TurtleShell) Use(_ *world.Tx, _ User, ctx *UseContext) bool { ctx.SwapHeldWithArmour(0) return false } diff --git a/server/session/handler_block_pick_request.go b/server/session/handler_block_pick_request.go index 2c1308b28..3fe28075b 100644 --- a/server/session/handler_block_pick_request.go +++ b/server/session/handler_block_pick_request.go @@ -10,7 +10,7 @@ import ( type BlockPickRequestHandler struct{} // Handle ... -func (b BlockPickRequestHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (b BlockPickRequestHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error { pk := p.(*packet.BlockPickRequest) c.PickBlock(cube.Pos{int(pk.Position.X()), int(pk.Position.Y()), int(pk.Position.Z())}) return nil diff --git a/server/session/handler_book_edit.go b/server/session/handler_book_edit.go index 99e35679b..6d1577623 100644 --- a/server/session/handler_book_edit.go +++ b/server/session/handler_book_edit.go @@ -11,7 +11,7 @@ import ( type BookEditHandler struct{} // Handle ... -func (b BookEditHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (b BookEditHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, _ Controllable) error { pk := p.(*packet.BookEdit) it, err := s.inv.Item(int(pk.InventorySlot)) diff --git a/server/session/handler_client_cache_blob_status.go b/server/session/handler_client_cache_blob_status.go index e28f4e8a1..a8cabe5ea 100644 --- a/server/session/handler_client_cache_blob_status.go +++ b/server/session/handler_client_cache_blob_status.go @@ -11,7 +11,7 @@ type ClientCacheBlobStatusHandler struct { } // Handle ... -func (c *ClientCacheBlobStatusHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, co Controllable) error { +func (c *ClientCacheBlobStatusHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, _ Controllable) error { pk := p.(*packet.ClientCacheBlobStatus) resp := &packet.ClientCacheMissResponse{Blobs: make([]protocol.CacheBlob, 0, len(pk.MissHashes))} diff --git a/server/session/handler_command_request.go b/server/session/handler_command_request.go index 7d87b6f65..50112ae81 100644 --- a/server/session/handler_command_request.go +++ b/server/session/handler_command_request.go @@ -13,7 +13,7 @@ type CommandRequestHandler struct { } // Handle ... -func (h *CommandRequestHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (h *CommandRequestHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error { pk := p.(*packet.CommandRequest) if pk.Internal { return fmt.Errorf("command request packet must never have the internal field set to true") diff --git a/server/session/handler_emote.go b/server/session/handler_emote.go index 5f528fd12..8b2ec023d 100644 --- a/server/session/handler_emote.go +++ b/server/session/handler_emote.go @@ -13,7 +13,7 @@ type EmoteHandler struct { } // Handle ... -func (h *EmoteHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (h *EmoteHandler) Handle(p packet.Packet, _ *Session, tx *world.Tx, c Controllable) error { pk := p.(*packet.Emote) if pk.EntityRuntimeID != selfEntityRuntimeID { diff --git a/server/session/handler_interact.go b/server/session/handler_interact.go index 3b6660a3b..31ef655bb 100644 --- a/server/session/handler_interact.go +++ b/server/session/handler_interact.go @@ -11,7 +11,7 @@ import ( type InteractHandler struct{} // Handle ... -func (h *InteractHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (h *InteractHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, c Controllable) error { pk := p.(*packet.Interact) pos := c.Position() diff --git a/server/session/handler_inventory_transaction.go b/server/session/handler_inventory_transaction.go index 6189d9d4e..46144bd03 100644 --- a/server/session/handler_inventory_transaction.go +++ b/server/session/handler_inventory_transaction.go @@ -46,7 +46,7 @@ func (h *InventoryTransactionHandler) Handle(p packet.Packet, s *Session, tx *wo if err := s.UpdateHeldSlot(int(data.HotBarSlot), stackToItem(data.HeldItem.Stack), tx, c); err != nil { return err } - return h.handleReleaseItemTransaction(s, c) + return h.handleReleaseItemTransaction(c) } return fmt.Errorf("unhandled inventory transaction type %T", pk.TransactionData) } @@ -174,7 +174,7 @@ func (h *InventoryTransactionHandler) handleUseItemTransaction(data *protocol.Us } // handleReleaseItemTransaction ... -func (h *InventoryTransactionHandler) handleReleaseItemTransaction(s *Session, c Controllable) error { +func (h *InventoryTransactionHandler) handleReleaseItemTransaction(c Controllable) error { c.ReleaseItem() return nil } diff --git a/server/session/handler_item_stack_request.go b/server/session/handler_item_stack_request.go index f1c9b09de..b7d50b753 100644 --- a/server/session/handler_item_stack_request.go +++ b/server/session/handler_item_stack_request.go @@ -108,7 +108,7 @@ func (h *ItemStackRequestHandler) handleRequest(req protocol.ItemStackRequest, s case *protocol.CraftRecipeOptionalStackRequestAction: err = h.handleCraftRecipeOptional(a, s, req.FilterStrings, c, tx) case *protocol.CraftLoomRecipeStackRequestAction: - err = h.handleLoomCraft(a, s, tx, c) + err = h.handleLoomCraft(a, s, tx) case *protocol.CraftGrindstoneRecipeStackRequestAction: err = h.handleGrindstoneCraft(s, tx, c) case *protocol.CraftCreativeStackRequestAction: diff --git a/server/session/handler_lectern_update.go b/server/session/handler_lectern_update.go index fee56ce6f..8bd23eb17 100644 --- a/server/session/handler_lectern_update.go +++ b/server/session/handler_lectern_update.go @@ -11,7 +11,7 @@ import ( type LecternUpdateHandler struct{} // Handle ... -func (LecternUpdateHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (LecternUpdateHandler) Handle(p packet.Packet, _ *Session, tx *world.Tx, c Controllable) error { pk := p.(*packet.LecternUpdate) pos := blockPosFromProtocol(pk.Position) if !canReach(c, pos.Vec3Middle()) { diff --git a/server/session/handler_loom.go b/server/session/handler_loom.go index e3b7b11f0..179c3eb53 100644 --- a/server/session/handler_loom.go +++ b/server/session/handler_loom.go @@ -18,7 +18,7 @@ const ( ) // handleLoomCraft handles a CraftLoomRecipe stack request action made using a loom table. -func (h *ItemStackRequestHandler) handleLoomCraft(a *protocol.CraftLoomRecipeStackRequestAction, s *Session, tx *world.Tx, c Controllable) error { +func (h *ItemStackRequestHandler) handleLoomCraft(a *protocol.CraftLoomRecipeStackRequestAction, s *Session, tx *world.Tx) error { // First check if there actually is a loom opened. if _, ok := tx.Block(*s.openedPos.Load()).(block.Loom); !ok || !s.containerOpened.Load() { return fmt.Errorf("no loom container opened") diff --git a/server/session/handler_modal_form_response.go b/server/session/handler_modal_form_response.go index 95f76af34..9a384c98c 100644 --- a/server/session/handler_modal_form_response.go +++ b/server/session/handler_modal_form_response.go @@ -17,7 +17,7 @@ type ModalFormResponseHandler struct { } // Handle ... -func (h *ModalFormResponseHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (h *ModalFormResponseHandler) Handle(p packet.Packet, _ *Session, tx *world.Tx, c Controllable) error { pk := p.(*packet.ModalFormResponse) h.mu.Lock() diff --git a/server/session/handler_player_action.go b/server/session/handler_player_action.go index b2f4052fb..74048d338 100644 --- a/server/session/handler_player_action.go +++ b/server/session/handler_player_action.go @@ -12,7 +12,7 @@ import ( type PlayerActionHandler struct{} // Handle ... -func (*PlayerActionHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (*PlayerActionHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, c Controllable) error { pk := p.(*packet.PlayerAction) return handlePlayerAction(pk.ActionType, pk.BlockFace, pk.BlockPosition, pk.EntityRuntimeID, s, c) diff --git a/server/session/handler_player_skin.go b/server/session/handler_player_skin.go index c536308f0..0dad3712e 100644 --- a/server/session/handler_player_skin.go +++ b/server/session/handler_player_skin.go @@ -10,7 +10,7 @@ import ( type PlayerSkinHandler struct{} // Handle ... -func (PlayerSkinHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (PlayerSkinHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error { pk := p.(*packet.PlayerSkin) playerSkin, err := protocolToSkin(pk.Skin) diff --git a/server/session/handler_request_ability.go b/server/session/handler_request_ability.go index 38166adbc..32229198e 100644 --- a/server/session/handler_request_ability.go +++ b/server/session/handler_request_ability.go @@ -9,7 +9,7 @@ import ( type RequestAbilityHandler struct{} // Handle ... -func (a RequestAbilityHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (a RequestAbilityHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, c Controllable) error { pk := p.(*packet.RequestAbility) if pk.Ability == packet.AbilityFlying { if !c.GameMode().AllowsFlying() { diff --git a/server/session/handler_request_chunk_radius.go b/server/session/handler_request_chunk_radius.go index 68b46132a..355bfbf05 100644 --- a/server/session/handler_request_chunk_radius.go +++ b/server/session/handler_request_chunk_radius.go @@ -9,7 +9,7 @@ import ( type RequestChunkRadiusHandler struct{} // Handle ... -func (*RequestChunkRadiusHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (*RequestChunkRadiusHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, _ Controllable) error { pk := p.(*packet.RequestChunkRadius) if pk.ChunkRadius > s.maxChunkRadius { diff --git a/server/session/handler_server_bound_diagnostics.go b/server/session/handler_server_bound_diagnostics.go index 8caf66249..757a15486 100644 --- a/server/session/handler_server_bound_diagnostics.go +++ b/server/session/handler_server_bound_diagnostics.go @@ -10,7 +10,7 @@ import ( type ServerBoundDiagnosticsHandler struct{} // Handle ... -func (h *ServerBoundDiagnosticsHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (h *ServerBoundDiagnosticsHandler) Handle(p packet.Packet, _ *Session, _ *world.Tx, c Controllable) error { pk := p.(*packet.ServerBoundDiagnostics) c.UpdateDiagnostics(diagnostics.Diagnostics{ AverageFramesPerSecond: float64(pk.AverageFramesPerSecond), diff --git a/server/session/handler_server_bound_loading_screen.go b/server/session/handler_server_bound_loading_screen.go index abd18d9e4..4be87d6d6 100644 --- a/server/session/handler_server_bound_loading_screen.go +++ b/server/session/handler_server_bound_loading_screen.go @@ -15,7 +15,7 @@ type ServerBoundLoadingScreenHandler struct { } // Handle ... -func (h *ServerBoundLoadingScreenHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (h *ServerBoundLoadingScreenHandler) Handle(p packet.Packet, s *Session, _ *world.Tx, _ Controllable) error { pk := p.(*packet.ServerBoundLoadingScreen) v, ok := pk.LoadingScreenID.Value() if !ok || h.expectedID.Load() == 0 { diff --git a/server/session/handler_sub_chunk_request.go b/server/session/handler_sub_chunk_request.go index 8c23513ff..27e29d34c 100644 --- a/server/session/handler_sub_chunk_request.go +++ b/server/session/handler_sub_chunk_request.go @@ -10,7 +10,7 @@ import ( type SubChunkRequestHandler struct{} // Handle ... -func (*SubChunkRequestHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error { +func (*SubChunkRequestHandler) Handle(p packet.Packet, s *Session, tx *world.Tx, _ Controllable) error { pk := p.(*packet.SubChunkRequest) s.ViewSubChunks(world.SubChunkPos(pk.Position), pk.Offsets, tx) return nil