Posted 13 July 2012 - 07:31 AM
I'm fairly sure there isn't at this point.
I wanted to implement a program so that when a block is mined, it will send the item id to the home computer via rednet (i changed the config so i have huge range) and updates the block mined on the monitor. Fairly simple coding for the messages, but if we could detect specific blocks, how would i implement the translation from ID to name? using arrays?
I noticed that in the MagicTurtle code they had this in the beginnning:
So i couldn't figure out what this is used for. Is it for cross referencing item ids with names?
In summary:
Can I detect specific blocks?
If so:
Can I translate item ID's to names without making like 20 variables for all the ores? (i'm using tekkit)
If so:
Would it be productive to use arrays for this?
If so:
How?
I wanted to implement a program so that when a block is mined, it will send the item id to the home computer via rednet (i changed the config so i have huge range) and updates the block mined on the monitor. Fairly simple coding for the messages, but if we could detect specific blocks, how would i implement the translation from ID to name? using arrays?
I noticed that in the MagicTurtle code they had this in the beginnning:
local blockIDs = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129}
local blockNames = {"air","stone","grass","dirt","cobblestone","planks","sapling","bedrock","water","stationary water","lava","stationary lava","sand","gravel","gold ore","iron ore","coal ore","log","leaves","sponge","glass","lapis lazuli ore","lapis lazuli block","dispenser","sandstone","note block","bed","powered rail","detector rail","sticky piston","cobweb","tall grass","dead bush","piston","piston extension","wool","block moved by piston","dandelion","rose","brown mushroom","red mushroom","gold block","iron block","double slab","slab","bricks","tnt","bookshelf","moss stone","obsidian","torch","fire","monster spawner","wooden stairs","chest","redstone wire","diamond ore","diamond block","crafting table","wheat seeds","farmland","furnace","burning furnace","sign post","wooden door","ladder","rails","cobblestone stairs","wall sign","lever","stone pressure plate","iron door","wooden pressure plate","redstone ore","glowing redstone ore","redstone torch off","redstone torch","button","flat snow","ice","snow block","cactus","clay","sugar cane","jukebox","fence","pumpkin","netherrack","soulsand","glowstone","portal","jack-o-lantern","cake","repeater off","repeater on","locked chest","trapdoor","silverfish","stone bricks","huge brown mushroom","huge red mushroom","iron bars","glass pane","melon","pumpkin stem","melon stem","vines","fence gate","brick stairs","stone brick stairs","mycelium","lily pad","nether brick","nether brick fence","nether brick stairs","nether wart","enchantment table","brewing stand","cauldron","end portal","end portal frame","end stone","dragon egg","redstone lamp","redstone lamp on","unknown block","unmapped block","computer","disk drive","monitor"}
air,stone,grass,dirt,cobblestone,cobble,planks,woodenplanks,sapling,bedrock,water,stationarywater,lava,stationarylava,sand,gravel,goldore,ironore,coalore,log,wood,leaves,leaf,sponge,glass,lapislazuliore,lapislazuliblock,dispenser,sandstone,noteblock,bed,poweredrail,detectorrail,stickypiston,cobweb,tallgrass,deadbush,piston,pistonextension,wool,blockmovedbypiston,dandelion,yellowflower,flower,rose,brownmushroom,redmushroom,goldblock,gold,ironblock,iron,doubleslab,slab,step,halfslab,halfstep,brick,bricks,tnt,bookshelf,mossstone,moss,obsidian,torch,fire,mobspawner,monsterspawner,woodenstairs,woodstairs,woodstair,chest,redstonewire,diamondore,diamond,diamondblock,craftingtable,craftingbench,workbench,worktable,wheatseeds,farmland,furnace,burningfurnace,signpost,woodendoor,wooddoor,woodoor,ladder,rails,cobblestonestairs,cobblestair,cobblestairs,wallsign,lever,stonepressureplate,irondoor,woodenpressureplate,redstoneore,glowingredstoneore,redstonetorchoff,redstonetorch,button,flatsnow,snow,ice,snowblock,cactus,clay,sugarcane,reeds,jukebox,fence,pumpkin,netherrack,soulsand,glowstone,portal,jackolantern,cake,repeateroff,repeateron,lockedchest,trapdoor,silverfish,stonebricks,smoothbricks,hugebrownmushroom,hugeredmushroom,ironbars,glasspane,melon,pumpkinstem,melonstem,vines,fencegate,brickstairs,stonebrickstairs,mycelium,lilypad,netherbrick,netherbrickfence,netherbrickstairs,netherwart,enchantmenttable,brewingstand,cauldron,endportal,endportalframe,endstone,dragonegg,redstonelamp,redstonelampon,unknown,unknownblock,unmapped,unmappedblock,computer,diskdrive,monitor = "air","stone","grass","dirt","cobblestone","cobblestone","planks","planks","sapling","bedrock","water","stationary water","lava","stationary lava","sand","gravel","gold ore","iron ore","coal ore","log","log","leaves","leaves","sponge","glass","lapis lazuli ore","lapis lazuli block","dispenser","sandstone","note block","bed","powered rail","detector rail","sticky piston","cobweb","tall grass","dead bush","piston","piston extension","wool","block moved by piston","dandelion","dandelion","dandelion","rose","brown mushroom","red mushroom","gold block","gold block","iron block","iron block","double slab","slab","slab","slab","slab","bricks","bricks","tnt","bookshelf","moss stone","moss stone","obsidian","torch","fire","monster spawner","monster spawner","wooden stairs","wooden stairs","wooden stairs","chest","redstone wire","diamond ore","diamond block","diamond block","crafting table","crafting table","crafting table","crafting table","wheat seeds","farmland","furnace","burning furnace","sign post","wooden door","wooden door","wooden door","ladder","rails","cobblestone stairs","cobblestone stairs","cobblestone stairs","wall sign","lever","stone pressure plate","iron door","wooden pressure plate","redstone ore","glowing redstone ore","redstone torch off","redstone torch","button","flat snow","flat snow","ice","snow block","cactus","clay","sugar cane","sugar cane","jukebox","fence","pumpkin","netherrack","soulsand","glowstone","portal","jack-o-lantern","cake","repeater off","repeater on","locked chest","trapdoor","silverfish","stone bricks","stone bricks","huge brown mushroom","huge red mushroom","iron bars","glass pane","melon","pumpkin stem","melon stem","vines","fence gate","brick stairs","stone brick stairs","mycelium","lily pad","nether brick","nether brick fence","nether brick stairs","nether wart","enchantment table","brewing stand","cauldron","end portal","end portal frame","end stone","dragon egg","redstone lamp","redstone lamp on","unknown block","unknown block","unmapped block","unmapped block","computer","disk drive","monitor"
So i couldn't figure out what this is used for. Is it for cross referencing item ids with names?
In summary:
Can I detect specific blocks?
If so:
Can I translate item ID's to names without making like 20 variables for all the ores? (i'm using tekkit)
If so:
Would it be productive to use arrays for this?
If so:
How?