Skip to content

Commit

Permalink
fix: y-59以下のハーフブロックを破壊できないようにする機能の座標指定が間違っていたので修正
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Oct 7, 2023
1 parent 538a274 commit f9dac26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class PlayerBlockBreakListener(
}

/**
* y-58ハーフブロック破壊抑制
* y-59ハーフブロック破壊抑制
*
* @param event
* BlockBreakEvent
Expand All @@ -356,10 +356,10 @@ class PlayerBlockBreakListener(
world.dropItemNaturally(location, new ItemStack(block.getType))
case _ =>
}
if (block.getY > -58) return
if (block.getY > -59) return
if (block.getBlockData.asInstanceOf[Slab].getType != Slab.Type.BOTTOM) return
if (!world.isSeichi) return
event.setCancelled(true)
player.sendMessage(s"${RED}Y-58以下に敷かれたハーフブロックは破壊不可能です")
player.sendMessage(s"${RED}Y-59以下に敷かれたハーフブロックは破壊不可能です")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import com.github.unchama.seichiassist.subsystems.minestack.domain.minestackobje
import org.bukkit.Material
import org.bukkit.entity.Player
import org.bukkit.inventory.ItemStack
import org.bukkit.inventory.meta.PotionMeta
import org.bukkit.potion.{PotionData, PotionType}

class BukkitMineStackObjectList[F[_]: Sync](
implicit gachaPrizeAPI: GachaPrizeAPI[F, ItemStack, Player],
Expand Down Expand Up @@ -81,6 +83,8 @@ class BukkitMineStackObjectList[F[_]: Sync](
MineStackObjectByMaterial(ORES, "iron_nugget", "鉄塊", Material.IRON_NUGGET),
)

import scala.util.chaining._

// モンスター+動物ドロップ
private val minestacklistdrop: List[MineStackObjectGroup[ItemStack]] = leftElems(
MineStackObjectByMaterial(MOB_DROP, "ender_pearl", "エンダーパール", Material.ENDER_PEARL),
Expand All @@ -91,8 +95,12 @@ class BukkitMineStackObjectList[F[_]: Sync](
MineStackObjectByMaterial(MOB_DROP, "bone", "", Material.BONE),
MineStackObjectByMaterial(MOB_DROP, "sulphur", "火薬", Material.GUNPOWDER),
MineStackObjectByMaterial(MOB_DROP, "arrow", "", Material.ARROW),
MineStackObjectByMaterial(MOB_DROP, "tipped_arrow", "鈍化の矢", Material.TIPPED_ARROW),
MineStackObjectByMaterial(MOB_DROP, "spider_eye", "蜘蛛の目", Material.SPIDER_EYE),
MineStackObjectByItemStack(MOB_DROP, "tipped_arrow", Some("鈍化の矢"), hasNameLore = false, new ItemStack(Material.TIPPED_ARROW).tap { itemStack =>
val meta = itemStack.getItemMeta.asInstanceOf[PotionMeta]
meta.setBasePotionData(new PotionData(PotionType.SLOWNESS))
itemStack.setItemMeta(meta)
}),
MineStackObjectByMaterial(MOB_DROP, "string", "", Material.STRING),
MineStackObjectByMaterial(MOB_DROP, "name_tag", "名札", Material.NAME_TAG),
MineStackObjectByMaterial(MOB_DROP, "lead", "リード", Material.LEAD),
Expand Down

0 comments on commit f9dac26

Please sign in to comment.