Skip to content

Commit

Permalink
fix: warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zly2006 committed Jun 2, 2024
1 parent 3de15ab commit 1417f8b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ object ExtensionManager {
}
}

@Suppress("UNUSED_PARAMETER")
internal fun serverStarting(server: MinecraftServer) {
extensions.forEach {
if (it is DatabaseExtension) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,12 @@ object SearchParamArgument {
context: CommandContext<ServerCommandSource>,
builder: SuggestionsBuilder
): CompletableFuture<Suggestions> {
val builder = if (builder.remaining.startsWith("!")) builder.createOffset(builder.start + 1) else builder
@Suppress("NAME_SHADOWING")
val builder = if (builder.remaining.startsWith("!")) {
builder.createOffset(builder.start + 1)
} else {
builder
}
return super.listSuggestions(context, builder)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fun onBlockBreak(
ActionQueueService.addToQueue(action)
}

@Suppress("UNUSED_PARAMETER")
fun onBlockChange(
world: World,
pos: BlockPos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import net.minecraft.block.BlockState
import net.minecraft.block.entity.BlockEntity
import net.minecraft.entity.ItemEntity
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.item.ItemPlacementContext
import net.minecraft.server.MinecraftServer
import net.minecraft.server.network.ServerPlayNetworkHandler
import net.minecraft.util.ActionResult
Expand All @@ -39,10 +38,12 @@ fun registerPlayerListeners() {
ItemDropCallback.EVENT.register(::onItemDrop)
}

@Suppress("UNUSED_PARAMETER")
fun onLeave(handler: ServerPlayNetworkHandler, server: MinecraftServer) {
handler.player.disableNetworking()
}

@Suppress("UNUSED_PARAMETER")
private fun onUseBlock(
player: PlayerEntity,
world: World,
Expand All @@ -57,6 +58,7 @@ private fun onUseBlock(
return ActionResult.PASS
}

@Suppress("UNUSED_PARAMETER")
private fun onBlockAttack(
player: PlayerEntity,
world: World,
Expand All @@ -74,31 +76,13 @@ private fun onBlockAttack(
return ActionResult.PASS
}

@Suppress("UNUSED_PARAMETER")
private fun onJoin(networkHandler: ServerPlayNetworkHandler, packetSender: PacketSender, server: MinecraftServer) {
Ledger.launch {
DatabaseManager.logPlayer(networkHandler.player.uuid, networkHandler.player.nameForScoreboard)
}
}

private fun onBlockPlace(
world: World,
player: PlayerEntity,
pos: BlockPos,
state: BlockState,
context: ItemPlacementContext?,
blockEntity: BlockEntity?
) {
ActionQueueService.addToQueue(
ActionFactory.blockPlaceAction(
world,
pos,
state,
player,
blockEntity
)
)
}

private fun onBlockBreak(
world: World,
player: PlayerEntity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fun registerWorldEventListeners() {
ServerWorldEvents.LOAD.register(::onWorldLoad)
}

@Suppress("UNUSED_PARAMETER")
fun onWorldLoad(server: MinecraftServer, world: ServerWorld) {
Ledger.launch {
DatabaseManager.registerWorld(world.registryKey.value)
Expand Down

0 comments on commit 1417f8b

Please sign in to comment.