Check for block type in SculkSensorBlock#canActivate

This commit is contained in:
Nassim Jahnke 2024-08-07 14:33:25 +02:00
parent 92fa922afd
commit 334058fa69

View File

@ -30,7 +30,12 @@
BlockEntity tileentity = world.getBlockEntity(pos);
if (tileentity instanceof SculkSensorBlockEntity) {
@@ -202,6 +218,15 @@
@@ -198,10 +214,19 @@
}
public static boolean canActivate(BlockState state) {
- return SculkSensorBlock.getPhase(state) == SculkSensorPhase.INACTIVE;
+ return state.getBlock() instanceof SculkSensorBlock && SculkSensorBlock.getPhase(state) == SculkSensorPhase.INACTIVE; // Paper - Check for a valid type
}
public static void deactivate(Level world, BlockPos pos, BlockState state) {