fix: make projector block not piston push-able
This commit is contained in:
parent
df4ad180d7
commit
f9e6ffacc1
@ -13,6 +13,7 @@ import net.minecraft.world.level.block.Block
|
|||||||
import net.minecraft.world.level.block.EntityBlock
|
import net.minecraft.world.level.block.EntityBlock
|
||||||
import net.minecraft.world.level.block.state.BlockState
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
import net.minecraft.world.level.material.MapColor
|
import net.minecraft.world.level.material.MapColor
|
||||||
|
import net.minecraft.world.level.material.PushReaction
|
||||||
import net.minecraft.world.phys.BlockHitResult
|
import net.minecraft.world.phys.BlockHitResult
|
||||||
|
|
||||||
object ProjectorBlock : Block(Properties.of()
|
object ProjectorBlock : Block(Properties.of()
|
||||||
@ -21,7 +22,9 @@ object ProjectorBlock : Block(Properties.of()
|
|||||||
.mapColor(MapColor.COLOR_BLACK)
|
.mapColor(MapColor.COLOR_BLACK)
|
||||||
.randomTicks()
|
.randomTicks()
|
||||||
.strength(4.0f)
|
.strength(4.0f)
|
||||||
.requiresCorrectToolForDrops()), EntityBlock {
|
.requiresCorrectToolForDrops()
|
||||||
|
.pushReaction(PushReaction.IGNORE)
|
||||||
|
), EntityBlock {
|
||||||
|
|
||||||
fun checkUpdate(level: Level, pos: BlockPos) {
|
fun checkUpdate(level: Level, pos: BlockPos) {
|
||||||
if (!level.isClientSide) {
|
if (!level.isClientSide) {
|
||||||
|
@ -16,7 +16,7 @@ object ProjectionShellItem : Item(
|
|||||||
val block = context.level.getBlockState(context.clickedPos).block
|
val block = context.level.getBlockState(context.clickedPos).block
|
||||||
if (block is ProjectionShellBlock && context.level.isClientSide) {
|
if (block is ProjectionShellBlock && context.level.isClientSide) {
|
||||||
ProjectionShell.channel.sendToServer(ServerboundPSHLockAcquirePacket(context.clickedPos))
|
ProjectionShell.channel.sendToServer(ServerboundPSHLockAcquirePacket(context.clickedPos))
|
||||||
return InteractionResult.SUCCESS
|
return InteractionResult.CONSUME
|
||||||
}
|
}
|
||||||
return InteractionResult.PASS
|
return InteractionResult.PASS
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user