3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Allow null rewrite function in TagRewriter

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-03-03 15:14:52 +01:00
Ursprung 9ce3d8e567
Commit d94ed4ebd4
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -110,9 +110,11 @@ public class TagRewriter<C extends ClientboundPacketType> {
public void addTag(RegistryType tagType, String tagId, int... unmappedIds) { public void addTag(RegistryType tagType, String tagId, int... unmappedIds) {
List<TagData> newTags = getOrComputeNewTags(tagType); List<TagData> newTags = getOrComputeNewTags(tagType);
IdRewriteFunction rewriteFunction = getRewriter(tagType); IdRewriteFunction rewriteFunction = getRewriter(tagType);
if (rewriteFunction != null) {
for (int i = 0; i < unmappedIds.length; i++) { for (int i = 0; i < unmappedIds.length; i++) {
int oldId = unmappedIds[i]; int unmappedId = unmappedIds[i];
unmappedIds[i] = rewriteFunction.rewrite(oldId); unmappedIds[i] = rewriteFunction.rewrite(unmappedId);
}
} }
newTags.add(new TagData(tagId, unmappedIds)); newTags.add(new TagData(tagId, unmappedIds));
} }