File tree Expand file tree Collapse file tree
src/main/kotlin/cn/coostack/cooparticlesapi/barrages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ loader_version=0.16.10
1010fabric_kotlin_version =1.13.2+kotlin.2.1.20
1111
1212# Mod Properties
13- mod_version =1.8.1
13+ mod_version =1.8.2
1414maven_group =cn.coostack
1515archives_base_name =coo-particles-api
1616
Original file line number Diff line number Diff line change @@ -59,10 +59,13 @@ abstract class AbstractBarrage(
5959 val block = world.getBlockState(blockPos)
6060 val result = BarrageHitResult ()
6161 if (! block.isAir) {
62- if (block.isLiquid && ! options.acrossLiquid) {
63- result.hitBlockState = block
64- hit(result)
65- } else if (! options.acrossBlock) {
62+ val shape = block.getCollisionShape(world, blockPos)
63+ if (block.isLiquid) {
64+ if (! options.acrossLiquid) {
65+ result.hitBlockState = block
66+ hit(result)
67+ }
68+ } else if (! options.acrossBlock && (! shape.isEmpty || ! options.acrossEmptyCollectionShape)) {
6669 result.hitBlockState = block
6770 hit(result)
6871 }
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ class BarrageOption {
1616 */
1717 var acrossBlock = false
1818
19+ /* *
20+ * 是否可以穿过类似 草 这种没有方块碰撞箱的方块
21+ */
22+ var acrossEmptyCollectionShape = true
23+
1924 /* *
2025 * 是否可以穿过液体
2126 * 如果为false则遇到液体会触发onHit方法
You can’t perform that action at this time.
0 commit comments