now that GameRegistry#findBlock() is deprecated what is the best way to get a block by its modid and name?
public static void addStructure(String file) {
JSONParser parser = new JSONParser();
try {
Object json = parser.parse(new FileReader(file));
JSONObject jsonObject = (JSONObject) json;
String name = (String) jsonObject.get("Name");
String village = (String) jsonObject.get("Village");
Map<Integer,Block> legend = new HashMap<Integer,Block>();
JSONArray Legend = (JSONArray) jsonObject.get("Legend");
//Iterator<String> iterator = Legend.iterator();
int i = 1;
Legend.forEach( (a)-> {
String b;
b = a.toString();
String[] bl = b.split(":");
//legend.put(i);
String modid = bl[0];
String block = bl[1];
System.out.println(block + modid);
Block bk = GameRegistry.findBlock(modid, block);
System.out.println(bk);
//i =+ 1;
});
System.out.println("Loading Structure: " + name);
//worldObject newWorldObject = new worldObject(name, village,);
}catch (Exception e){
e.printStackTrace();
}