Skip to content

Commit

Permalink
feat: スイカ・プリズマリンクリスタルを、幸運エンチャントに対応させる
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoba committed May 28, 2023
1 parent c8bbda0 commit 46d432e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ object MaterialSets {
Material.EMERALD_ORE,
Material.REDSTONE_ORE,
Material.GLOWING_REDSTONE_ORE,
Material.QUARTZ_ORE
Material.QUARTZ_ORE,
Material.MELON_BLOCK,
Material.SEA_LANTERN
)

// このMaterialは整地スキルに対応する
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ object BreakUtil {
val withBonus = (rand * (fortuneLevel + 3) + 2).toInt
val amount = if (withBonus > 4) 4 else withBonus
new ItemStack(Material.GLOWSTONE_DUST, amount)
case Material.MELON_BLOCK =>
val withBonus = (rand * (fortuneLevel + 5) + 3).toInt
val amount = if (withBonus > 9) 9 else withBonus
new ItemStack(Material.MELON, amount)
case Material.SEA_LANTERN =>
val withBonus = (rand * (fortuneLevel + 2) + 2).toInt
val amount = if (withBonus > 5) 5 else withBonus
new ItemStack(Material.PRISMARINE_CRYSTALS, amount)
case _ =>
// unreachable
new ItemStack(blockMaterial, bonus)
Expand Down Expand Up @@ -269,6 +277,18 @@ object BreakUtil {
BlockBreakResult
.ItemDrop(new ItemStack(Material.GLOWSTONE_DUST, (rand * 3 + 2).toInt))
)
// スイカブロックは、3から7個のスイカをドロップする
case Material.MELON_BLOCK =>
Some(
BlockBreakResult
.ItemDrop(new ItemStack(Material.MELON, (rand * 5 + 3).toInt))
)
// シーランタンは、2から3個のプリズマリンクリスタルをドロップする
case Material.SEA_LANTERN =>
Some(
BlockBreakResult
.ItemDrop(new ItemStack(Material.PRISMARINE_CRYSTALS, (rand * 2 + 2).toInt))
)
case Material.STONE =>
Some {
BlockBreakResult.ItemDrop {
Expand Down

0 comments on commit 46d432e

Please sign in to comment.