Skip to content

Commit

Permalink
Merge pull request #2209 from rsoba/fix/on-break-missing-texture
Browse files Browse the repository at this point in the history
fix: 特定のブロックを破壊した場合に発生するテクスチャバグを修正
  • Loading branch information
Lucky3028 authored Sep 4, 2023
2 parents bfb7ffc + d8e13b6 commit 17bdc7d
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ object BreakUtil {
new ItemStack(blockMaterial, 1, b_tree.toShort)
case Material.MONSTER_EGGS =>
new ItemStack(Material.STONE)
case Material.WOOD_STEP | Material.STEP | Material.STONE_SLAB2 |
Material.PURPUR_SLAB if (blockDataLeast4Bits & 8) != 0 =>
// 上付きハーフブロックのmissing texture化を防ぐ
new ItemStack(blockMaterial, 1, (blockDataLeast4Bits & 7).toShort)
case Material.QUARTZ_BLOCK if (blockData >= 2 && blockData <= 4) =>
// 柱状クォーツブロックのmissing texture化を防ぐ
new ItemStack(blockMaterial, 1, 2.toShort)
case _ =>
new ItemStack(blockMaterial, 1, blockDataLeast4Bits.toShort)
}
Expand Down Expand Up @@ -364,13 +371,16 @@ object BreakUtil {
Some(BlockBreakResult.SpawnSilverFish(blockLocation))
case Material.LOG | Material.LOG_2 =>
Some(BlockBreakResult.ItemDrop(new ItemStack(blockMaterial, 1, b_tree.toShort)))
case Material.WOOD_STEP | Material.STEP | Material.STONE_SLAB2
case Material.WOOD_STEP | Material.STEP | Material.STONE_SLAB2 | Material.PURPUR_SLAB
if (blockDataLeast4Bits & 8) != 0 =>
// 上付きハーフブロックをそのままドロップするとmissing textureとして描画されるため、下付きの扱いとする
Some(
BlockBreakResult
.ItemDrop(new ItemStack(blockMaterial, 1, (blockDataLeast4Bits & 7).toShort))
)
case Material.QUARTZ_BLOCK if (blockData >= 2 && blockData <= 4) =>
// 柱状クォーツブロックのmissing texture化を防ぐ (柱状クォーツのData valueは2, 3, 4のいずれか)
Some(BlockBreakResult.ItemDrop(new ItemStack(blockMaterial, 1, 2.toShort)))
case Material.BOOKSHELF =>
// 本棚を破壊すると、本が3つドロップする
Some(BlockBreakResult.ItemDrop(new ItemStack(Material.BOOK, 3)))
Expand Down

0 comments on commit 17bdc7d

Please sign in to comment.