Prevent NullPointerException when adding new loot pool. (#7605)

This commit is contained in:
Jon authored and GitHub committed 2021-02-09 12:59:48 -08:00
1 parent 93a815957d
commit f450d4025d
1 file changed
+1 -1
@@ -83,7 +83,7 @@
+
+ public void addPool(LootPool pool) {
+ checkFrozen();
+ if (field_186466_c.stream().anyMatch(e -> e == pool || e.getName().equals(pool.getName())))
+ if (field_186466_c.stream().anyMatch(e -> e == pool || e.getName() != null && e.getName().equals(pool.getName())))
+ throw new RuntimeException("Attempted to add a duplicate pool to loot table: " + pool.getName());
+ this.field_186466_c.add(pool);
+ }