Skip to content

Commit 5f03e11

Browse files
traksaglynxplay
andauthored
Fix isInteractable for copper chests (#13325)
Co-authored-by: Bjarne Koll <[email protected]>
1 parent f08aad2 commit 5f03e11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ private static boolean hasMethod(Class<?> clazz, Class<?>... params) {
8282
private static boolean isInteractable(Block block) {
8383
Class<?> clazz = block.getClass();
8484

85-
boolean hasMethod = CraftBlockType.hasMethod(clazz, CraftBlockType.USE_WITHOUT_ITEM_ARGS) || CraftBlockType.hasMethod(clazz, CraftBlockType.USE_ITEM_ON_ARGS);
86-
87-
if (!hasMethod && clazz.getSuperclass() != BlockBehaviour.class) {
88-
clazz = clazz.getSuperclass();
85+
boolean hasMethod = false;
8986

87+
while (!hasMethod && clazz != BlockBehaviour.class && clazz != null) {
9088
hasMethod = CraftBlockType.hasMethod(clazz, CraftBlockType.USE_WITHOUT_ITEM_ARGS) || CraftBlockType.hasMethod(clazz, CraftBlockType.USE_ITEM_ON_ARGS);
89+
90+
clazz = clazz.getSuperclass();
9191
}
9292

9393
return hasMethod;

0 commit comments

Comments
 (0)