mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
This variant of tag loading should be slightly more efficient
This commit is contained in:
parent
956a84a3fb
commit
a42c979abb
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue