3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01:00

This variant of tag loading should be slightly more efficient

Dieser Commit ist enthalten in:
Camotoy 2024-06-12 00:12:15 -04:00
Ursprung 956a84a3fb
Commit a42c979abb
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -85,8 +85,8 @@ public final class TagCache {
} }
private <T extends Ordered> void loadTags(String type, @Nullable 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) { if (packetTags == null) {
Arrays.fill(localValues, IntArrays.EMPTY_ARRAY);
GeyserImpl.getInstance().getLogger().debug("Not loading " + type + " tags; they do not exist here."); GeyserImpl.getInstance().getLogger().debug("Not loading " + type + " tags; they do not exist here.");
return; return;
} }
@ -95,8 +95,11 @@ public final class TagCache {
if (values != null) { if (values != null) {
if (values.length != 0) { if (values.length != 0) {
localValues[tag.ordinal()] = values; localValues[tag.ordinal()] = values;
} else {
localValues[tag.ordinal()] = IntArrays.EMPTY_ARRAY;
} }
} else { } else {
localValues[tag.ordinal()] = IntArrays.EMPTY_ARRAY;
GeyserImpl.getInstance().getLogger().debug(type + " tag not found from server: " + location); GeyserImpl.getInstance().getLogger().debug(type + " tag not found from server: " + location);
} }
}); });