From 533238b87e81bb76f4e44444ab4bf50f0e775400 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Wed, 30 Jun 2021 23:22:37 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=E3=83=9E=E3=83=8A=E9=87=8F=E3=81=8C1?= =?UTF-8?q?=E6=9C=AA=E6=BA=80=E3=81=AE=E3=81=A8=E3=81=8D=E3=81=AB=E4=B8=80?= =?UTF-8?q?=E3=81=AE=E4=BD=8D=E3=81=AB=E3=82=BC=E3=83=AD=E3=81=8C=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E7=8F=BE=E8=B1=A1?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3=20(#1053)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [fix] マナ量が1未満のときに一の位にゼロが表示されない現象の修正 * Apply suggestion Co-authored-by: Kory | Ryosuke Kondo <6561358+kory33@users.noreply.github.com> Co-authored-by: Kory | Ryosuke Kondo <6561358+kory33@users.noreply.github.com> --- .../subsystems/manabar/application/ManaBarManipulation.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/manabar/application/ManaBarManipulation.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/manabar/application/ManaBarManipulation.scala index 8d462707ed..fafcae7d92 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/manabar/application/ManaBarManipulation.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/manabar/application/ManaBarManipulation.scala @@ -13,7 +13,7 @@ object ManaBarManipulation { // 3桁毎カンマ区切り、小数点以下一桁を表示 private def formatAmount(manaAmount: ManaAmount): String = { - val decimalFormat = new DecimalFormat("#,###.0") + val decimalFormat = new DecimalFormat("#,##0.0") decimalFormat.format(manaAmount.value) } From bc6c3946a89588b6238126ea9f91c15250b7afa9 Mon Sep 17 00:00:00 2001 From: Lucky Date: Sat, 3 Jul 2021 14:38:14 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[Fix]=20=E3=82=B2=E3=83=BC=E3=83=A0?= =?UTF-8?q?=E5=86=85=E3=81=AE=E4=BB=96=E3=83=97=E3=83=AC=E3=82=A4=E3=83=A4?= =?UTF-8?q?=E3=83=BC=E3=81=AB=E9=80=81=E3=82=89=E3=82=8C=E3=82=8B=E3=82=A2?= =?UTF-8?q?=E3=82=B5=E3=83=AB=E3=83=88=E3=83=BB=E3=82=A2=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=83=BC=E3=82=92=E8=A7=A3=E6=94=BE=E3=81=97=E3=81=9F=E4=BA=BA?= =?UTF-8?q?=E3=81=8C=E3=81=84=E3=82=8B=E6=97=A8=E3=81=AE=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E3=81=AE=E8=89=B2=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unchama/seichiassist/menus/skill/ActiveSkillMenu.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/skill/ActiveSkillMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/skill/ActiveSkillMenu.scala index e9a37d0c40..0de1867cee 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/skill/ActiveSkillMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/skill/ActiveSkillMenu.scala @@ -355,7 +355,7 @@ object ActiveSkillMenu extends Menu { MessageEffect(s"$YELLOW${BOLD}全てのスキルを習得し、アサルト・アーマーを解除しました"), Kleisli.liftF(DiscordNotificationAPI[F].send(notificationMessage).toIO), Kleisli.liftF(IO { - Util.sendMessageToEveryoneIgnoringPreference(notificationMessage) + Util.sendMessageToEveryoneIgnoringPreference(s"$GOLD$BOLD$notificationMessage") }), BroadcastSoundEffect(Sound.ENTITY_ENDERDRAGON_DEATH, 1.0f, 1.2f), ) From dff91c0aee42ff6c4e93987439595246e013e69d Mon Sep 17 00:00:00 2001 From: Lucky Date: Sat, 3 Jul 2021 15:07:09 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[Fix]=20/fly=20add=E3=81=A7=E5=BC=95?= =?UTF-8?q?=E6=95=B0=E3=82=92=E4=BD=95=E3=82=82=E6=8C=87=E5=AE=9A=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E5=A0=B4=E5=90=88=E3=81=AB?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E3=83=A1=E3=83=83?= =?UTF-8?q?=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E5=B0=91=E3=81=97=E3=82=8F?= =?UTF-8?q?=E3=81=8B=E3=82=8A=E3=82=84=E3=81=99=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/plugin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 4e6f3ef7e5..0585eb1ed9 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -95,7 +95,7 @@ commands: permission-message: *denied fly: description: This is a fly command. - usage: / + usage: / <操作> permission-message: *denied permission: seichiassist.fly stickmenu: @@ -162,4 +162,4 @@ permissions: - seichiassist.present.grant - seichiassist.present.revoke - seichiassist.present.define - - seichiassist.present.delete \ No newline at end of file + - seichiassist.present.delete From 9a1b8d5bb8b4e2c1777b17e94e6ab2778eefa4a0 Mon Sep 17 00:00:00 2001 From: Lucky Date: Sat, 3 Jul 2021 16:04:23 +0900 Subject: [PATCH 4/7] =?UTF-8?q?[Fix]=20/fly=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=81=A7=E5=BC=95=E6=95=B0=E4=B8=8D=E8=B6=B3=E3=81=AE?= =?UTF-8?q?=E9=9A=9B=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E5=B0=91?= =?UTF-8?q?=E3=81=97=E3=82=8F=E3=81=8B=E3=82=8A=E3=82=84=E3=81=99=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 0585eb1ed9..c3c1852bb2 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -95,7 +95,7 @@ commands: permission-message: *denied fly: description: This is a fly command. - usage: / <操作> + usage: / <操作> (詳細については/fly helpを参照してください) permission-message: *denied permission: seichiassist.fly stickmenu: From 2358eb91fed4f9628599e89a93cc18715e88bfca Mon Sep 17 00:00:00 2001 From: kory33 Date: Fri, 9 Jul 2021 14:38:54 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[clean]=20EffectEnvironment=E3=81=AE?= =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=81=ABunsafe=E6=8E=A5?= =?UTF-8?q?=E9=A0=AD=E8=BE=9E=E3=82=92=E3=81=A4=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unchama/buildassist/PlayerInventoryListener.scala | 2 +- .../unchama/generic/effect/unsafe/EffectEnvironment.scala | 8 +++----- .../com/github/unchama/menuinventory/MenuHandler.scala | 2 +- .../unchama/seichiassist/DefaultEffectEnvironment.scala | 2 +- .../seichiassist/listener/BuildMainMenuOpener.scala | 2 +- .../unchama/seichiassist/listener/EntityListener.scala | 4 ++-- .../seichiassist/listener/PlayerBlockBreakListener.scala | 6 +++--- .../seichiassist/listener/PlayerClickListener.scala | 6 +++--- .../seichiassist/listener/PlayerInventoryListener.scala | 7 +++---- .../listener/invlistener/OnClickTitleMenu.scala | 2 +- .../seichiassist/seichiskill/assault/AssaultRoutine.scala | 2 +- .../bukkit/listener/GrantBookedAchievementListener.scala | 2 +- .../bukkit/listeners/ExpBottleStackUsageController.scala | 2 +- .../OpenPocketInventoryOnPlacingEnderPortalFrame.scala | 2 +- .../mebius/bukkit/listeners/MebiusDropTrialListener.scala | 6 +++--- .../bukkit/listeners/MebiusInteractionResponder.scala | 2 +- .../bukkit/listeners/MebiusLevelUpTrialListener.scala | 2 +- .../mebius/bukkit/listeners/MebiusPlayerJoinGreeter.scala | 5 ++--- .../seasonalevents/anniversary/AnniversaryListener.scala | 3 +-- .../limitedlogin/LimitedLoginBonusGifter.scala | 2 +- .../seasonalevents/newyear/NewYearListener.scala | 2 +- .../seasonalevents/valentine/ValentineListener.scala | 2 +- .../com/github/unchama/seichiassist/util/BreakUtil.scala | 2 +- .../scala/com/github/unchama/seichiassist/util/Util.scala | 4 ++-- 24 files changed, 37 insertions(+), 42 deletions(-) diff --git a/src/main/scala/com/github/unchama/buildassist/PlayerInventoryListener.scala b/src/main/scala/com/github/unchama/buildassist/PlayerInventoryListener.scala index ab6c66e8b6..4df81f16a9 100644 --- a/src/main/scala/com/github/unchama/buildassist/PlayerInventoryListener.scala +++ b/src/main/scala/com/github/unchama/buildassist/PlayerInventoryListener.scala @@ -63,7 +63,7 @@ class PlayerInventoryListener(implicit effectEnvironment: EffectEnvironment, if (itemstackcurrent.getType == Material.SKULL_ITEM) { //ホームメニューへ帰還 - effectEnvironment.runAsyncTargetedEffect(player)( + effectEnvironment.unsafeRunAsyncTargetedEffect(player)( SequentialEffect( CommonSoundEffects.menuTransitionFenceSound, ioCanOpenBuildMainMenu.open(BuildMainMenu) diff --git a/src/main/scala/com/github/unchama/generic/effect/unsafe/EffectEnvironment.scala b/src/main/scala/com/github/unchama/generic/effect/unsafe/EffectEnvironment.scala index a520b48b82..962303a9fb 100644 --- a/src/main/scala/com/github/unchama/generic/effect/unsafe/EffectEnvironment.scala +++ b/src/main/scala/com/github/unchama/generic/effect/unsafe/EffectEnvironment.scala @@ -15,10 +15,8 @@ trait EffectEnvironment { * 理想的には、これはプログラムの最も外側にて「一度だけ」呼び出されるべきである。 * * このメソッドの実装は `context` を用いて実行に関するロギングを行ってよい。 - * - * TODO rename to unsafeRunEffectAsync */ - def runEffectAsync[U, F[_] : Effect](context: String, program: F[U]): Unit + def unsafeRunEffectAsync[U, F[_] : Effect](context: String, program: F[U]): Unit /** * `receiver`を`effect`に適用して得られる`IO`を例外を補足して実行する。 @@ -30,7 +28,7 @@ trait EffectEnvironment { * @tparam T レシーバの型 * @deprecated use [[EffectEnvironment]] */ - def runAsyncTargetedEffect[T](receiver: T)(effect: TargetedEffect[T], context: String): Unit = - runEffectAsync(context, effect(receiver)) + def unsafeRunAsyncTargetedEffect[T](receiver: T)(effect: TargetedEffect[T], context: String): Unit = + unsafeRunEffectAsync(context, effect(receiver)) } diff --git a/src/main/scala/com/github/unchama/menuinventory/MenuHandler.scala b/src/main/scala/com/github/unchama/menuinventory/MenuHandler.scala index c4d7308711..540a8746c3 100644 --- a/src/main/scala/com/github/unchama/menuinventory/MenuHandler.scala +++ b/src/main/scala/com/github/unchama/menuinventory/MenuHandler.scala @@ -37,7 +37,7 @@ class MenuHandler(implicit val cs: NonServerThreadContextShift[IO], env: EffectE return } - env.runEffectAsync( + env.unsafeRunEffectAsync( "メニューのクリックを非同期で処理する", for { currentLayout <- holder.currentLayout.get diff --git a/src/main/scala/com/github/unchama/seichiassist/DefaultEffectEnvironment.scala b/src/main/scala/com/github/unchama/seichiassist/DefaultEffectEnvironment.scala index bfaa4bbee7..93e8fa4dd7 100644 --- a/src/main/scala/com/github/unchama/seichiassist/DefaultEffectEnvironment.scala +++ b/src/main/scala/com/github/unchama/seichiassist/DefaultEffectEnvironment.scala @@ -7,7 +7,7 @@ import com.github.unchama.generic.effect.unsafe.EffectEnvironment // TODO prepare alternative environment that uses dedicated Logger for effect execution object DefaultEffectEnvironment extends EffectEnvironment { - override def runEffectAsync[U, F[_] : Effect](context: String, program: F[U]): Unit = { + override def unsafeRunEffectAsync[U, F[_] : Effect](context: String, program: F[U]): Unit = { import cats.effect.implicits._ program diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/BuildMainMenuOpener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/BuildMainMenuOpener.scala index 98cdc38539..8a992fc3e4 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/BuildMainMenuOpener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/BuildMainMenuOpener.scala @@ -32,7 +32,7 @@ class BuildMainMenuOpener(implicit effectEnvironment: EffectEnvironment, if (!hasStickOnMainHand || !actionWasOnMainHand) return } - effectEnvironment.runAsyncTargetedEffect(player)( + effectEnvironment.unsafeRunAsyncTargetedEffect(player)( SequentialEffect( CommonSoundEffects.menuTransitionFenceSound, ioCanOpenBuildMainMenu.open(BuildMainMenu) diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/EntityListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/EntityListener.scala index 21d9add46e..c54a52fcee 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/EntityListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/EntityListener.scala @@ -6,9 +6,9 @@ import com.github.unchama.minecraft.actions.OnMinecraftServerThread import com.github.unchama.seichiassist.MaterialSets.{BlockBreakableBySkill, BreakTool} import com.github.unchama.seichiassist._ import com.github.unchama.seichiassist.seichiskill.{BlockSearching, BreakArea} +import com.github.unchama.seichiassist.subsystems.discordnotification.DiscordNotificationAPI import com.github.unchama.seichiassist.subsystems.mana.ManaApi import com.github.unchama.seichiassist.subsystems.mana.domain.ManaAmount -import com.github.unchama.seichiassist.subsystems.discordnotification.DiscordNotificationAPI import com.github.unchama.seichiassist.task.GiganticBerserkTask import com.github.unchama.seichiassist.util.{BreakUtil, Util} import org.bukkit._ @@ -150,7 +150,7 @@ class EntityListener(implicit effectEnvironment: EffectEnvironment, //元ブロックの真ん中の位置 val centerOfBlock = hitBlock.getLocation.add(0.5, 0.5, 0.5) - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "破壊エフェクトを再生する", playerData.skillEffectState.selection .runBreakEffect(player, selectedSkill, tool, breakBlocks.toSet, breakArea, centerOfBlock) 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 805e2bb87b..bbd762268c 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala @@ -230,11 +230,11 @@ class PlayerBlockBreakListener(implicit effectEnvironment: EffectEnvironment, if (!tool.getItemMeta.isUnbreakable) tool.setDurability(toolDamageToSet.toShort) } - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "複数破壊エフェクトを実行する", effectPrograms.toList.sequence[IO, Fiber[IO, Unit]] ) - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "複数破壊エフェクトの後処理を実行する", adjustManaAndDurability >> availabilityFlagManipulation ) @@ -251,7 +251,7 @@ class PlayerBlockBreakListener(implicit effectEnvironment: EffectEnvironment, BreakUtil.blockCountWeight(event.getPlayer.getWorld) * BreakUtil.totalBreakCount(Seq(block.getType)) } - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "通常破壊されたブロックを整地量に計上する", SeichiAssist.instance .breakCountSystem.api diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerClickListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerClickListener.scala index b2d048cf8d..beed9d979e 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerClickListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerClickListener.scala @@ -106,8 +106,8 @@ class PlayerClickListener(implicit effectEnvironment: EffectEnvironment, val arrowEffect = playerData.skillEffectState.selection.arrowEffect(player) - effectEnvironment.runEffectAsync("スキルのクールダウンの状態を戻す", controlSkillAvailability) - effectEnvironment.runEffectAsync("ArrowEffectを非同期で実行する", arrowEffect) + effectEnvironment.unsafeRunEffectAsync("スキルのクールダウンの状態を戻す", controlSkillAvailability) + effectEnvironment.unsafeRunEffectAsync("ArrowEffectを非同期で実行する", arrowEffect) case _ => } } @@ -393,7 +393,7 @@ class PlayerClickListener(implicit effectEnvironment: EffectEnvironment, if (event.getHand == EquipmentSlot.OFF_HAND) return event.setCancelled(true) - effectEnvironment.runAsyncTargetedEffect(player)( + effectEnvironment.unsafeRunAsyncTargetedEffect(player)( SequentialEffect( CommonSoundEffects.menuTransitionFenceSound, ioCanOpenStickMenu.open(StickMenu.firstPage) diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala index fc3f4faa57..08f8f927f4 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala @@ -10,7 +10,6 @@ import com.github.unchama.seichiassist.data.{GachaSkullData, ItemData, MenuInven import com.github.unchama.seichiassist.effects.player.CommonSoundEffects import com.github.unchama.seichiassist.listener.invlistener.OnClickTitleMenu import com.github.unchama.seichiassist.menus.achievement.AchievementMenu -import com.github.unchama.seichiassist.menus.ranking.RankingRootMenu import com.github.unchama.seichiassist.menus.stickmenu.{FirstPage, StickMenu} import com.github.unchama.seichiassist.subsystems.mana.ManaApi import com.github.unchama.seichiassist.task.VotingFairyTask @@ -232,7 +231,7 @@ class PlayerInventoryListener(implicit effectEnvironment: EffectEnvironment, val ticketsToGive = Seq.fill(ticketAmount)(exchangeTicket) if (ticketsToGive.nonEmpty) { - effectEnvironment.runAsyncTargetedEffect(player)( + effectEnvironment.unsafeRunAsyncTargetedEffect(player)( SequentialEffect( Util.grantItemStacksEffect(ticketsToGive: _*), FocusedSoundEffect(Sound.BLOCK_ANVIL_PLACE, 1f, 1f), @@ -257,7 +256,7 @@ class PlayerInventoryListener(implicit effectEnvironment: EffectEnvironment, }.++(rejectedItems) //返却処理 - effectEnvironment.runAsyncTargetedEffect(player)( + effectEnvironment.unsafeRunAsyncTargetedEffect(player)( Util.grantItemStacksEffect(itemStacksToReturn: _*), "鉱石交換でのアイテム返却を行う" ) @@ -516,7 +515,7 @@ class PlayerInventoryListener(implicit effectEnvironment: EffectEnvironment, player.closeInventory() } else if (isSkull && itemstackcurrent.getItemMeta.asInstanceOf[SkullMeta].getOwner == "MHF_ArrowLeft") { - effectEnvironment.runAsyncTargetedEffect(player)( + effectEnvironment.unsafeRunAsyncTargetedEffect(player)( SequentialEffect( CommonSoundEffects.menuTransitionFenceSound, ioCanOpenFirstPage.open(StickMenu.firstPage) diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/invlistener/OnClickTitleMenu.scala b/src/main/scala/com/github/unchama/seichiassist/listener/invlistener/OnClickTitleMenu.scala index febadaa211..8734835786 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/invlistener/OnClickTitleMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/invlistener/OnClickTitleMenu.scala @@ -107,7 +107,7 @@ object OnClickTitleMenu { case _ if isSkull && isApplicableAsPrevPageButton(current) => - effectEnvironment.runAsyncTargetedEffect(player)( + effectEnvironment.unsafeRunAsyncTargetedEffect(player)( SequentialEffect( CommonSoundEffects.menuTransitionFenceSound, ioCanOpenAchievementMenu.open(AchievementMenu) diff --git a/src/main/scala/com/github/unchama/seichiassist/seichiskill/assault/AssaultRoutine.scala b/src/main/scala/com/github/unchama/seichiassist/seichiskill/assault/AssaultRoutine.scala index 100d2bcb30..328314a8fa 100644 --- a/src/main/scala/com/github/unchama/seichiassist/seichiskill/assault/AssaultRoutine.scala +++ b/src/main/scala/com/github/unchama/seichiassist/seichiskill/assault/AssaultRoutine.scala @@ -147,7 +147,7 @@ object AssaultRoutine { // ブロックを書き換える if (shouldBreakAllBlocks) { (foundWaters ++ foundLavas).foreach(_.setType(Material.AIR)) - DefaultEffectEnvironment.runEffectAsync( + DefaultEffectEnvironment.unsafeRunEffectAsync( "ブロックを大量破壊する", BreakUtil.massBreakBlock(player, foundBlocks, player.getLocation, toolToBeUsed, shouldPlayBreakSound = false) ) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/bookedachivement/bukkit/listener/GrantBookedAchievementListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/bookedachivement/bukkit/listener/GrantBookedAchievementListener.scala index dab97cf6ad..3681c0723e 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/bookedachivement/bukkit/listener/GrantBookedAchievementListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/bookedachivement/bukkit/listener/GrantBookedAchievementListener.scala @@ -39,6 +39,6 @@ class GrantBookedAchievementListener[F[_] : ConcurrentEffect : NonServerThreadCo }.sequence) } yield () - effectEnvironment.runEffectAsync("未受け取りの予約実績を読み込み、付与する", program) + effectEnvironment.unsafeRunEffectAsync("未受け取りの予約実績を読み込み、付与する", program) } } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/expbottlestack/bukkit/listeners/ExpBottleStackUsageController.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/expbottlestack/bukkit/listeners/ExpBottleStackUsageController.scala index 9d08c72a4f..5c59538916 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/expbottlestack/bukkit/listeners/ExpBottleStackUsageController.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/expbottlestack/bukkit/listeners/ExpBottleStackUsageController.scala @@ -49,7 +49,7 @@ class ExpBottleStackUsageController[ val bottleCount = BottleCount(playerInventory.getItemInMainHand.getAmount) val bottleResource = Resources.bottleResourceSpawningAt[F](player.getLocation, bottleCount) - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "経験値瓶の消費を待つ", managedBottleScope.useTracked[ThrownExpBottle, Nothing](bottleResource) { _ => Effect[F].never } ) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/listeners/OpenPocketInventoryOnPlacingEnderPortalFrame.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/listeners/OpenPocketInventoryOnPlacingEnderPortalFrame.scala index 2f1c2994a9..e2b52fea6f 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/listeners/OpenPocketInventoryOnPlacingEnderPortalFrame.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/listeners/OpenPocketInventoryOnPlacingEnderPortalFrame.scala @@ -32,7 +32,7 @@ class OpenPocketInventoryOnPlacingEnderPortalFrame[ //設置をキャンセル event.setCancelled(true) - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "ポケットインベントリを開く", api.openPocketInventory(player) ) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusDropTrialListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusDropTrialListener.scala index 6600f2b574..4a3ac7cc0b 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusDropTrialListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusDropTrialListener.scala @@ -3,8 +3,8 @@ package com.github.unchama.seichiassist.subsystems.mebius.bukkit.listeners import cats.effect.{IO, SyncEffect, SyncIO, Timer} import com.github.unchama.datarepository.bukkit.player.PlayerDataRepository import com.github.unchama.generic.effect.unsafe.EffectEnvironment -import com.github.unchama.seichiassist.MaterialSets import com.github.unchama.seichiassist.ManagedWorld._ +import com.github.unchama.seichiassist.MaterialSets import com.github.unchama.seichiassist.subsystems.mebius.bukkit.codec.BukkitMebiusItemStackCodec import com.github.unchama.seichiassist.subsystems.mebius.domain.MebiusDrop import com.github.unchama.seichiassist.subsystems.mebius.domain.speech.{MebiusSpeech, MebiusSpeechStrength} @@ -18,8 +18,8 @@ import org.bukkit.ChatColor._ import org.bukkit.Sound import org.bukkit.event.block.BlockBreakEvent import org.bukkit.event.{EventHandler, EventPriority, Listener} -import java.util.concurrent.TimeUnit +import java.util.concurrent.TimeUnit import scala.concurrent.duration.FiniteDuration class MebiusDropTrialListener[ @@ -49,7 +49,7 @@ class MebiusDropTrialListener[ player.sendMessage(s"$RESET$YELLOW${BOLD}MEBIUSはプレイヤーと共に成長するヘルメットです。") player.sendMessage(s"$RESET$YELLOW${BOLD}あなただけのMEBIUSを育てましょう!") - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "Mebiusのドロップ時メッセージを再生する", serviceRepository(player).makeSpeechIgnoringBlockage( droppedMebiusProperty, diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusInteractionResponder.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusInteractionResponder.scala index 133bedba02..13f22e1bd6 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusInteractionResponder.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusInteractionResponder.scala @@ -69,7 +69,7 @@ class MebiusInteractionResponder(implicit serviceRepository: PlayerDataRepositor import cats.implicits._ - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "Mebius破壊時のエフェクトを再生する", MebiusMessages.onMebiusBreak.pickOne[SyncIO].toIO.flatMap { message => speechService.makeSpeechIgnoringBlockage( diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusLevelUpTrialListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusLevelUpTrialListener.scala index 0cc8c07d6a..b539e747ed 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusLevelUpTrialListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusLevelUpTrialListener.scala @@ -36,7 +36,7 @@ class MebiusLevelUpTrialListener(implicit serviceRepository: PlayerDataRepositor } import cats.implicits._ - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "Mebiusのレベルアップ時の通知を行う", serviceRepository(player).makeSpeechIgnoringBlockage( newMebiusProperty, diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusPlayerJoinGreeter.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusPlayerJoinGreeter.scala index caea62c292..cc6bcd44dc 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusPlayerJoinGreeter.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusPlayerJoinGreeter.scala @@ -1,7 +1,5 @@ package com.github.unchama.seichiassist.subsystems.mebius.bukkit.listeners -import java.util.concurrent.TimeUnit - import cats.effect.{Effect, IO, SyncIO, Timer} import com.github.unchama.datarepository.bukkit.player.PlayerDataRepository import com.github.unchama.generic.effect.unsafe.EffectEnvironment @@ -12,6 +10,7 @@ import com.github.unchama.targetedeffect.DelayEffect import org.bukkit.event.player.PlayerJoinEvent import org.bukkit.event.{EventHandler, EventPriority, Listener} +import java.util.concurrent.TimeUnit import scala.concurrent.duration.FiniteDuration class MebiusPlayerJoinGreeter[F[_] : Effect](implicit effectEnvironment: EffectEnvironment, @@ -27,7 +26,7 @@ class MebiusPlayerJoinGreeter[F[_] : Effect](implicit effectEnvironment: EffectE BukkitMebiusItemStackCodec .decodePropertyOfOwnedMebius(player)(player.getInventory.getHelmet) .foreach { property => - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "参加時のMebiusのメッセージを送信する", DelayEffect(FiniteDuration(500, TimeUnit.MILLISECONDS)).run(player) >> speechServiceRepository(player) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryListener.scala index 97b64ad775..1291a65e06 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryListener.scala @@ -22,7 +22,6 @@ import org.bukkit.event.{EventHandler, Listener} import org.bukkit.inventory.EquipmentSlot import org.bukkit.{Material, Sound, TreeType} -import java.time.LocalDate import scala.jdk.CollectionConverters._ import scala.util.Random @@ -51,7 +50,7 @@ class AnniversaryListener(implicit effectEnvironment: EffectEnvironment, val playerData: PlayerData = SeichiAssist.playermap(player.getUniqueId) if (playerData.anniversary) return - effectEnvironment.runAsyncTargetedEffect(player)( + effectEnvironment.unsafeRunAsyncTargetedEffect(player)( SequentialEffect( grantItemStacksEffect(mineHead), MessageEffect(s"${BLUE}ギガンティック☆整地鯖${ANNIVERSARY_COUNT}周年の記念品を入手しました。"), diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/limitedlogin/LimitedLoginBonusGifter.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/limitedlogin/LimitedLoginBonusGifter.scala index fbd92acf6b..2e7ea10538 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/limitedlogin/LimitedLoginBonusGifter.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/limitedlogin/LimitedLoginBonusGifter.scala @@ -67,7 +67,7 @@ class LimitedLoginBonusGifter(implicit ioOnMainThread: OnMinecraftServerThread[I private def giveItem(itemName: String, amount: Int, item: ItemStack)(implicit player: Player): Unit = { import cats.implicits._ - DefaultEffectEnvironment.runEffectAsync( + DefaultEffectEnvironment.unsafeRunEffectAsync( s"${itemName}を付与する", List.fill(amount)( grantItemStacksEffect(item) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearListener.scala index 6a82d2c3f5..5686fad935 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearListener.scala @@ -76,7 +76,7 @@ class NewYearListener[ }) } yield () - effectEnvironment.runEffectAsync("大晦日ログインボーナスヘッドを付与するかどうかを判定する", program) + effectEnvironment.unsafeRunEffectAsync("大晦日ログインボーナスヘッドを付与するかどうかを判定する", program) } @EventHandler diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineListener.scala index 8c13146b3a..356d11e683 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineListener.scala @@ -105,7 +105,7 @@ class ValentineListener[ }) } yield () - effectEnvironment.runEffectAsync("チョコチップクッキーを付与するかどうかを判定する", program) + effectEnvironment.unsafeRunEffectAsync("チョコチップクッキーを付与するかどうかを判定する", program) } @EventHandler 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 e57f779159..d1decbd78a 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala +++ b/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala @@ -130,7 +130,7 @@ object BreakUtil { tool: BreakTool, shouldPlayBreakSound: Boolean) (implicit effectEnvironment: EffectEnvironment): Unit = - effectEnvironment.runEffectAsync( + effectEnvironment.unsafeRunEffectAsync( "単一ブロックを破壊する", massBreakBlock(player, Set(targetBlock), dropLocation, tool, shouldPlayBreakSound) ) diff --git a/src/main/scala/com/github/unchama/seichiassist/util/Util.scala b/src/main/scala/com/github/unchama/seichiassist/util/Util.scala index 2ca026ea3e..803ea24ff1 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/Util.scala +++ b/src/main/scala/com/github/unchama/seichiassist/util/Util.scala @@ -14,8 +14,8 @@ import enumeratum._ import org.bukkit.ChatColor._ import org.bukkit._ import org.bukkit.block.{Block, Skull} -import org.bukkit.entity.{EntityType, Firework, Player} import org.bukkit.entity.EntityType._ +import org.bukkit.entity.{EntityType, Firework, Player} import org.bukkit.inventory.meta.SkullMeta import org.bukkit.inventory.{ItemFlag, ItemStack, PlayerInventory} @@ -79,7 +79,7 @@ object Util { // Javaから呼ばれているのでimplicitが使いづらい grantItemStacksEffectに置き換えたい import PluginExecutionContexts.onMainThread - DefaultEffectEnvironment.runEffectAsync( + DefaultEffectEnvironment.unsafeRunEffectAsync( "アイテムスタックを付与する", grantItemStacksEffect(itemStack).run(player) ) From 6bcb823f79a8aef9a2a009ffdb07ee7435350ea0 Mon Sep 17 00:00:00 2001 From: Kory | Ryosuke Kondo <6561358+kory33@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:49:52 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[fix]=20=E3=82=B5=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E8=B2=A0=E8=8D=B7=E3=82=92=E6=94=B9=E5=96=84=E3=81=99?= =?UTF-8?q?=E3=82=8B=20(#1082)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/github/unchama/fs2/workaround/Topic.scala | 11 +++++++---- .../effect/concurrent/AsymmetricSignallingRef.scala | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/scala/com/github/unchama/fs2/workaround/Topic.scala b/src/main/scala/com/github/unchama/fs2/workaround/Topic.scala index a27d4494fc..6797528b7c 100644 --- a/src/main/scala/com/github/unchama/fs2/workaround/Topic.scala +++ b/src/main/scala/com/github/unchama/fs2/workaround/Topic.scala @@ -1,6 +1,6 @@ package com.github.unchama.fs2.workaround -import cats.effect.Concurrent +import cats.effect.{Concurrent, Sync} import cats.effect.concurrent.{Deferred, Ref} import cats.implicits._ import fs2.Stream._ @@ -9,6 +9,7 @@ import fs2.{Sink, Stream} /* Code directly copied from https://github.com/typelevel/fs2/blob/4ddd75a2dc032b7604dc1205c86d7d6adc993859/core/shared/src/main/scala/fs2/concurrent/Topic.scala. +and then generalized to a more generic version. This is due to https://github.com/typelevel/fs2/issues/1406, and the recommended workaround was to switch back to an old implementation of Topic which is better in terms of performance. @@ -116,7 +117,7 @@ abstract class Topic[F[_], A] { object Topic { - def apply[F[_], A](initial: A)(implicit F: Concurrent[F]): F[Topic[F, A]] = { + def in[G[_], F[_], A](initial: A)(implicit G: Sync[G], F: Concurrent[F]): G[Topic[F, A]] = { // Id identifying each subscriber uniquely class ID @@ -133,9 +134,9 @@ object Topic { } Ref - .of[F, (A, Vector[Subscriber])]((initial, Vector.empty[Subscriber])) + .in[G, F, (A, Vector[Subscriber])]((initial, Vector.empty[Subscriber])) .flatMap { state => - SignallingRef[F, Int](0).map { subSignal => + SignallingRef.in[G, F, Int](0).map { subSignal => def mkSubscriber(maxQueued: Int): F[Subscriber] = for { q <- InspectableQueue.bounded[F, A](maxQueued) @@ -200,4 +201,6 @@ object Topic { } } } + + def apply[F[_], A](initial: A)(implicit F: Concurrent[F]): F[Topic[F, A]] = in[F, F, A](initial) } diff --git a/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricSignallingRef.scala b/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricSignallingRef.scala index d8cdf8fde0..8d9e4babb1 100644 --- a/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricSignallingRef.scala +++ b/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricSignallingRef.scala @@ -8,8 +8,9 @@ import com.github.unchama.generic.effect.EffectExtra import com.github.unchama.generic.effect.stream.ReorderingPipe import com.github.unchama.generic.effect.stream.ReorderingPipe.TimeStamped import com.github.unchama.generic.{ContextCoercion, Token} +import com.github.unchama.fs2.workaround.Topic import fs2.Stream -import fs2.concurrent.{Signal, Topic} +import fs2.concurrent.Signal /** * 更新が [[Stream]] により読め出せるような可変参照セル。 From 1818db53eec70958595f004e8b59ca8005efff2d Mon Sep 17 00:00:00 2001 From: Kory <6561358+kory33@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:54:43 +0900 Subject: [PATCH 7/7] [bump] 1.8.3 -> 1.8.4 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index ccbe6cfc4c..cab4dad518 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ import sbt.Keys.baseDirectory import java.io._ ThisBuild / scalaVersion := "2.13.1" -ThisBuild / version := "1.8.3" +ThisBuild / version := "1.8.4" ThisBuild / organization := "click.seichi" ThisBuild / description := "ギガンティック☆整地鯖の独自要素を司るプラグイン"