SuperflatPreset implements Serializable { @SuppressWarnings("unchecked") public static SuperflatPreset fromMinecraft1_15_2(CompoundTag tag) { return new SuperflatPreset(getBiomeByMinecraftName(((StringTag) tag.getTag("biome")).getValue()), ((ListTag<CompoundTag>) tag.getTag("layers")).getValue().stream() .map(layerTag -> new Layer(((StringTag) layerTag.getTag("block")).getValue(), ((NumberTag) layerTag.getTag("height")).intValue())) .collect(toList()), ((CompoundTag) tag.getTag("structures")).getValue().values().stream() .collect(toMap(structureTag -> Structure.valueOf(structureTag.getName().toUpperCase()), structureTag -> ((CompoundTag) structureTag).getValue().entrySet().stream().collect(toMap(Entry::getKey, paramEntry -> ((StringTag) paramEntry.getValue()).getValue())))) ); } SuperflatPreset(int biome, List<Layer> layers, Map<Structure, Map<String, String>> structures); int getBiome(); void setBiome(int biome); List<Layer> getLayers(); void setLayers(List<Layer> layers); Map<Structure, Map<String, String>> getStructures(); void setStructures(Map<Structure, Map<String, String>> structures); String toMinecraft1_12_2(); CompoundTag toMinecraft1_15_2(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static SuperflatPreset fromMinecraft1_12_2(String str); @SuppressWarnings("unchecked") // Guaranteed by Minecraft static SuperflatPreset fromMinecraft1_15_2(CompoundTag tag); static Builder builder(int biome, Structure... structures);  }
@Ignore @Test public void testFromMinecraft1_15_2() { }