Skip to content

Commit

Permalink
style: apply scalafix and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 authored and outductor committed Oct 5, 2023
1 parent 0037776 commit fff26d4
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ object RegionMenu extends Menu {
import player._
import environment._


val computeButtonToClaimRegion: IO[Button] = for {
regionCount <- gridRegionAPI.regionCount(player)
} yield {
val openerData = SeichiAssist.playermap(player.getUniqueId)
SeichiAssist.playermap(player.getUniqueId)
val selection = WorldEdit
.getInstance()
.getSessionManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ object GridRegionMenu extends Menu {
case HorizontalAxisAlignedSubjectiveDirection.Right => "右へ"
}

val stainedGlassPaneDurability = relativeDirection match {
relativeDirection match {
case HorizontalAxisAlignedSubjectiveDirection.Ahead => 14
case HorizontalAxisAlignedSubjectiveDirection.Left => 10
case HorizontalAxisAlignedSubjectiveDirection.Behind => 13
Expand All @@ -169,8 +169,10 @@ object GridRegionMenu extends Menu {
}

Button(
new IconItemStackBuilder(Material.GLASS_PANE
).title(s"$DARK_GREEN${relativeDirectionString}ユニット増やす/減らす").lore(lore).build(),
new IconItemStackBuilder(Material.GLASS_PANE)
.title(s"$DARK_GREEN${relativeDirectionString}ユニット増やす/減らす")
.lore(lore)
.build(),
LeftClickButtonEffect(updateCurrentRegionShapeTo(expandedShape)),
RightClickButtonEffect(updateCurrentRegionShapeTo(contractedShape))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,44 +47,44 @@ class BukkitDrawGacha[F[_]: Sync](
case GachaRarity.Gigantic =>
val prizeItem = gachaPrize.itemStack

val localizedEnchantmentList =
prizeItem.getItemMeta.getEnchants.asScala.toSeq.map {
case (enchantment, level) =>
s"$GRAY${EnchantNameToJapanese.getEnchantName(enchantment.getKey.toString, level)}"
}
val localizedEnchantmentList =
prizeItem.getItemMeta.getEnchants.asScala.toSeq.map {
case (enchantment, level) =>
s"$GRAY${EnchantNameToJapanese.getEnchantName(enchantment.getKey.toString, level)}"
}

import scala.util.chaining._
val message =
new TextComponent().tap { c =>
import c._
setText(
s"$AQUA${prizeItem.getItemMeta.getDisplayName}${GOLD}を引きました!おめでとうございます!"
)
setHoverEvent {
new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
new Text(
s" ${prizeItem.getItemMeta.getDisplayName}\n" +
ListFormatters.getDescFormat(localizedEnchantmentList.toList) +
ListFormatters
.getDescFormat(prizeItem.getItemMeta.getLore.asScala.toList)
)
import scala.util.chaining._
val message =
new TextComponent().tap { c =>
import c._
setText(
s"$AQUA${prizeItem.getItemMeta.getDisplayName}${GOLD}を引きました!おめでとうございます!"
)
setHoverEvent {
new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
new Text(
s" ${prizeItem.getItemMeta.getDisplayName}\n" +
ListFormatters.getDescFormat(localizedEnchantmentList.toList) +
ListFormatters
.getDescFormat(prizeItem.getItemMeta.getLore.asScala.toList)
)
}
)
}
Sync[F].delay {
player.sendMessage(s"${RED}おめでとう!!!!!Gigantic☆大当たり!$additionalMessage")
player.spigot().sendMessage(message)
sendMessageToEveryone(s"$GOLD${player.getName}がガチャでGigantic☆大当たり!")(
forString[IO]
)
sendMessageToEveryone(message)(forTextComponent[IO])
SendSoundEffect.sendEverySoundWithoutIgnore(
Sound.ENTITY_ENDER_DRAGON_DEATH,
0.5f,
2f
)
}
Sync[F].delay {
player.sendMessage(s"${RED}おめでとう!!!!!Gigantic☆大当たり!$additionalMessage")
player.spigot().sendMessage(message)
sendMessageToEveryone(s"$GOLD${player.getName}がガチャでGigantic☆大当たり!")(
forString[IO]
)
sendMessageToEveryone(message)(forTextComponent[IO])
SendSoundEffect.sendEverySoundWithoutIgnore(
Sound.ENTITY_ENDER_DRAGON_DEATH,
0.5f,
2f
)
}
case GachaRarity.Big =>
Sync[F].delay {
player.playSound(player.getLocation, Sound.ENTITY_WITHER_SPAWN, 0.8f, 1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.github.unchama.seichiassist.subsystems.gridregion.domain.HorizontalAx
import com.github.unchama.seichiassist.subsystems.gridregion.domain._
import com.github.unchama.util.external.{WorldEditWrapper, WorldGuardWrapper}
import com.sk89q.worldedit.math.BlockVector3
import com.sk89q.worldguard.protection.regions.{ProtectedCuboidRegion, ProtectedRegion}
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion
import org.bukkit.Location
import org.bukkit.entity.Player

Expand Down Expand Up @@ -77,7 +77,11 @@ class BukkitRegionOperations[F[_]: Sync](
wgManager = WorldGuardWrapper.getRegionManager(player.getWorld)
selection = WorldEditWrapper.getSelection(player)
regionName = s"${player.getName}_${regionCount.value}"
region = new ProtectedCuboidRegion(regionName, BlockVector3.at(selection.getBlockX, 0, selection.getBlockZ), BlockVector3.at(selection.getBlockX, 255, selection.getBlockZ))
region = new ProtectedCuboidRegion(
regionName,
BlockVector3.at(selection.getBlockX, 0, selection.getBlockZ),
BlockVector3.at(selection.getBlockX, 255, selection.getBlockZ)
)
regionCreateResult <- Sync[F].delay {
wgManager.addRegion(region)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ class MebiusCommandExecutorProvider(
val convertExecutor: ContextualExecutor = playerCommandBuilder.buildWith { context =>
val mainHand = context.sender.getInventory.getItemInMainHand

BukkitMebiusItemStackCodec.decodeMebiusProperty(mainHand) match {
case Some(property) =>
if (property.level.isMaximum) {
val newProperty = property.toggleForcedMaterial
val newItem =
BukkitMebiusItemStackCodec.materialize(newProperty)
BukkitMebiusItemStackCodec.decodeMebiusProperty(mainHand) match {
case Some(property) =>
if (property.level.isMaximum) {
val newProperty = property.toggleForcedMaterial
val newItem =
BukkitMebiusItemStackCodec.materialize(newProperty)

val newMaterialName = newProperty.forcedMaterial match {
case MebiusForcedMaterial.None => "ダイヤモンド"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.github.unchama.seichiassist.util
import cats.Monad
import cats.effect.{IO, SyncIO}
import com.github.unchama.generic.ApplicativeExtra.whenAOrElse
import com.github.unchama.generic.effect.unsafe.EffectEnvironment
import com.github.unchama.seichiassist.MaterialSets.{BlockBreakableBySkill, BreakTool}
import com.github.unchama.seichiassist._
import com.github.unchama.seichiassist.concurrent.PluginExecutionContexts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ object WorldEditWrapper {
/**
* @return `player`が選択している範囲
*/
def getSelection(player: Player): BlockVector3 = plugin.getSession(player).getPlacementPosition(plugin.wrapPlayer(player))
def getSelection(player: Player): BlockVector3 =
plugin.getSession(player).getPlacementPosition(plugin.wrapPlayer(player))

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ object WorldGuardWrapper {
.toList
}


def getRegions(world: World): List[ProtectedRegion] = {
worldGuard
.getPlatform
Expand Down

0 comments on commit fff26d4

Please sign in to comment.