public static int DecodeResult(string result) { var strArray = result.Split(':'); return(Terrain.MakeBlockValue(BlocksManager.FindBlockByTypeName(strArray[0], true).BlockIndex, 0, strArray.Length >= 2 ? int.Parse(strArray[1], CultureInfo.InvariantCulture) : 0)); }
public static int DecodeResult(string result) { if (!string.IsNullOrEmpty(result)) { string[] array = result.Split(new char[] { ':' }, StringSplitOptions.None); Block block = BlocksManager.FindBlockByTypeName(array[0], throwIfNotFound: true); return(Terrain.MakeBlockValue(data: (array.Length >= 2) ? int.Parse(array[1], CultureInfo.InvariantCulture) : 0, contents: block.BlockIndex, light: 0)); } return(0); }
public static int DecodeResult(string result) { if (ItemBlock.IdTable.TryGetValue(result, out int value)) { return(value); } var array = result.Split(':'); return(Terrain.MakeBlockValue(BlocksManager.FindBlockByTypeName(array[0], true).BlockIndex, 0, array.Length >= 2 ? int.Parse(array[1], CultureInfo.InvariantCulture) : 0)); }