Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GiganticMinecraft/SeichiAssist
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: sha-cc23022
Choose a base ref
...
head repository: GiganticMinecraft/SeichiAssist
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref
Loading
Showing with 4,377 additions and 3,357 deletions.
  1. +24 −0 .github/pull_request_template.md
  2. +17 −40 .github/workflows/build_and_deploy.yml
  3. +2 −2 .github/workflows/check-sql-version-duplicated-files.yml
  4. +8 −8 .github/workflows/create_new_release.yml
  5. +1 −0 .sbtopts
  6. +56 −0 CODING_GUIDELINE.md
  7. +80 −44 CONTRIBUTING.md
  8. +4 −9 README.md
  9. +38 −27 build.sbt
  10. +7 −6 docker-compose.yml → compose.yml
  11. +11 −0 docker/mariadb/Dockerfile
  12. +11 −0 docker/mariadb/update-gachadata.sh
  13. +1 −1 docker/spigot/Dockerfile
  14. +13 −0 prepare-docker.bat
  15. +12 −1 prepare-docker.sh
  16. +1 −1 project/build.properties
  17. +3 −3 project/plugins.sbt
  18. +1 −1 project/scalapb.sbt
  19. +9 −0 renovate.json
  20. +68 −18 sbt
  21. +13 −0 src/main/resources/db/migration/README.md
  22. +9 −0 src/main/resources/db/migration/V1.17.0__Create_break_preference_table.sql
  23. +8 −0 src/main/resources/db/migration/V1.18.0__Align_minestack_object_name.sql
  24. +3 −0 src/main/resources/db/migration/V1.18.1__Add_gachaevent_foreign_key.sql
  25. +2 −0 src/main/resources/plugin.yml
  26. +1 −1 src/main/scala/com/github/unchama/buildassist/listener/BlockLineUpTriggerListener.scala
  27. +87 −0 src/main/scala/com/github/unchama/buildassist/menu/MineStackMassCraftMenu.scala
  28. +11 −23 src/main/scala/com/github/unchama/concurrent/RepeatingRoutine.scala
  29. +8 −5 src/main/scala/com/github/unchama/contextualexecutor/Contexts.scala
  30. +106 −114 src/main/scala/com/github/unchama/contextualexecutor/builder/ContextualExecutorBuilder.scala
  31. +1 −1 src/main/scala/com/github/unchama/contextualexecutor/builder/ParserResponse.scala
  32. +52 −14 src/main/scala/com/github/unchama/contextualexecutor/builder/Parsers.scala
  33. +15 −7 src/main/scala/com/github/unchama/contextualexecutor/builder/package.scala
  34. +10 −9 src/main/scala/com/github/unchama/datarepository/bukkit/player/BukkitRepositoryControls.scala
  35. +39 −0 src/main/scala/com/github/unchama/generic/CoerceTo.scala
  36. +17 −0 src/main/scala/com/github/unchama/generic/ListExtra.scala
  37. +20 −0 src/main/scala/com/github/unchama/generic/TryInto.scala
  38. +0 −1 src/main/scala/com/github/unchama/generic/algebra/typeclasses/HasSuccessor.scala
  39. +0 −1 src/main/scala/com/github/unchama/generic/algebra/typeclasses/PositiveInt.scala
  40. +18 −0 src/main/scala/com/github/unchama/menuinventory/slot/button/action/FilteredButtonEffect.scala
  41. +3 −1 src/main/scala/com/github/unchama/seichiassist/MaterialSets.scala
  42. +43 −35 src/main/scala/com/github/unchama/seichiassist/SeichiAssist.scala
  43. +29 −23 src/main/scala/com/github/unchama/seichiassist/achievement/AchievementConditions.scala
  44. +29 −33 src/main/scala/com/github/unchama/seichiassist/commands/EffectCommand.scala
  45. +17 −23 src/main/scala/com/github/unchama/seichiassist/commands/GiganticFeverCommand.scala
  46. +2 −5 src/main/scala/com/github/unchama/seichiassist/commands/HalfBlockProtectCommand.scala
  47. +3 −4 src/main/scala/com/github/unchama/seichiassist/commands/HatCommand.scala
  48. +1 −2 src/main/scala/com/github/unchama/seichiassist/commands/MapCommand.scala
  49. +1 −1 src/main/scala/com/github/unchama/seichiassist/commands/MineHeadCommand.scala
  50. +17 −21 src/main/scala/com/github/unchama/seichiassist/commands/RegionOwnerTransferCommand.scala
  51. +57 −59 src/main/scala/com/github/unchama/seichiassist/commands/RmpCommand.scala
  52. +35 −44 src/main/scala/com/github/unchama/seichiassist/commands/SeichiAssistCommand.scala
  53. +19 −13 src/main/scala/com/github/unchama/seichiassist/commands/StickCommand.scala
  54. +4 −6 src/main/scala/com/github/unchama/seichiassist/commands/StickMenuCommand.scala
  55. +3 −2 src/main/scala/com/github/unchama/seichiassist/commands/contextual/builder/BuilderTemplates.scala
  56. +3 −1 src/main/scala/com/github/unchama/seichiassist/concurrent/PluginExecutionContexts.scala
  57. +0 −46 src/main/scala/com/github/unchama/seichiassist/data/GridTemplate.java
  58. +0 −276 src/main/scala/com/github/unchama/seichiassist/data/RegionMenuData.java
  59. +0 −3 src/main/scala/com/github/unchama/seichiassist/data/player/ClaimUnit.scala
  60. +0 −104 src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala
  61. +0 −1 src/main/scala/com/github/unchama/seichiassist/database/DatabaseConstants.java
  62. +7 −1 ...n/scala/com/github/unchama/seichiassist/infrastructure/scalikejdbc/ScalikeJDBCConfiguration.scala
  63. +1 −1 src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala
  64. +2 −2 src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala
  65. +12 −2 src/main/scala/com/github/unchama/seichiassist/listener/PlayerJoinListener.scala
  66. +0 −471 src/main/scala/com/github/unchama/seichiassist/listener/RegionInventoryListener.scala
  67. +21 −14 src/main/scala/com/github/unchama/seichiassist/menus/RegionMenu.scala
  68. +17 −2 src/main/scala/com/github/unchama/seichiassist/menus/TopLevelRouter.scala
  69. +3 −8 src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala
  70. +282 −0 src/main/scala/com/github/unchama/seichiassist/menus/gridregion/GridRegionMenu.scala
  71. +138 −0 src/main/scala/com/github/unchama/seichiassist/menus/gridregion/GridTemplateMenu.scala
  72. +59 −7 src/main/scala/com/github/unchama/seichiassist/menus/skill/PassiveSkillMenu.scala
  73. +1 −1 src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/FirstPage.scala
  74. +3 −3 src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala
  75. +1 −3 ...a/com/github/unchama/seichiassist/subsystems/anywhereender/bukkit/command/EnderChestCommand.scala
  76. +19 −11 ...m/github/unchama/seichiassist/subsystems/bookedachivement/bukkit/command/AchievementCommand.scala
  77. +28 −0 ...com/github/unchama/seichiassist/subsystems/breakskilltargetconfig/BreakSkillTargetConfigAPI.scala
  78. +66 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/breakskilltargetconfig/System.scala
  79. +23 −0 ...ms/breakskilltargetconfig/application/repository/BreakSkillTargetConfigRepositoryDefinition.scala
  80. +28 −0 ...github/unchama/seichiassist/subsystems/breakskilltargetconfig/domain/BreakSkillTargetConfig.scala
  81. +26 −0 ...hub/unchama/seichiassist/subsystems/breakskilltargetconfig/domain/BreakSkillTargetConfigKey.scala
  82. +7 −0 ...ama/seichiassist/subsystems/breakskilltargetconfig/domain/BreakSkillTargetConfigPersistence.scala
  83. +53 −0 ...iassist/subsystems/breakskilltargetconfig/persistence/JdbcBreakSkillTargetConfigPersistence.scala
  84. +22 −26 ...ain/scala/com/github/unchama/seichiassist/subsystems/donate/bukkit/commands/DonationCommand.scala
  85. +2 −5 src/main/scala/com/github/unchama/seichiassist/subsystems/dragonnighttime/System.scala
  86. +9 −0 ...n/scala/com/github/unchama/seichiassist/subsystems/dragonnighttime/application/CanBroadcast.scala
  87. +10 −17 ...m/github/unchama/seichiassist/subsystems/dragonnighttime/application/DragonNightTimeRoutine.scala
  88. +0 −9 ...ain/scala/com/github/unchama/seichiassist/subsystems/dragonnighttime/application/Notifiable.scala
  89. +3 −3 ...bsystems/dragonnighttime/bukkit/instances/{SyncNotifiable.scala → SyncCanBroadcastOnBukkit.scala}
  90. +1 −2 .../seichiassist/subsystems/fourdimensionalpocket/bukkit/commands/FourDimensionalPocketCommand.scala
  91. +4 −4 ...hub/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/commands/OpenPocketCommand.scala
  92. +11 −20 src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/System.scala
  93. +28 −17 .../scala/com/github/unchama/seichiassist/subsystems/gacha/application/actions/GrantGachaPrize.scala
  94. +235 −280 src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/GachaCommand.scala
  95. +11 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/GiveGachaSelector.scala
  96. +1 −2 src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/PlayerPullGachaListener.scala
  97. +70 −76 src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/actions/BukkitDrawGacha.scala
  98. +26 −23 ...scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/actions/BukkitGrantGachaPrize.scala
  99. +11 −3 src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/domain/GrantState.scala
  100. +8 −11 src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/domain/LotteryOfGachaItems.scala
  101. 0 ...subsystems/gacha/subsystems/{consumeGachaTicket → consumegachaticket}/ConsumeGachaTicketAPI.scala
  102. 0 ...a/seichiassist/subsystems/gacha/subsystems/{consumeGachaTicket → consumegachaticket}/System.scala
  103. 0 ... → consumegachaticket}/application/repository/ConsumeGachaTicketSettingRepositoryDefinition.scala
  104. 0 ...acha/subsystems/{consumeGachaTicket → consumegachaticket}/domain/ConsumeGachaTicketSettings.scala
  105. 0 .../gacha/subsystems/{consumeGachaTicket → consumegachaticket}/domain/GachaTicketConsumeAmount.scala
  106. +1 −1 ...hub/unchama/seichiassist/subsystems/gachapoint/application/process/AddSeichiExpAsGachaPoint.scala
  107. +27 −48 src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/GachaPrizeAPI.scala
  108. +46 −138 src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/System.scala
  109. +6 −4 ...ub/unchama/seichiassist/subsystems/gachaprize/bukkit/BukkitItemStackCanBeSignedAsGachaPrize.scala
  110. +2 −0 ...b/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitStaticGachaPrizeFactory.scala
  111. +1 −3 .../scala/com/github/unchama/seichiassist/subsystems/gachaprize/domain/CanBeSignedAsGachaPrize.scala
  112. +1 −1 ...a/com/github/unchama/seichiassist/subsystems/gachaprize/domain/{gachaprize → }/GachaPrizeId.scala
  113. +11 −11 ...cala/com/github/unchama/seichiassist/subsystems/gachaprize/domain/GachaPrizeListPersistence.scala
  114. +11 −12 ...chiassist/subsystems/gachaprize/domain/{gachaprize/GachaPrize.scala → GachaPrizeTableEntry.scala}
  115. +1 −3 src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/domain/GachaRarity.scala
  116. +5 −0 .../scala/com/github/unchama/seichiassist/subsystems/gachaprize/domain/StaticGachaPrizeFactory.scala
  117. +0 −27 ...in/scala/com/github/unchama/seichiassist/subsystems/gachaprize/domain/gachaevent/GachaEvent.scala
  118. +1 −2 src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/domain/package.scala
  119. +1 −1 .../github/unchama/seichiassist/subsystems/gachaprize/infrastructure/JdbcGachaEventPersistence.scala
  120. +52 −34 ...hub/unchama/seichiassist/subsystems/gachaprize/infrastructure/JdbcGachaPrizeListPersistence.scala
  121. +77 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/usecase/GachaPrizeUseCase.scala
  122. +81 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gridregion/GridRegionAPI.scala
  123. +143 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gridregion/System.scala
  124. +21 −0 ...t/subsystems/gridregion/application/repository/RULChangePerClickSettingRepositoryDefinition.scala
  125. +21 −0 ...a/seichiassist/subsystems/gridregion/application/repository/RegionCountRepositoryDefinition.scala
  126. +22 −0 ...a/seichiassist/subsystems/gridregion/application/repository/RegionUnitsRepositoryDefinition.scala
  127. +133 −0 ...n/scala/com/github/unchama/seichiassist/subsystems/gridregion/bukkit/BukkitRegionOperations.scala
  128. +104 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gridregion/domain/CardinalDirection.scala
  129. +39 −0 ...scala/com/github/unchama/seichiassist/subsystems/gridregion/domain/RULChangePerClickSetting.scala
  130. +8 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gridregion/domain/RegionCount.scala
  131. +27 −0 ...ain/scala/com/github/unchama/seichiassist/subsystems/gridregion/domain/RegionCreationResult.scala
  132. +146 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gridregion/domain/RegionGeometry.scala
  133. +25 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gridregion/domain/RegionOperations.scala
  134. +21 −0 ...cala/com/github/unchama/seichiassist/subsystems/gridregion/domain/RegionShapeSelectionState.scala
  135. +7 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/gridregion/domain/RegionTemplate.scala
  136. +8 −0 ...main/scala/com/github/unchama/seichiassist/subsystems/gridregion/domain/RegionUnitSizeLimit.scala
  137. +8 −0 ...github/unchama/seichiassist/subsystems/gridregion/domain/persistence/RegionCountPersistence.scala
  138. +12 −0 ...hub/unchama/seichiassist/subsystems/gridregion/domain/persistence/RegionTemplatePersistence.scala
  139. +30 −0 ...github/unchama/seichiassist/subsystems/gridregion/infrastructure/JdbcRegionCountPersistence.scala
  140. +63 −0 ...hub/unchama/seichiassist/subsystems/gridregion/infrastructure/JdbcRegionTemplatePersistence.scala
  141. +133 −146 src/main/scala/com/github/unchama/seichiassist/subsystems/home/bukkit/command/HomeCommand.scala
  142. +2 −2 src/main/scala/com/github/unchama/seichiassist/subsystems/home/domain/HomeId.scala
  143. +4 −5 ...n/scala/com/github/unchama/seichiassist/subsystems/lastquit/bukkit/commands/LastQuitCommand.scala
  144. +3 −3 src/main/scala/com/github/unchama/seichiassist/subsystems/mana/ManaApi.scala
  145. +6 −5 src/main/scala/com/github/unchama/seichiassist/subsystems/mana/System.scala
  146. +2 −2 src/main/scala/com/github/unchama/seichiassist/subsystems/mana/domain/ManaManipulation.scala
  147. +33 −39 ...a/com/github/unchama/seichiassist/subsystems/managedfly/bukkit/controllers/BukkitFlyCommand.scala
  148. +60 −69 .../github/unchama/seichiassist/subsystems/mebius/bukkit/command/MebiusCommandExecutorProvider.scala
  149. +4 −13 src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/System.scala
  150. +23 −18 ...scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/BukkitMineStackObjectList.scala
  151. +66 −56 src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/MineStackCommand.scala
  152. +2 −2 ...main/scala/com/github/unchama/seichiassist/subsystems/minestack/domain/MineStackGachaObject.scala
  153. +13 −3 ...com/github/unchama/seichiassist/subsystems/minestack/domain/minestackobject/MineStackObject.scala
  154. +0 −12 ...nchama/seichiassist/subsystems/minestack/domain/persistence/MineStackGachaObjectPersistence.scala
  155. +0 −33 ...nchama/seichiassist/subsystems/minestack/infrastructure/JdbcMineStackGachaObjectPersistence.scala
  156. +96 −108 ...main/scala/com/github/unchama/seichiassist/subsystems/present/bukkit/command/PresentCommand.scala
  157. +1 −1 ...ain/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/Anniversary.scala
  158. +10 −9 src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/commands/EventCommand.scala
  159. +4 −5 ...github/unchama/seichiassist/subsystems/sharedinventory/bukkit/command/ShareInventoryCommand.scala
  160. +8 −6 .../scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gachatrade/System.scala
  161. +1 −4 ...chiassist/subsystems/tradesystems/subsystems/gachatrade/bukkit/listeners/GachaTradeListener.scala
  162. +5 −3 ...ma/seichiassist/subsystems/tradesystems/subsystems/gachatrade/bukkit/traderules/BukkitTrade.scala
  163. +2 −2 ...unchama/seichiassist/subsystems/tradesystems/subsystems/gachatrade/domain/GachaListProvider.scala
  164. +2 −2 ...ub/unchama/seichiassist/subsystems/tradesystems/subsystems/gachatrade/domain/GachaTradeRule.scala
  165. +1 −1 ...a/seichiassist/subsystems/tradesystems/subsystems/gttosiina/bukkit/listeners/GtToSiinaringo.scala
  166. +5 −3 ...ama/seichiassist/subsystems/tradesystems/subsystems/gttosiina/bukkit/traderules/BukkitTrade.scala
  167. +2 −2 src/main/scala/com/github/unchama/seichiassist/subsystems/vote/System.scala
  168. +1 −1 src/main/scala/com/github/unchama/seichiassist/subsystems/vote/VoteAPI.scala
  169. +10 −9 ...la/com/github/unchama/seichiassist/subsystems/vote/bukkit/actions/BukkitReceiveVoteBenefits.scala
  170. +4 −4 src/main/scala/com/github/unchama/seichiassist/subsystems/vote/bukkit/command/VoteCommand.scala
  171. +10 −0 src/main/scala/com/github/unchama/seichiassist/subsystems/vote/domain/ReceivedVoteCount.scala
  172. +0 −5 src/main/scala/com/github/unchama/seichiassist/subsystems/vote/domain/VoteBenefit.scala
  173. +2 −2 src/main/scala/com/github/unchama/seichiassist/subsystems/vote/domain/VotePersistence.scala
  174. +4 −4 ...in/scala/com/github/unchama/seichiassist/subsystems/vote/infrastructure/JdbcVotePersistence.scala
  175. +1 −1 src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/FairyAPI.scala
  176. +1 −1 src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/System.scala
  177. +3 −1 ...thub/unchama/seichiassist/subsystems/vote/subsystems/fairy/application/actions/RecoveryMana.scala
  178. +2 −0 ...a/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/bukkit/BukkitFairySpeech.scala
  179. +75 −124 ...hub/unchama/seichiassist/subsystems/vote/subsystems/fairy/bukkit/actions/BukkitRecoveryMana.scala
  180. +13 −8 ...ub/unchama/seichiassist/subsystems/vote/subsystems/fairy/bukkit/routines/BukkitFairyRoutine.scala
  181. +1 −1 ...la/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/domain/FairyPersistence.scala
  182. +4 −0 ...ama/seichiassist/subsystems/vote/subsystems/fairy/domain/property/FairyAppleConsumeStrategy.scala
  183. +5 −0 ...nchama/seichiassist/subsystems/vote/subsystems/fairy/domain/property/FairyManaRecoveryState.scala
  184. +13 −11 ...b/unchama/seichiassist/subsystems/vote/subsystems/fairy/infrastructure/JdbcFairyPersistence.scala
  185. +1 −30 src/main/scala/com/github/unchama/seichiassist/task/PlayerDataLoading.scala
  186. +0 −25 src/main/scala/com/github/unchama/seichiassist/task/PlayerDataSaveTask.scala
  187. +0 −21 src/main/scala/com/github/unchama/seichiassist/util/AbsoluteDirection.scala
  188. +108 −28 src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala
  189. +0 −15 src/main/scala/com/github/unchama/seichiassist/util/ItemInformation.scala
  190. +0 −94 src/main/scala/com/github/unchama/seichiassist/util/MenuIcon.scala
  191. +0 −18 src/main/scala/com/github/unchama/seichiassist/util/PlayerInformation.scala
  192. +0 −32 src/main/scala/com/github/unchama/seichiassist/util/RelativeDirection.scala
  193. +9 −2 src/main/scala/com/github/unchama/seichiassist/util/SendMessageEffect.scala
  194. +13 −8 src/main/scala/com/github/unchama/seichiassist/util/WorldSettings.scala
  195. +19 −0 src/main/scala/com/github/unchama/util/external/WorldEditWrapper.scala
  196. +60 −3 src/main/scala/com/github/unchama/util/external/WorldGuardWrapper.scala
  197. +8 −6 src/main/scala/com/github/unchama/util/time/LunisolarDate.scala
  198. +58 −0 src/scalafix/scala/fix/WarnUnoverriddenImplicitToStringCallsOnCaseClass.scala
24 changes: 24 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
このPRに関連し、マージ時に自動的にクローズしたいIssueの番号を入力してください。
複数のIssueを紐付ける場合は、それに続いて "close #1, close #2 ..." と続けて記述してください。
(Issueに関連するPRではない場合は、このセクションを削除してください。)
参考: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

close #

----

### このPRの変更点と理由:

<!--
このPRであなたが行った変更、なぜそれを行ったのかを簡潔に記述してください。
自明な場合は省略しても良いですが、なるべく書くようにしてください。
-->

### 補足情報:

<!--
他にこのPRのことについてメンテナに伝えたいことがあれば記述してください。
(なければ、このセクションを削除してください。)
-->
57 changes: 17 additions & 40 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -5,44 +5,28 @@ on:
branches:
- develop
- master
paths:
- src/**
- build.sbt
- .scalafix.conf
- .scalafmt.conf
- project/*
- .github/workflows/**.yml
- .github/actions/**/**.yml

pull_request:
branches:
- develop
paths:
- src/**/
- build.sbt
- .scalafix.conf
- .scalafmt.conf
- project/*
- .github/workflows/**.yml
- .github/actions/**/**.yml

jobs:
build_test_and_upload:
env:
BUILD_ENVIRONMENT_IS_CI_OR_LOCAL: "CI"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container: ghcr.io/giganticminecraft/seichiassist-builder:1a64049
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Prepare build dependencies cache
uses: actions/cache@v3
env:
cache-name: cache-build-dependencies
cache-version: v-4
cache-version: v-5
with:
# sbt等は$HOMEではなくユーザーディレクトリを見ているようで、
# GH Actionsでの ~ は /github/home/ に展開されるにもかかわらず
@@ -66,7 +50,7 @@ jobs:
uses: actions/cache@v3
env:
cache-name: cache-build
cache-version: v-4
cache-version: v-5
with:
path: |
target
@@ -98,26 +82,19 @@ jobs:
touch -t "$timestamp" $proto
done
- name: Check format with Scalafmt on push
if: ${{ (github.event_name == 'push')}}
- name: Check format with Scalafmt
run: sbt scalafmtCheckAll
- name: Run format with Scalafmt on PR
if: ${{ (github.event_name == 'pull_request')}}
run: sbt scalafmtAll
- name: Run reviewdog for Scalafmt
uses: ./.github/actions/run-reviewdog
if: ${{ (github.event_name == 'pull_request') && failure() }}
with:
reviewdog-name: scalafmt
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check lint with Scalafix on push
if: ${{ (github.event_name == 'push')}}
- name: Run scalafix check
# cf. https://scalacenter.github.io/scalafix/docs/users/installation.html#enforce-in-ci
run: sbt "scalafix --check"
- name: Run lint with Scalafix on PR
if: ${{ (github.event_name == 'pull_request')}}
run: sbt scalafixAll
- name: Run reviewdog for Scalafix
- name: Annotate scalafix diagnostics with reviewdog
uses: ./.github/actions/run-reviewdog
if: ${{ (github.event_name == 'pull_request') && failure() }}
with:
@@ -128,7 +105,7 @@ jobs:
run: sbt assembly

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: SeichiAssist-build
path: target/build/SeichiAssist.jar
@@ -153,7 +130,7 @@ jobs:
sha: ${{ steps.output-sha.outputs.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Outputs the value
id: output-sha
run: |
@@ -170,7 +147,7 @@ jobs:
- output-sha
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Create and push a tag
id: tag-name
run: |
@@ -179,7 +156,7 @@ jobs:
git push origin $TAG_NAME
echo "value=$TAG_NAME" >> $GITHUB_OUTPUT
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: SeichiAssist-build
id: download
@@ -194,14 +171,14 @@ jobs:
prerelease: true

push_artifact_to_debug_server_definition:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/develop'
needs:
- build_test_and_upload
- output-sha
steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: SeichiAssist-build
id: download
@@ -254,19 +231,19 @@ jobs:
with:
webhook: ${{ secrets.DISCORD_DEBUG_SERVER_NOTIFICATION_WEBHOOK }}
title: "デバッグサーバーへデプロイ"
description: "deb_s1等にプラグインを配置しました。数分後に再起動します"
description: "deb_s1等にプラグインを配置しました。30分程度で再起動します"
username: GitHub Actions
noprefix: true
avatar_url: ${{ secrets.DISCORD_AVATAR_URL }}

deploy_artifact_to_production:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master'
needs:
- build_test_and_upload
steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: SeichiAssist-build
id: download
4 changes: 2 additions & 2 deletions .github/workflows/check-sql-version-duplicated-files.yml
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@ on:
- .github/workflows/check-sql-version-duplicated-files.yml
jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Fetch and merge develop
16 changes: 8 additions & 8 deletions .github/workflows/create_new_release.yml
Original file line number Diff line number Diff line change
@@ -5,16 +5,16 @@ on:

jobs:
get_branch_name:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
outputs:
value: ${{ steps.job.outputs.value }}
steps:
- name: Extract branch name
id: job
run: echo "::set-output name=value::$(echo ${GITHUB_REF#refs/heads/})"
run: echo "value=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT

bump_version:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: get_branch_name
outputs:
old_version: ${{ steps.bump.outputs.old_version }}
@@ -34,7 +34,7 @@ jobs:
update_version_to () {
echo "置換先のバージョン: $1"
echo "::set-output name=new_version::$1"
echo "new_version=$1" >> $GITHUB_OUTPUT
sed -i -e "s/ThisBuild \/ version := \"[0-9]\+\"/ThisBuild \/ version := \"$1\"/g" build.sbt
}
@@ -43,7 +43,7 @@ jobs:
exit 1
fi
echo "::set-output name=old_version::$(get_defined_versions)"
echo "old_version=$(get_defined_versions)" >> $GITHUB_OUTPUT
update_version_to $(get_defined_versions | xargs expr 1 +)
# 本来であればActionsに権限を増やしたりbranch protection ruleに例外を設けるなどしてpushを許したいが、
@@ -72,15 +72,15 @@ jobs:
HEAD:${{ needs.get_branch_name.outputs.value }}
create_release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: bump_version
steps:
- uses: actions/checkout@master
with:
# これがないとchunk_searchで引っかかってリリースのjarアップロードに失敗する
submodules: 'recursive'

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
@@ -100,7 +100,7 @@ jobs:
prerelease: false

create_pull-request_to_master:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_branch_name, bump_version]
steps:
- uses: actions/checkout@master
1 change: 1 addition & 0 deletions .sbtopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-J-Xmx10g
56 changes: 56 additions & 0 deletions CODING_GUIDELINE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# コーディングガイドライン

## \[Scala\] nullを使わない
Scalaのファイルにおいては、`null`を使用する代わりに`Option`を使用してください。

Java (特に、Bukkit/Spigot API) から入ってきた値が`null`になる可能性がある場合は、その呼び出しを早いうちに[`Option(...)`](https://www.scala-lang.org/api/2.13.4/scala/Option$.html#apply[A](x:A):Option[A])で囲い、`Option`にすることが推奨されます。この呼び出しで、引数が`null`だった場合は`None`に、そうでなかった場合は`Some(...)`になります。

## \[Scala\] 例外を使わない
例外の代わりに`Either`を使用してください。`Either`を使用すると低コストで合成を行うことができるためです。

## Javaコードを追加しない
Scalaを書くことができる場合はScalaを使ってください。

## メインスレッドでの処理は最小限に
メインスレッドで計算なども含めたすべての処理を行うことはサーバーのラグにつながるため、推奨されません。
推奨される処理の記述方法は次のとおりです。

1. 処理に必要なデータを得る
2. 非メインスレッドに遷移し、処理を行う
3. 処理結果の反映を行う

特に、必要なデータや処理結果の反映にワールドやエンティティが含まれる場合は、データの取得と反映をメインスレッドで行う必要があります。これはBukkitによる制約で、私達ではどうすることも出来ません。

## 型チェック・キャストを使わない
`asInstanceOf``isInstanceOf`はできるだけ使わないようにしましょう。Javaのキャスト演算子、`instanceof`演算子と同様の危険性および非効率性があります。最悪の場合全く関係ない型にキャストすることによって`ClassCastException`が発生し、サーバーが落ちる危険性があるので**避けられる場合は絶対に使わないでください。** shapelessなどのコンパイル時型プログラミングを積極的に活用するのも良いでしょう。

もしどうしても使わなければならない場合は、注意して影響範囲を**最小限に**押し込めるとともに、そこへのフローをできる限り制限してください。

----
※以下は、2023年7月25日現在の情報であり、古くなっている可能性があります

## メニュー画面を実装するために`InventoryClickEvent`を使わない
`InventoryClickEvent`はメニュー以外のインベントリ (例: チェスト) を操作したときも拾ってしまうため、メニューを実装するためにホックすることは推奨されません。
代わりに、[`Menu`](https://github.com/GiganticMinecraft/SeichiAssist/blob/41e63c0493621ff8afa32bce902d34a62ae466d2/src/main/scala/com/github/unchama/menuinventory/Menu.scala)を使ってください。

## 「サブシステム」へ分割、依存、及び準拠する
SeichiAssistには複数の関心事があり、その大半が「サブシステム」と呼ばれるひとまとまりとして`com.github.unchama.seichiassist.subsystems`以下にまとめられています。
[最新の一覧](https://github.com/GiganticMinecraft/SeichiAssist/tree/develop/src/main/scala/com/github/unchama/seichiassist/subsystems)

各サブシステムはそれぞれ他のサブシステムなどで使うことを想定したAPIを`trait`として持ち、各サブシステムはその抽象に対してのみ依存することができます。サブシステムの実装はAPIに具象的な実装を与える必要があります。APIの名前はおおよそ`Api``API`で終わります。

関心事同士の依存 (例: 整地スキルによってマナを減少させるためにマナを操作する) は 抽象の型を`implicit`パラメーターとして渡すことにより表現されます。

新しくサブシステムを作った場合、`SeichiAssist.scala`内で初期化することを忘れないでください。初期化を忘れると正しく機能しません。

サブシステムの構造は慣例的に次のようになっています。新しくサブシステムを作る場合は一貫性のためにこの構造に準拠することが推奨されます。

* (サブシステムのルート)
* `application` - タスク、データのレポジトリの初期化・終了処理など
* `bukkit` - Bukkit固有の実装
* `commands` - Bukkitのコマンド
* `listeners` - Bukkitのイベントリスナー
* `domain` - モデル
* `infrastructure` - インフラ (JDBCによるデータベースへの保存・読み込みなど)
* `subsystems` - 子サブシステム
* `System` - サブシステムの「親分」
Loading