Skip to content

Commit 9958d37

Browse files
committed
Fixed IncompatibleClassChangeError when breaking paintings in 1.21.1 and earlier
1 parent 2780a9a commit 9958d37

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/net/coreprotect/listener/entity/HangingBreakListener.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ else if (cause.equals(HangingBreakEvent.RemoveCause.OBSTRUCTION)) {
7272
material = Material.PAINTING;
7373
Painting painting = (Painting) entity;
7474
blockData = "FACING=" + painting.getFacing().name();
75-
itemData = Util.getArtId(painting.getArt().toString(), true);
75+
try {
76+
itemData = Util.getArtId(painting.getArt().toString(), true);
77+
}
78+
catch (IncompatibleClassChangeError e) {
79+
// 1.21.2+
80+
}
7681
}
7782

7883
if (!event.isCancelled() && Config.getConfig(blockEvent.getWorld()).NATURAL_BREAK) {

0 commit comments

Comments
 (0)