Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 08:10:11 +01:00
Enchantment tag can be null
Dieser Commit ist enthalten in:
Ursprung
d19807170d
Commit
956a84a3fb
@ -26,6 +26,7 @@
|
||||
package org.geysermc.geyser.session.cache;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.IntArrays;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.GeyserLogger;
|
||||
import org.geysermc.geyser.inventory.GeyserItemStack;
|
||||
@ -83,8 +84,12 @@ public final class TagCache {
|
||||
loadTags("Enchantment", enchantmentTags, ALL_ENCHANTMENT_TAGS, this.enchantments);
|
||||
}
|
||||
|
||||
private <T extends Ordered> void loadTags(String type, Map<String, int[]> packetTags, Map<String, T> allTags, int[][] localValues) {
|
||||
private <T extends Ordered> void loadTags(String type, @Nullable Map<String, int[]> packetTags, Map<String, T> allTags, int[][] localValues) {
|
||||
Arrays.fill(localValues, IntArrays.EMPTY_ARRAY);
|
||||
if (packetTags == null) {
|
||||
GeyserImpl.getInstance().getLogger().debug("Not loading " + type + " tags; they do not exist here.");
|
||||
return;
|
||||
}
|
||||
allTags.forEach((location, tag) -> {
|
||||
int[] values = packetTags.get(location);
|
||||
if (values != null) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren