private static List<WorldGenFlatLayerInfo> a(int i, String s) { if (s != null && s.length() >= 1) { ArrayList arraylist = Lists.newArrayList(); String[] astring = s.split(","); int j = 0; String[] astring1 = astring; int k = astring.length; for (int l = 0; l < k; ++l) { String s1 = astring1[l]; WorldGenFlatLayerInfo worldgenflatlayerinfo = a(i, s1, j); if (worldgenflatlayerinfo == null) { return null; } arraylist.add(worldgenflatlayerinfo); j += worldgenflatlayerinfo.b(); } return arraylist; } else { return null; } }
public void d() { int i = 0; WorldGenFlatLayerInfo worldgenflatlayerinfo; for (Iterator iterator = this.layers.iterator(); iterator.hasNext(); i += worldgenflatlayerinfo.b()) { worldgenflatlayerinfo = (WorldGenFlatLayerInfo) iterator.next(); worldgenflatlayerinfo.b(i); } }
private static WorldGenFlatLayerInfo a(int i, String s, int j) { String[] astring = i >= 3 ? s.split("\\*", 2) : s.split("x", 2); int k = 1; int l = 0; if (astring.length == 2) { try { k = Integer.parseInt(astring[0]); if (j + k >= 256) { k = 256 - j; } if (k < 0) { k = 0; } } catch (Throwable throwable) { return null; } } Block block = null; try { String s1 = astring[astring.length - 1]; if (i < 3) { astring = s1.split(":", 2); if (astring.length > 1) { l = Integer.parseInt(astring[1]); } block = Block.getById(Integer.parseInt(astring[0])); } else { astring = s1.split(":", 3); block = astring.length > 1 ? Block.getByName(astring[0] + ":" + astring[1]) : null; if (block != null) { l = astring.length > 2 ? Integer.parseInt(astring[2]) : 0; } else { block = Block.getByName(astring[0]); if (block != null) { l = astring.length > 1 ? Integer.parseInt(astring[1]) : 0; } } if (block == null) { return null; } } if (block == Blocks.AIR) { l = 0; } if (l < 0 || l > 15) { l = 0; } } catch (Throwable throwable1) { return null; } WorldGenFlatLayerInfo worldgenflatlayerinfo = new WorldGenFlatLayerInfo(i, k, block, l); worldgenflatlayerinfo.b(j); return worldgenflatlayerinfo; }