forked from LogBlock/LogBlock
Fix loading old walls
This commit is contained in:
@@ -154,7 +154,7 @@ public class MaterialConverter {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (blockStateId >= 0 && blockStateId < idToBlockState.length && idToBlockState[blockStateId] != null) {
|
if (blockStateId >= 0 && blockStateId < idToBlockState.length && idToBlockState[blockStateId] != null) {
|
||||||
material = material + idToBlockState[blockStateId];
|
material = material + updateBlockState(material, idToBlockState[blockStateId]);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return Bukkit.createBlockData(material);
|
return Bukkit.createBlockData(material);
|
||||||
@@ -236,4 +236,21 @@ public class MaterialConverter {
|
|||||||
nextBlockStateId = key + 1;
|
nextBlockStateId = key + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String updateBlockState(String material, String blockState) {
|
||||||
|
// since 1.16
|
||||||
|
if (material.endsWith("_wall")) {
|
||||||
|
if (blockState.contains("east=false") || blockState.contains("east=true")) {
|
||||||
|
blockState = blockState.replace("east=false", "east=none");
|
||||||
|
blockState = blockState.replace("west=false", "west=none");
|
||||||
|
blockState = blockState.replace("north=false", "north=none");
|
||||||
|
blockState = blockState.replace("south=false", "south=none");
|
||||||
|
blockState = blockState.replace("east=true", "east=low");
|
||||||
|
blockState = blockState.replace("west=true", "west=low");
|
||||||
|
blockState = blockState.replace("north=true", "north=low");
|
||||||
|
blockState = blockState.replace("south=true", "south=low");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return blockState;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1113,8 +1113,8 @@
|
|||||||
137:14,minecraft:command_block[conditional=true,facing=down]
|
137:14,minecraft:command_block[conditional=true,facing=down]
|
||||||
137:15,minecraft:command_block[conditional=true,facing=up]
|
137:15,minecraft:command_block[conditional=true,facing=up]
|
||||||
138:0,minecraft:beacon
|
138:0,minecraft:beacon
|
||||||
139:0,minecraft:cobblestone_wall[east=false,north=false,south=false,up=false,waterlogged=false,west=false]
|
139:0,minecraft:cobblestone_wall[east=none,north=none,south=none,up=false,waterlogged=false,west=none]
|
||||||
139:1,minecraft:mossy_cobblestone_wall[east=false,north=false,south=false,up=false,waterlogged=false,west=false]
|
139:1,minecraft:mossy_cobblestone_wall[east=none,north=none,south=none,up=false,waterlogged=false,west=none]
|
||||||
140:0,minecraft:flower_pot
|
140:0,minecraft:flower_pot
|
||||||
141:0,minecraft:carrots[age=0]
|
141:0,minecraft:carrots[age=0]
|
||||||
141:1,minecraft:carrots[age=1]
|
141:1,minecraft:carrots[age=1]
|
||||||
|
Reference in New Issue
Block a user