SteamWar/SpigotCore
Archiviert
13
0

Merge pull request 'Improved 1.12 .schem loader' (#81) from improvingSchemLoader into master

Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2020-12-25 23:32:16 +01:00
Commit cf185ad868
3 geänderte Dateien mit 1628 neuen und 1752 gelöschten Zeilen

Datei anzeigen

@ -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;
}

Datei anzeigen

@ -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