Skip to content

Commit

Permalink
Fixed IncompatibleClassChangeError when breaking paintings in 1.21.1 …
Browse files Browse the repository at this point in the history
…and earlier
  • Loading branch information
Intelli committed Nov 5, 2024
1 parent 2780a9a commit 9958d37
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ else if (cause.equals(HangingBreakEvent.RemoveCause.OBSTRUCTION)) {
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) {
Expand Down

0 comments on commit 9958d37

Please sign in to comment.