Fix npe in mapping loading

This commit is contained in:
KennyTV 2020-04-09 16:40:46 +02:00
parent b8dde25f3a
commit 6ab2e2f0b2
2 changed files with 5 additions and 3 deletions

View File

@ -67,9 +67,10 @@ public class VBMappingDataLoader {
String diffValue = diffValueJson != null ? diffValueJson.getAsString() : null;
int dataIndex;
if (diffValue == null && (dataIndex = key.indexOf('[')) != -1) {
if (diffValue == null && (dataIndex = key.indexOf('[')) != -1
&& (diffValueJson = diffIdentifiers.getAsJsonPrimitive(key.substring(0, dataIndex))) != null) {
// Check for wildcard mappings
diffValue = diffIdentifiers.getAsJsonPrimitive(key.substring(0, dataIndex)).getAsString();
diffValue = diffValueJson.getAsString();
// Keep original properties if value ends with [
if (diffValue.endsWith("[")) {

View File

@ -350,7 +350,8 @@
"minecraft:polished_andesite_slab": "minecraft:stone_brick_slab[",
"minecraft:diorite_slab": "minecraft:quartz_slab[",
"minecraft:brick_wall": "minecraft:cobblestone_wall[",
"minecraft:prismarine_wall": "minecraft:cobblestone_wall[",
"minecraft:prismarine_wall": "minecraft:cobblestone_wall[",
"minecraft:sandstone_wall": "minecraft:cobblestone_wall[",
"minecraft:red_sandstone_wall": "minecraft:cobblestone_wall[",
"minecraft:mossy_stone_brick_wall": "minecraft:mossy_cobblestone_wall[",
"minecraft:granite_wall": "minecraft:cobblestone_wall[",