Update to Minecraft 1.16.5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-01-16 12:00:00 +11:00
parent 789c080552
commit 78ff16111e
27 changed files with 76 additions and 114 deletions

View File

@@ -3,7 +3,7 @@
@@ -15,6 +15,7 @@
private static final Logger LOGGER = LogManager.getLogger();
private static final Gson b = LootSerialization.c().create();
private Map<MinecraftKey, LootTable> c = ImmutableMap.of();
private Map<MinecraftKey, LootTable> keyToLootTable = ImmutableMap.of();
+ public Map<LootTable, MinecraftKey> lootTableToKey = ImmutableMap.of(); // CraftBukkit
private final LootPredicateManager d;
@@ -20,10 +20,10 @@
@@ -62,6 +63,11 @@
LootTableRegistry.LOGGER.warn("Found validation problem in " + s + ": " + s1);
});
this.c = immutablemap;
this.keyToLootTable = immutablemap;
+ // CraftBukkit start - build a reversed registry map
+ ImmutableMap.Builder<LootTable, MinecraftKey> lootTableToKeyBuilder = ImmutableMap.builder();
+ this.c.forEach((lootTable, key) -> lootTableToKeyBuilder.put(key, lootTable)); // PAIL rename keyToLootTable
+ this.keyToLootTable.forEach((lootTable, key) -> lootTableToKeyBuilder.put(key, lootTable)); // PAIL rename keyToLootTable
+ this.lootTableToKey = lootTableToKeyBuilder.build();
+ // CraftBukkit end
}