-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for block type in SculkSensorBlock#canActivate
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
patches/server/1046-Check-for-block-type-in-SculkSensorBlock-canActivate.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Nassim Jahnke <nassim@njahnke.dev> | ||
Date: Wed, 7 Aug 2024 14:33:25 +0200 | ||
Subject: [PATCH] Check for block type in SculkSensorBlock#canActivate | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java b/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java | ||
index 9e928302817ee8e1cc8c7f3f1b351a0d5f3a7c2c..1db261f63aaf083b4d38f519f77abecbd942e999 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java | ||
@@ -218,7 +218,7 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg | ||
} | ||
|
||
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) { |