This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KingofGamesYami's profile picture

Include x, y, z coordinates in getBlockInfos

Started by KingofGamesYami, 03 June 2016 - 07:28 PM
KingofGamesYami #1
Posted 03 June 2016 - 09:28 PM
I've been trying to use the data returned by getBlockInfos, and it occurred to me that it would be much easier if the coordinates were added to the the individual tables.

Instead of something like this:
Spoiler

{
  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },
  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:stone",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },
}

We'd get something like this:

Spoiler

{
  {
     coords = {45, 62, 50}, --#I am too lazy to write coordinates for all of the other ones.
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },
  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {}
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:stone",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },  {
     state = {},
     name = "minecraft:air",
     metadata = 0,
   },
}
Sebra #2
Posted 04 June 2016 - 06:19 AM
… #I am too lazy …
;)/>
Edited on 04 June 2016 - 04:19 AM