mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 18:15:39 +01:00
Allow null rewrite function in TagRewriter
This commit is contained in:
parent
9ce3d8e567
commit
d94ed4ebd4
@ -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);
|
||||||
for (int i = 0; i < unmappedIds.length; i++) {
|
if (rewriteFunction != null) {
|
||||||
int oldId = unmappedIds[i];
|
for (int i = 0; i < unmappedIds.length; i++) {
|
||||||
unmappedIds[i] = rewriteFunction.rewrite(oldId);
|
int unmappedId = unmappedIds[i];
|
||||||
|
unmappedIds[i] = rewriteFunction.rewrite(unmappedId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newTags.add(new TagData(tagId, unmappedIds));
|
newTags.add(new TagData(tagId, unmappedIds));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user