Skip to content

Commit

Permalink
GH-22 Fix legacy drops
Browse files Browse the repository at this point in the history
  • Loading branch information
zrdzn committed May 4, 2022
1 parent fe99106 commit 6412842
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@ public void onSourceBreak(BlockBreakEvent event) {

Block block = event.getBlock();

MaterialData source = block.getState().getData();
MaterialData source = null;
for (MaterialData legacyData : this.dropItemCache.getDrops().keySet()) {
if (block.getType() == legacyData.getItemType() && block.getData() == legacyData.getData()) {
source = legacyData;
break;
}
}

if (source == null) {
return;
}

// Get optional drops from source blocks.
Set<DropItem> sourceDrops = this.dropItemCache.getDrops(source);
Expand Down

0 comments on commit 6412842

Please sign in to comment.