48 lines
2.2 KiB
Diff
48 lines
2.2 KiB
Diff
--- a/net/minecraft/data/LootTableProvider.java
|
|
+++ b/net/minecraft/data/LootTableProvider.java
|
|
@@ -43,7 +43,7 @@
|
|
public void func_200398_a(DirectoryCache p_200398_1_) {
|
|
Path path = this.field_218443_d.func_200391_b();
|
|
Map<ResourceLocation, LootTable> map = Maps.newHashMap();
|
|
- this.field_218444_e.forEach((p_218438_1_) -> {
|
|
+ this.getTables().forEach((p_218438_1_) -> {
|
|
p_218438_1_.getFirst().get().accept((p_218437_2_, p_218437_3_) -> {
|
|
if (map.put(p_218437_2_, p_218437_3_.func_216039_a(p_218438_1_.getSecond()).func_216038_b()) != null) {
|
|
throw new IllegalStateException("Duplicate loot table " + p_218437_2_);
|
|
@@ -54,13 +54,8 @@
|
|
return null;
|
|
}, map::get);
|
|
|
|
- for(ResourceLocation resourcelocation : Sets.difference(LootTables.func_215796_a(), map.keySet())) {
|
|
- validationtracker.func_227530_a_("Missing built-in table: " + resourcelocation);
|
|
- }
|
|
+ validate(map, validationtracker);
|
|
|
|
- map.forEach((p_229439_1_, p_229439_2_) -> {
|
|
- LootTableManager.func_227508_a_(validationtracker, p_229439_1_, p_229439_2_);
|
|
- });
|
|
Multimap<String, String> multimap = validationtracker.func_227527_a_();
|
|
if (!multimap.isEmpty()) {
|
|
multimap.forEach((p_229440_0_, p_229440_1_) -> {
|
|
@@ -81,6 +76,20 @@
|
|
}
|
|
}
|
|
|
|
+ protected List<Pair<Supplier<Consumer<BiConsumer<ResourceLocation, LootTable.Builder>>>, LootParameterSet>> getTables() {
|
|
+ return field_218444_e;
|
|
+ }
|
|
+
|
|
+ protected void validate(Map<ResourceLocation, LootTable> map, ValidationTracker validationtracker) {
|
|
+ for(ResourceLocation resourcelocation : Sets.difference(LootTables.func_215796_a(), map.keySet())) {
|
|
+ validationtracker.func_227530_a_("Missing built-in table: " + resourcelocation);
|
|
+ }
|
|
+
|
|
+ map.forEach((p_218436_2_, p_218436_3_) -> {
|
|
+ LootTableManager.func_227508_a_(validationtracker, p_218436_2_, p_218436_3_);
|
|
+ });
|
|
+ }
|
|
+
|
|
private static Path func_218439_a(Path p_218439_0_, ResourceLocation p_218439_1_) {
|
|
return p_218439_0_.resolve("data/" + p_218439_1_.func_110624_b() + "/loot_tables/" + p_218439_1_.func_110623_a() + ".json");
|
|
}
|