Use validated channel in getNewPluginChannelId

Fixes #2707
This commit is contained in:
Nassim Jahnke 2021-10-08 17:29:05 +02:00
parent 36b8884d92
commit fd9346d4da
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 3 additions and 3 deletions

View File

@ -139,9 +139,9 @@ public class MappingData extends MappingDataBase {
int separatorIndex = newId.indexOf(':');
// Vanilla parses an empty and a missing namespace as the minecraft namespace
if (separatorIndex == -1) {
newId = "minecraft:" + newId;
return "minecraft:" + newId;
} else if (separatorIndex == 0) {
newId = "minecraft" + newId;
return "minecraft" + newId;
}
return newId;
}

View File

@ -483,7 +483,7 @@ public class InventoryPackets extends ItemRewriter<Protocol1_13To1_12_2> {
default:
String mappedChannel = Protocol1_13To1_12_2.MAPPINGS.getChannelMappings().get(old);
if (mappedChannel != null) return mappedChannel;
return MappingData.isValid1_13Channel(old) ? old : null;
return MappingData.validateNewChannel(old);
}
}