Skip to content

Commit

Permalink
Fix LootTableLoadEvent being called for the empty table (#485)
Browse files Browse the repository at this point in the history
Fixes #474
  • Loading branch information
Technici4n authored Jan 11, 2024
1 parent d8d7873 commit f073e27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/net/neoforged/neoforge/event/EventHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ public static boolean onProjectileImpact(Projectile projectile, HitResult ray) {
}

public static LootTable loadLootTable(ResourceLocation name, LootTable table) {
if (table == LootTable.EMPTY) // Empty table has a null name, and shouldn't be modified anyway.
return table;
LootTableLoadEvent event = new LootTableLoadEvent(name, table);
if (NeoForge.EVENT_BUS.post(event).isCanceled())
return LootTable.EMPTY;
Expand Down

0 comments on commit f073e27

Please sign in to comment.