Fixed IncompatibleClassChangeError when breaking paintings in 1.21.1 and earlier

This commit is contained in:
Intelli 2024-11-05 10:17:55 -07:00
parent 2780a9af27
commit 9958d372e3

View File

@ -72,7 +72,12 @@ public final class HangingBreakListener extends Queue implements Listener {
material = Material.PAINTING;
Painting painting = (Painting) entity;
blockData = "FACING=" + painting.getFacing().name();
itemData = Util.getArtId(painting.getArt().toString(), true);
try {
itemData = Util.getArtId(painting.getArt().toString(), true);
}
catch (IncompatibleClassChangeError e) {
// 1.21.2+
}
}
if (!event.isCancelled() && Config.getConfig(blockEvent.getWorld()).NATURAL_BREAK) {