SteamWar/SpigotCore
Archiviert
13
0

Flipping values

Dieser Commit ist enthalten in:
Lixfel 2020-05-12 17:24:42 +02:00
Ursprung abd9815de9
Commit 08f0ff3bb1
3 geänderte Dateien mit 1628 neuen und 1752 gelöschten Zeilen

Datei anzeigen

@ -13,12 +13,12 @@ class IDConverter {
static Map<String, BlockTypeID> getMap(){ static Map<String, BlockTypeID> getMap(){
Map<String, BlockTypeID> ids = new HashMap<>(); Map<String, BlockTypeID> ids = new HashMap<>();
YamlConfiguration legacy = YamlConfiguration.loadConfiguration(new InputStreamReader(Objects.requireNonNull(IDConverter.class.getClassLoader().getResourceAsStream("legacy.yml")))); 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[] block = blockNum.split(":");
String blockString = legacy.getString(blockNum);
ids.put(blockString, new BlockTypeID(Integer.parseInt(block[0]), Byte.parseByte(block[1]))); ids.put(blockString, new BlockTypeID(Integer.parseInt(block[0]), Byte.parseByte(block[1])));
if(blockString.contains("[")) 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; return ids;
} }

Datei anzeigen

@ -149,8 +149,8 @@ class Schematic_8 {
int id; int id;
BaseBlock state; BaseBlock state;
for(Iterator iterator = paletteObject.keySet().iterator(); iterator.hasNext(); palette.put(id, state)) { for(Iterator<String> iterator = paletteObject.keySet().iterator(); iterator.hasNext(); palette.put(id, state)) {
String palettePart = (String)iterator.next(); String palettePart = iterator.next();
id = requireTag(paletteObject, palettePart, IntTag.class).getValue(); id = requireTag(paletteObject, palettePart, IntTag.class).getValue();
IDConverter.BlockTypeID blockID = ids.get(palettePart); IDConverter.BlockTypeID blockID = ids.get(palettePart);

Datei-Diff unterdrückt, da er zu groß ist Diff laden