Merge pull request 'Improved 1.12 .schem loader' (#81) from improvingSchemLoader into master
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
cf185ad868
@ -32,12 +32,12 @@ class IDConverter {
|
||||
static Map<String, BlockTypeID> getMap(){
|
||||
Map<String, BlockTypeID> ids = new HashMap<>();
|
||||
YamlConfiguration legacy = YamlConfiguration.loadConfiguration(new InputStreamReader(Objects.requireNonNull(IDConverter.class.getClassLoader().getResourceAsStream("legacy.yml"))));
|
||||
for(String blockNum : legacy.getKeys(false)){
|
||||
for(String blockString : legacy.getKeys(false)){
|
||||
String blockNum = legacy.getString(blockString);
|
||||
String[] block = blockNum.split(":");
|
||||
String blockString = legacy.getString(blockNum);
|
||||
ids.put(blockString, new BlockTypeID(Integer.parseInt(block[0]), Byte.parseByte(block[1])));
|
||||
if(blockString.contains("["))
|
||||
ids.put(blockString.split("\\[")[0], new BlockTypeID(Integer.parseInt(block[0]), (byte)0));
|
||||
ids.putIfAbsent(blockString.split("\\[")[0], new BlockTypeID(Integer.parseInt(block[0]), (byte)0));
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
@ -177,8 +177,8 @@ class Schematic_8 {
|
||||
|
||||
int id;
|
||||
BaseBlock state;
|
||||
for(Iterator iterator = paletteObject.keySet().iterator(); iterator.hasNext(); palette.put(id, state)) {
|
||||
String palettePart = (String)iterator.next();
|
||||
for(Iterator<String> iterator = paletteObject.keySet().iterator(); iterator.hasNext(); palette.put(id, state)) {
|
||||
String palettePart = iterator.next();
|
||||
id = requireTag(paletteObject, palettePart, IntTag.class).getValue();
|
||||
|
||||
IDConverter.BlockTypeID blockID = ids.get(palettePart);
|
||||
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
In neuem Issue referenzieren
Einen Benutzer sperren