From f071061c9f307e316be5621c9f4b81e1be11f5a3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:40:45 +0000 Subject: [PATCH 1/2] chore(deps): update dependency scalafmt to v3.11.4 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 0d638783eb..4c37fe1c80 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.11.2 +version = 3.11.4 preset=IntelliJ runner.dialect = scala3 From b928f5861077371a8b1eb308b32e3618e2394647 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:21:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?style:=20scalafmt=203.11.4=E3=81=AE?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88=E3=83=AB?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A6?= =?UTF-8?q?=E6=95=B4=E5=BD=A2=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scalafmtのバージョン更新に伴い、フォーマットルールが変わったファイルをscalafmtAllで再整形した。 Co-authored-by: Claude --- .../slot/button/ReloadingButton.scala | 16 +++--- .../commands/SeichiAssistCommand.scala | 26 ++++------ .../data/player/settings/PlayerSettings.scala | 14 +++-- .../listener/PlayerBlockBreakListener.scala | 16 +++--- .../nicknames/NicknameCombinationMenu.scala | 16 +++--- .../menus/nicknames/NicknameShopMenu.scala | 10 ++-- .../menus/stickmenu/SecondPage.scala | 52 +++++++++---------- .../GrantBukkitFastDiggingEffect.scala | 10 ++-- .../unchama/seichiassist/util/BreakUtil.scala | 18 +++---- .../util/LaunchFireWorksEffect.scala | 24 ++++----- .../targetedeffect/player/PlayerEffects.scala | 30 +++++------ 11 files changed, 103 insertions(+), 129 deletions(-) diff --git a/src/main/scala/com/github/unchama/menuinventory/slot/button/ReloadingButton.scala b/src/main/scala/com/github/unchama/menuinventory/slot/button/ReloadingButton.scala index b2c97fbd3a..523b3ea8e1 100644 --- a/src/main/scala/com/github/unchama/menuinventory/slot/button/ReloadingButton.scala +++ b/src/main/scala/com/github/unchama/menuinventory/slot/button/ReloadingButton.scala @@ -17,14 +17,12 @@ object ReloadingButton { ctx: LayoutPreparationContext, onMainThread: OnMinecraftServerThread[IO] ): Button = { - button.withAnotherEffect( - ButtonEffect(scope => { - val clicker = scope.event.getWhoClicked.asInstanceOf[Player] - Kleisli.liftF(for { - newLayout <- menu.computeMenuLayout(clicker) - _ <- scope.overwriteCurrentViewBy(newLayout) - } yield ()) - }) - ) + button.withAnotherEffect(ButtonEffect(scope => { + val clicker = scope.event.getWhoClicked.asInstanceOf[Player] + Kleisli.liftF(for { + newLayout <- menu.computeMenuLayout(clicker) + _ <- scope.overwriteCurrentViewBy(newLayout) + } yield ()) + })) } } diff --git a/src/main/scala/com/github/unchama/seichiassist/commands/SeichiAssistCommand.scala b/src/main/scala/com/github/unchama/seichiassist/commands/SeichiAssistCommand.scala index 3e733edc61..4fd2879d21 100644 --- a/src/main/scala/com/github/unchama/seichiassist/commands/SeichiAssistCommand.scala +++ b/src/main/scala/com/github/unchama/seichiassist/commands/SeichiAssistCommand.scala @@ -26,12 +26,10 @@ object SeichiAssistCommand { private val reloadConfigExecutor = ContextualExecutorBuilder .beginConfiguration - .buildWithEffectAsExecution( - UnfocusedEffect { - SeichiAssist.seichiAssistConfig = Config.loadFrom(SeichiAssist.instance) - MessageEffect("config.ymlの設定値を再読み込みしました") - } - ) + .buildWithEffectAsExecution(UnfocusedEffect { + SeichiAssist.seichiAssistConfig = Config.loadFrom(SeichiAssist.instance) + MessageEffect("config.ymlの設定値を再読み込みしました") + }) private val toggleDebugExecutor = ContextualExecutorBuilder .beginConfiguration @@ -62,16 +60,14 @@ object SeichiAssistCommand { private val setAnniversaryFlagExecutor = ContextualExecutorBuilder .beginConfiguration .refineSenderWithError[ConsoleCommandSender]("コンソール専用コマンドです") - .buildWithEffectAsExecution( - UnfocusedEffect { - SeichiAssist - .databaseGateway - .playerDataManipulator - .setAnniversary(anniversary = true, null) + .buildWithEffectAsExecution(UnfocusedEffect { + SeichiAssist + .databaseGateway + .playerDataManipulator + .setAnniversary(anniversary = true, null) - MessageEffect("Anniversaryアイテムの配布を開始しました。") - } - ) + MessageEffect("Anniversaryアイテムの配布を開始しました。") + }) val executor: TabExecutor = BranchedExecutor( Map( diff --git a/src/main/scala/com/github/unchama/seichiassist/data/player/settings/PlayerSettings.scala b/src/main/scala/com/github/unchama/seichiassist/data/player/settings/PlayerSettings.scala index 3ee148a99a..a0be8a7f60 100644 --- a/src/main/scala/com/github/unchama/seichiassist/data/player/settings/PlayerSettings.scala +++ b/src/main/scala/com/github/unchama/seichiassist/data/player/settings/PlayerSettings.scala @@ -44,16 +44,14 @@ class PlayerSettings { } yield { broadcastMutingSettings = nextSettings }) - val toggleHalfBreakFlag: TargetedEffect[Player] = DeferredEffect( - IO { - allowBreakingHalfBlocks = !allowBreakingHalfBlocks + val toggleHalfBreakFlag: TargetedEffect[Player] = DeferredEffect(IO { + allowBreakingHalfBlocks = !allowBreakingHalfBlocks - val newStatus = if (allowBreakingHalfBlocks) s"${GREEN}破壊可能" else s"${RED}破壊不可能" - val responseMessage = s"現在ハーフブロックは$newStatus${RESET}です." + val newStatus = if (allowBreakingHalfBlocks) s"${GREEN}破壊可能" else s"${RED}破壊不可能" + val responseMessage = s"現在ハーフブロックは$newStatus${RESET}です." - MessageEffect(responseMessage) - } - ) + MessageEffect(responseMessage) + }) /** * 複数ブロック同時破壊のON/OFFを切り替える[UnforcedEffect] diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala index 33625a5061..df726ca923 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala @@ -356,15 +356,13 @@ class PlayerBlockBreakListener( .tryIntoMineStack(player, amalgamatedDrops) _ <- PluginExecutionContexts .onMainThread - .runAction( - SyncIO { - event.setDropItems(false) - intoMineStackResult - ._1 - .filterNot(_.getType == Material.AIR) - .foreach(player.getWorld.dropItemNaturally(player.getLocation, _)) - } - ) + .runAction(SyncIO { + event.setDropItems(false) + intoMineStackResult + ._1 + .filterNot(_.getType == Material.AIR) + .foreach(player.getWorld.dropItemNaturally(player.getLocation, _)) + }) } yield () // NOTE: Spigot 1.18.2のAPIではチェストの中身のドロップを計算することは不可能である。 diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/nicknames/NicknameCombinationMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/nicknames/NicknameCombinationMenu.scala index 762cf19348..90af89d93e 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/nicknames/NicknameCombinationMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/nicknames/NicknameCombinationMenu.scala @@ -178,16 +178,14 @@ case class NicknameCombinationMenu(pageIndex: Int = 0, nicknamePart: NicknamePar LeftClickButtonEffect( SequentialEffect( FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1.0f, 1.0f), - DeferredEffect( - IO { - nicknamePart match { - case Head => playerdata.updateNickname(id1 = archivementId) - case Middle => playerdata.updateNickname(id2 = archivementId) - case Tail => playerdata.updateNickname(id3 = archivementId) - } - MessageEffect(s"${nicknamePart.displayName}パーツ「${nickname}」をセットしました。") + DeferredEffect(IO { + nicknamePart match { + case Head => playerdata.updateNickname(id1 = archivementId) + case Middle => playerdata.updateNickname(id2 = archivementId) + case Tail => playerdata.updateNickname(id3 = archivementId) } - ) + MessageEffect(s"${nicknamePart.displayName}パーツ「${nickname}」をセットしました。") + }) ) ) ) diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/nicknames/NicknameShopMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/nicknames/NicknameShopMenu.scala index f0498cc092..2f34e35937 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/nicknames/NicknameShopMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/nicknames/NicknameShopMenu.scala @@ -131,12 +131,10 @@ case class NicknameShopMenu(val pageIndex: Int = 0) extends Menu { LeftClickButtonEffect( SequentialEffect( FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1.0f, 1.0f), - DeferredEffect( - IO { - playerdata.recalculateAchievePoint() - ioCanOpenNicknameShopMenu.open(NicknameShopMenu(pageIndex)) - } - ) + DeferredEffect(IO { + playerdata.recalculateAchievePoint() + ioCanOpenNicknameShopMenu.open(NicknameShopMenu(pageIndex)) + }) ) ) ) diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala b/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala index f9efe5eedf..78f3dc6927 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala @@ -257,20 +257,18 @@ object SecondPage extends Menu { FilteredButtonEffect(ClickEventFilter.LEFT_CLICK) { _ => SequentialEffect( playerData.settings.toggleDeathMessageMutingSettings, - DeferredEffect( - IO { - val (soundPitch, message) = - if (playerData.settings.shouldDisplayDeathMessages) - (1.0f, s"${GREEN}死亡メッセージ:表示") - else - (0.5f, s"${RED}死亡メッセージ:隠す") - - SequentialEffect( - MessageEffect(message), - FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1.0f, soundPitch) - ) - } - ) + DeferredEffect(IO { + val (soundPitch, message) = + if (playerData.settings.shouldDisplayDeathMessages) + (1.0f, s"${GREEN}死亡メッセージ:表示") + else + (0.5f, s"${RED}死亡メッセージ:隠す") + + SequentialEffect( + MessageEffect(message), + FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1.0f, soundPitch) + ) + }) ) } ) @@ -303,20 +301,18 @@ object SecondPage extends Menu { FilteredButtonEffect(ClickEventFilter.LEFT_CLICK) { _ => SequentialEffect( playerData.settings.toggleWorldGuardLogEffect, - DeferredEffect( - IO { - val (soundPitch, message) = - if (playerData.settings.shouldDisplayWorldGuardLogs) - (1.0f, s"${GREEN}ワールドガード保護メッセージ:表示") - else - (0.5f, s"${RED}ワールドガード保護メッセージ:隠す") - - SequentialEffect( - FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1.0f, soundPitch), - MessageEffect(message) - ) - } - ) + DeferredEffect(IO { + val (soundPitch, message) = + if (playerData.settings.shouldDisplayWorldGuardLogs) + (1.0f, s"${GREEN}ワールドガード保護メッセージ:表示") + else + (0.5f, s"${RED}ワールドガード保護メッセージ:隠す") + + SequentialEffect( + FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1.0f, soundPitch), + MessageEffect(message) + ) + }) ) } ) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/fastdiggingeffect/bukkit/actions/GrantBukkitFastDiggingEffect.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/fastdiggingeffect/bukkit/actions/GrantBukkitFastDiggingEffect.scala index 4a8bae60ad..6ce2baee5d 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/fastdiggingeffect/bukkit/actions/GrantBukkitFastDiggingEffect.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/fastdiggingeffect/bukkit/actions/GrantBukkitFastDiggingEffect.scala @@ -13,12 +13,10 @@ class GrantBukkitFastDiggingEffect[F[_]: OnMinecraftServerThread] val potionEffect = new PotionEffect(PotionEffectType.FAST_DIGGING, 40, amount, false, false) // ポーション効果の削除及び付与はメインスレッドでのみ許可される(Spigot 1.12) - OnMinecraftServerThread[F].runAction( - SyncIO[Unit] { - player.removePotionEffect(PotionEffectType.FAST_DIGGING) - player.addPotionEffect(potionEffect) - } - ) + OnMinecraftServerThread[F].runAction(SyncIO[Unit] { + player.removePotionEffect(PotionEffectType.FAST_DIGGING) + player.addPotionEffect(potionEffect) + }) } } diff --git a/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala b/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala index aea419bc47..966153da0f 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala +++ b/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala @@ -325,17 +325,15 @@ object BreakUtil { _ <- PluginExecutionContexts .onMainThread - .runAction( - SyncIO { - // アイテムドロップは非同期スレッドで行ってはならない - itemsToBeDropped - .filterNot(_.getType == Material.AIR) - .foreach(dropLocation.getWorld.dropItemNaturally(dropLocation, _)) - breakResults._2.foreach { location => - location.getWorld.spawnEntity(location, EntityType.SILVERFISH) - } + .runAction(SyncIO { + // アイテムドロップは非同期スレッドで行ってはならない + itemsToBeDropped + .filterNot(_.getType == Material.AIR) + .foreach(dropLocation.getWorld.dropItemNaturally(dropLocation, _)) + breakResults._2.foreach { location => + location.getWorld.spawnEntity(location, EntityType.SILVERFISH) } - ) + }) } yield () } diff --git a/src/main/scala/com/github/unchama/seichiassist/util/LaunchFireWorksEffect.scala b/src/main/scala/com/github/unchama/seichiassist/util/LaunchFireWorksEffect.scala index 21695438dd..b0f10da0e4 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/LaunchFireWorksEffect.scala +++ b/src/main/scala/com/github/unchama/seichiassist/util/LaunchFireWorksEffect.scala @@ -50,23 +50,21 @@ object LaunchFireWorksEffect { // 爆発後に尾を引くかをランダムに決める effect.trail(rand.nextBoolean()) - OnMinecraftServerThread[F].runAction( - SyncIO { - // 花火を作る - val firework = loc.getWorld.spawn(loc, classOf[Firework]) + OnMinecraftServerThread[F].runAction(SyncIO { + // 花火を作る + val firework = loc.getWorld.spawn(loc, classOf[Firework]) - // 花火の設定情報オブジェクトを取り出す - val meta = firework.getFireworkMeta + // 花火の設定情報オブジェクトを取り出す + val meta = firework.getFireworkMeta - // 打ち上げ高さを1以上4以内でランダムに決める - meta.setPower(1 + rand.nextInt(4)) + // 打ち上げ高さを1以上4以内でランダムに決める + meta.setPower(1 + rand.nextInt(4)) - // 花火の設定情報を花火に設定 - meta.addEffect(effect.build()) + // 花火の設定情報を花火に設定 + meta.addEffect(effect.build()) - firework.setFireworkMeta(meta) - } - ) + firework.setFireworkMeta(meta) + }) } } diff --git a/src/main/scala/com/github/unchama/targetedeffect/player/PlayerEffects.scala b/src/main/scala/com/github/unchama/targetedeffect/player/PlayerEffects.scala index 93da98d230..6709c76cdd 100644 --- a/src/main/scala/com/github/unchama/targetedeffect/player/PlayerEffects.scala +++ b/src/main/scala/com/github/unchama/targetedeffect/player/PlayerEffects.scala @@ -38,22 +38,20 @@ object PlayerEffects { )(implicit onMainThread: OnMinecraftServerThread[IO]): TargetedEffect[Player] = Kleisli { player => // BungeeCordのサーバ移動はサーバスレッドでなければならない(Spigot 1.12.2) - onMainThread.runAction( - SyncIO { - - import com.google.common.io.ByteStreams - - val byteArrayDataOutput = ByteStreams.newDataOutput() - import byteArrayDataOutput._ - writeUTF("Connect") - writeUTF(serverIdentifier) - player.sendPluginMessage( - SeichiAssist.instance, - "BungeeCord", - byteArrayDataOutput.toByteArray - ) - } - ) + onMainThread.runAction(SyncIO { + + import com.google.common.io.ByteStreams + + val byteArrayDataOutput = ByteStreams.newDataOutput() + import byteArrayDataOutput._ + writeUTF("Connect") + writeUTF(serverIdentifier) + player.sendPluginMessage( + SeichiAssist.instance, + "BungeeCord", + byteArrayDataOutput.toByteArray + ) + }) } }