all block names + cleanup

This commit is contained in:
kepler155c
2017-09-27 23:38:58 -04:00
parent 613a76beb0
commit fcc750a36a
4 changed files with 820 additions and 34 deletions

View File

@@ -570,22 +570,9 @@ function Blocks:init(args)
self.nameDB = nameDB self.nameDB = nameDB
blockDB:load() blockDB:load()
-- standardBlockDB:load()
blockTypeDB:load() blockTypeDB:load()
nameDB:load(self.dir, blockDB) nameDB:load(self.dir, blockDB)
-- placementDB:load(standardBlockDB, blockTypeDB)
placementDB:load2(blockDB, blockTypeDB) placementDB:load2(blockDB, blockTypeDB)
-- _G._b = blockDB
-- _G._s = standardBlockDB
-- _G._bt = blockTypeDB
-- _G._p = placementDB
-- Util.writeTable('pb1.lua', placementDB.data)
-- placementDB.data = { }
-- Util.writeTable('pb2.lua', placementDB.data)
end end
-- for an ID / dmg (with placement info) - return the correct block (without the placment info embedded in the dmg) -- for an ID / dmg (with placement info) - return the correct block (without the placment info embedded in the dmg)

View File

@@ -91,8 +91,9 @@ end
bbpack = loadAPI('http://pastebin.com/raw/PdrJjb5S', getfenv(1)) bbpack = loadAPI('http://pastebin.com/raw/PdrJjb5S', getfenv(1))
GIF = loadAPI('http://pastebin.com/raw/5uk9uRjC', getfenv(1)) GIF = loadAPI('http://pastebin.com/raw/5uk9uRjC', getfenv(1))
Util.runUrl(getfenv(1), 'http://pastebin.com/raw/cUYTGbpb', 'get', 'Y0eLUPtr') Util.runUrl(getfenv(1), 'http://pastebin.com/raw/cUYTGbpb', 'get', 'CnLzL5fg')
-- 'Y0eLUPtr')
-- CnLzL5fg
local function snooze() local function snooze()
local myEvent = tostring({}) local myEvent = tostring({})
os.queueEvent(myEvent) os.queueEvent(myEvent)

View File

@@ -28,16 +28,19 @@ local options = {
local fortuneBlocks = { local fortuneBlocks = {
[ 'minecraft:redstone_ore' ] = true, [ 'minecraft:redstone_ore' ] = true,
[ 'minecraft:lapis_ore' ] = true, [ 'minecraft:lapis_ore' ] = true,
[ 'minecraft:coal_ore' ] = true, [ 'minecraft:coal_ore' ] = true,
[ 'minecraft:diamond_ore' ] = true, [ 'minecraft:diamond_ore' ] = true,
[ 'minecraft:emerald_ore' ] = true, [ 'minecraft:emerald_ore' ] = true,
} }
local MIN_FUEL = 7500 local MIN_FUEL = 7500
local LOW_FUEL = 1500 local LOW_FUEL = 1500
local MAX_FUEL = 100000 local MAX_FUEL = 100000
local PROGRESS_FILE = 'usr/config/mining.progress'
local TRASH_FILE = 'usr/config/mining.trash'
if not term.isColor() then if not term.isColor() then
MAX_FUEL = 20000 MAX_FUEL = 20000
end end
@@ -159,7 +162,7 @@ function nextChunk()
mining.x = nc.x mining.x = nc.x
mining.z = nc.z mining.z = nc.z
Util.writeTable('mining.progress', mining) Util.writeTable(PROGRESS_FILE, mining)
return true return true
end end
@@ -177,7 +180,7 @@ function addTrash()
end end
trash['minecraft:bucket:0'] = nil trash['minecraft:bucket:0'] = nil
Util.writeTable('mining.trash', trash) Util.writeTable(TRASH_FILE, trash)
end end
function log(text) function log(text)
@@ -195,7 +198,7 @@ function refuel()
local oldStatus = turtle.status local oldStatus = turtle.status
status('refueling') status('refueling')
if turtle.select'minecraft:coal:0') then if turtle.select('minecraft:coal:0') then
local qty = turtle.getItemCount() local qty = turtle.getItemCount()
print('refueling ' .. qty) print('refueling ' .. qty)
turtle.refuel(qty) turtle.refuel(qty)
@@ -236,7 +239,7 @@ end
function safeGoto(x, z, y, h) function safeGoto(x, z, y, h)
local oldStatus = turtle.status local oldStatus = turtle.status
while not turtle.pathfind({ x = x, z = z, y = y, heading = h }) do while not turtle.pathfind({ x = x, z = z, y = y or turtle.point.y, heading = h }) do
--status('stuck') --status('stuck')
if turtle.abort then if turtle.abort then
return false return false
@@ -300,6 +303,7 @@ function normalChestUnload()
end end
end end
end end
turtle.condense()
turtle.select(1) turtle.select(1)
safeGoto(pt.x, pt.z, 0, pt.heading) safeGoto(pt.x, pt.z, 0, pt.heading)
@@ -315,6 +319,10 @@ function ejectTrash()
turtle.eachFilledSlot(function(slot) turtle.eachFilledSlot(function(slot)
if slot.iddmg == 'minecraft:cobblestone:0' then if slot.iddmg == 'minecraft:cobblestone:0' then
if cobbleSlotCount == 0 and slot.count > 36 then
turtle.select(slot.index)
turtle.dropDown(32)
end
cobbleSlotCount = cobbleSlotCount + 1 cobbleSlotCount = cobbleSlotCount + 1
end end
@@ -565,17 +573,18 @@ unload = normalChestUnload
mining.x = 0 mining.x = 0
mining.z = 0 mining.z = 0
mining.locations = getBoreLocations(0, 0) mining.locations = getBoreLocations(0, 0)
trash = Util.readTable('mining.trash') trash = Util.readTable(TRASH_FILE)
if options.resume.value then if options.resume.value then
mining = Util.readTable('mining.progress') mining = Util.readTable(PROGRESS_FILE)
elseif fs.exists('mining.progress') then elseif fs.exists(PROGRESS_FILE) then
print('use -r to resume') print('Use -r to resume')
print('Teminate or enter to continue')
read() read()
end end
if not trash or options.setTrash.value then if not trash or options.setTrash.value then
print('Add trash blocks, press enter when ready') print('Add blocks to ignore, press enter when ready')
read() read()
addTrash() addTrash()
end end
@@ -599,8 +608,6 @@ if options.fortunePick.value then
trash['cctweaks:toolHost:0'] = nil trash['cctweaks:toolHost:0'] = nil
end end
_G._p = trash
local function main() local function main()
repeat repeat
while #mining.locations > 0 do while #mining.locations > 0 do
@@ -608,7 +615,7 @@ local function main()
if not boreCommand() then if not boreCommand() then
return return
end end
Util.writeTable('mining.progress', mining) Util.writeTable(PROGRESS_FILE, mining)
end end
until not nextChunk() until not nextChunk()
end end
@@ -626,6 +633,7 @@ turtle.run(function()
printError(m) printError(m)
end end
turtle.abort = false
safeGotoY(0) safeGotoY(0)
safeGoto(0, 0, 0, 0) safeGoto(0, 0, 0, 0)
unload() unload()

View File

@@ -1300,27 +1300,392 @@
"Structure Block (Data)"], "Structure Block (Data)"],
"id": 255 "id": 255
}, },
"string": { "iron_shovel": {
"name": "String", "id": 256,
"id": 287 "name": "Iron Shovel"
},
"iron_pickaxe": {
"id": 257,
"name": "Iron Pickaxe"
},
"iron_axe": {
"id": 258,
"name": "Iron Axe"
},
"flint_and_steel": {
"id": 259,
"name": "Flint and Steel"
},
"apple": {
"id": 260,
"name": "Apple"
},
"bow": {
"id": 261,
"name": "Bow"
},
"arrow": {
"id": 262,
"name": "Arrow"
}, },
"coal": { "coal": {
"name": ["Coal", "name": ["Coal",
"Charcoal"], "Charcoal"],
"id": 263 "id": 263
}, },
"diamond": {
"id": 264,
"name": "Diamond"
},
"iron_ingot": {
"id": 265,
"name": "Iron Ingot"
},
"gold_ingot": {
"id": 266,
"name": "Gold Ingot"
},
"iron_sword": {
"id": 267,
"name": "Iron Sword"
},
"wooden_sword": {
"id": 268,
"name": "Wooden Sword"
},
"wooden_shovel": {
"id": 269,
"name": "Wooden Shovel"
},
"wooden_pickaxe": {
"id": 270,
"name": "Wooden Pickaxe"
},
"wooden_axe": {
"id": 271,
"name": "Wooden Axe"
},
"stone_sword": {
"id": 272,
"name": "Stone Sword"
},
"stone_shovel": {
"id": 273,
"name": "Stone Shovel"
},
"stone_pickaxe": {
"id": 274,
"name": "Stone Pickaxe"
},
"stone_axe": {
"id": 275,
"name": "Stone Axe"
},
"diamond_sword": {
"id": 276,
"name": "Diamond Sword"
},
"diamond_shovel": {
"id": 277,
"name": "Diamond Shovel"
},
"diamond_pickaxe": {
"id": 278,
"name": "Diamond Pickaxe"
},
"diamond_axe": {
"id": 279,
"name": "Diamond Axe"
},
"stick": {
"id": 280,
"name": "Stick"
},
"bowl": {
"id": 281,
"name": "Bowl"
},
"mushroom_stew": {
"id": 282,
"name": "Mushroom Stew"
},
"golden_sword": {
"id": 283,
"name": "Golden Sword"
},
"golden_shovel": {
"id": 284,
"name": "Golden Shovel"
},
"golden_pickaxe": {
"id": 285,
"name": "Golden Pickaxe"
},
"golden_axe": {
"id": 286,
"name": "Golden Axe"
},
"string": {
"id": 287,
"name": "String"
},
"feather": {
"id": 288,
"name": "Feather"
},
"gunpowder": {
"id": 289,
"name": "Gunpowder"
},
"wooden_hoe": {
"id": 290,
"name": "Wooden Hoe"
},
"stone_hoe": {
"id": 291,
"name": "Stone Hoe"
},
"iron_hoe": {
"id": 292,
"name": "Iron Hoe"
},
"diamond_hoe": {
"id": 293,
"name": "Diamond Hoe"
},
"golden_hoe": {
"id": 294,
"name": "Golden Hoe"
},
"wheat_seeds": { "wheat_seeds": {
"id": 295, "id": 295,
"name": "Wheat Seeds", "name": "Wheat Seeds",
}, },
"wheat": {
"id": 296,
"name": "Wheat"
},
"bread": {
"id": 297,
"name": "Bread"
},
"leather_helmet": {
"id": 298,
"name": "Leather Helmet"
},
"leather_chestplate": {
"id": 299,
"name": "Leather Tunic"
},
"leather_leggings": {
"id": 300,
"name": "Leather Pants"
},
"leather_boots": {
"id": 301,
"name": "Leather Boots"
},
"chainmail_helmet": {
"id": 302,
"name": "Chainmail Helmet"
},
"chainmail_chestplate": {
"id": 303,
"name": "Chainmail Chestplate"
},
"chainmail_leggings": {
"id": 304,
"name": "Chainmail Leggings"
},
"chainmail_boots": {
"id": 305,
"name": "Chainmail Boots"
},
"iron_helmet": {
"id": 306,
"name": "Iron Helmet"
},
"iron_chestplate": {
"id": 307,
"name": "Iron Chestplate"
},
"iron_leggings": {
"id": 308,
"name": "Iron Leggings"
},
"iron_boots": {
"id": 309,
"name": "Iron Boots"
},
"diamond_helmet": {
"id": 310,
"name": "Diamond Helmet"
},
"diamond_chestplate": {
"id": 311,
"name": "Diamond Chestplate"
},
"diamond_leggings": {
"id": 312,
"name": "Diamond Leggings"
},
"diamond_boots": {
"id": 313,
"name": "Diamond Boots"
},
"golden_helmet": {
"id": 314,
"name": "Golden Helmet"
},
"golden_chestplate": {
"id": 315,
"name": "Golden Chestplate"
},
"golden_leggings": {
"id": 316,
"name": "Golden Leggings"
},
"golden_boots": {
"id": 317,
"name": "Golden Boots"
},
"flint": {
"id": 318,
"name": "Flint"
},
"porkchop": {
"id": 319,
"name": "Raw Porkchop"
},
"cooked_porkchop": {
"id": 320,
"name": "Cooked Porkchop"
},
"painting": {
"id": 321,
"name": "Painting"
},
"golden_apple": {
"id": 322,
"name": ["Enchanted Golden Apple",
"Enchanted Golden Apple" ]
},
"sign": { "sign": {
"id": 323, "id": 323,
"name": "Sign", "name": "Sign",
}, },
"wooden_door": {
"id": 324,
"name": "Oak Door"
},
"bucket": {
"id": 325,
"name": "Bucket"
},
"water_bucket": {
"id": 326,
"name": "Water Bucket"
},
"lava_bucket": {
"id": 327,
"name": "Lava Bucket"
},
"minecart": {
"id": 328,
"name": "Minecart"
},
"saddle": {
"id": 329,
"name": "Saddle"
},
"iron_door": {
"id": 330,
"name": "Iron Door"
},
"redstone": { "redstone": {
"id": 331, "id": 331,
"name": "Redstone Dust", "name": "Redstone Dust",
}, },
"snowball": {
"id": 332,
"name": "Snowball"
},
"boat": {
"id": 333,
"name": "Oak Boat"
},
"leather": {
"id": 334,
"name": "Leather"
},
"milk_bucket": {
"id": 335,
"name": "Milk Bucket"
},
"brick": {
"id": 336,
"name": "Brick"
},
"clay_ball": {
"id": 337,
"name": "Clay"
},
"reeds": {
"id": 338,
"name": "Sugar Canes"
},
"paper": {
"id": 339,
"name": "Paper"
},
"book": {
"id": 340,
"name": "Book"
},
"slime_ball": {
"id": 341,
"name": "Slimeball"
},
"chest_minecart": {
"id": 342,
"name": "Minecart with Chest"
},
"furnace_minecart": {
"id": 343,
"name": "Minecart with Furnace"
},
"egg": {
"id": 344,
"name": "Egg"
},
"compass": {
"id": 345,
"name": "Compass"
},
"fishing_rod": {
"id": 346,
"name": "Fishing Rod"
},
"clock": {
"id": 347,
"name": "Clock"
},
"glowstone_dust": {
"id": 348,
"name": "Glowstone Dust"
},
"fish": {
"id": 349,
"name": ["Raw Fish",
"Raw Salmon",
"Clownfish",
"Pufferfish"]
},
"cooked_fish": {
"id": 350,
"name": ["Cooked Fish",
"Cooked Salmon"]
},
"dye": { "dye": {
"id": 351, "id": 351,
"name": ["Ink Sack", "name": ["Ink Sack",
@@ -1340,6 +1705,18 @@
"Orange Dye", "Orange Dye",
"Bone Meal"] "Bone Meal"]
}, },
"bone": {
"id": 352,
"name": "Bone"
},
"sugar": {
"id": 353,
"name": "Sugar"
},
"cake": {
"id": 354,
"name": "Cake"
},
"bed-block": { "bed-block": {
"id": 355, "id": 355,
"name": "Bed", "name": "Bed",
@@ -1350,6 +1727,142 @@
"name": "Redstone Repeater", "name": "Redstone Repeater",
"place": "repeater", "place": "repeater",
}, },
"cookie": {
"id": 357,
"name": "Cookie"
},
"filled_map": {
"id": 358,
"name": "Map"
},
"shears": {
"id": 359,
"name": "Shears"
},
"melon": {
"id": 360,
"name": "Melon"
},
"pumpkin_seeds": {
"id": 361,
"name": "Pumpkin Seeds"
},
"melon_seeds": {
"id": 362,
"name": "Melon Seeds"
},
"beef": {
"id": 363,
"name": "Raw Beef"
},
"cooked_beef": {
"id": 364,
"name": "Steak"
},
"chicken": {
"id": 365,
"name": "Raw Chicken"
},
"cooked_chicken": {
"id": 366,
"name": "Cooked Chicken"
},
"rotten_flesh": {
"id": 367,
"name": "Rotten Flesh"
},
"ender_pearl": {
"id": 368,
"name": "Ender Pearl"
},
"blaze_rod": {
"id": 369,
"name": "Blaze Rod"
},
"ghast_tear": {
"id": 370,
"name": "Ghast Tear"
},
"gold_nugget": {
"id": 371,
"name": "Gold Nugget"
},
"nether_wart": {
"id": 372,
"name": "Nether Wart"
},
"potion": {
"id": 373,
"name": "Potion"
},
"glass_bottle": {
"id": 374,
"name": "Glass Bottle"
},
"spider_eye": {
"id": 375,
"name": "Spider Eye"
},
"fermented_spider_eye": {
"id": 376,
"name": "Fermented Spider Eye"
},
"blaze_powder": {
"id": 377,
"name": "Blaze Powder"
},
"magma_cream": {
"id": 378,
"name": "Magma Cream"
},
"brewing_stand": {
"id": 379,
"name": "Brewing Stand"
},
"cauldron": {
"id": 380,
"name": "Cauldron"
},
"ender_eye": {
"id": 381,
"name": "Eye of Ender"
},
"speckled_melon": {
"id": 382,
"name": "Glistering Melon"
},
"spawn_egg": {
"id": 383,
"name": "Spawn Egg"
},
"experience_bottle": {
"id": 384,
"name": "Bottle o' Enchanting"
},
"fire_charge": {
"id": 385,
"name": "Fire Charge"
},
"writable_book": {
"id": 386,
"name": "Book and Quill"
},
"written_book": {
"id": 387,
"name": "Written Book"
},
"emerald": {
"id": 388,
"name": "Emerald"
},
"item_frame": {
"id": 389,
"name": "Item Frame"
},
"flower_pot": {
"id": 390,
"name": "Flower Pot"
},
"carrot": { "carrot": {
"id": 391, "id": 391,
"name": "Carrot", "name": "Carrot",
@@ -1358,13 +1871,290 @@
"id": 392, "id": 392,
"name": "Potato", "name": "Potato",
}, },
"baked_potato": {
"id": 393,
"name": "Baked Potato"
},
"poisonous_potato": {
"id": 394,
"name": "Poisonous Potato"
},
"map": {
"id": 395,
"name": "Empty Map"
},
"golden_carrot": {
"id": 396,
"name": "Golden Carrot"
},
"skull": {
"id": 397,
"name": ["Skeleton Skull",
"Wither Skeleton Skull",
"Zombie Head",
"Human Head",
"Creeper Head",
"Dragon Head"]
},
"carrot_on_a_stick": {
"id": 398,
"name": "Carrot on a Stick"
},
"nether_star": {
"id": 399,
"name": "Nether Star"
},
"pumpkin_pie": {
"id": 400,
"name": "Pumpkin Pie"
},
"fireworks": {
"id": 401,
"name": "Firework Rocket"
},
"firework_charge": {
"id": 402,
"name": "Firework Star"
},
"enchanted_book": {
"id": 403,
"name": "Enchanted Book"
},
"comparator": { "comparator": {
"id": 404, "id": 404,
"name": "Redstone Comparator", "name": "Redstone Comparator",
"place": "comparator", "place": "comparator",
}, },
"netherbrick": {
"id": 405,
"name": "Nether Brick"
},
"quartz": {
"id": 406,
"name": "Nether Quartz"
},
"tnt_minecart": {
"id": 407,
"name": "Minecart with TNT"
},
"hopper_minecart": {
"id": 408,
"name": "Minecart with Hopper"
},
"prismarine_shard": {
"id": 409,
"name": "Prismarine Shard"
},
"prismarine_crystals": {
"id": 410,
"name": "Prismarine Crystals"
},
"rabbit": {
"id": 411,
"name": "Raw Rabbit"
},
"cooked_rabbit": {
"id": 412,
"name": "Cooked Rabbit"
},
"rabbit_stew": {
"id": 413,
"name": "Rabbit Stew"
},
"rabbit_foot": {
"id": 414,
"name": "Rabbit's Foot"
},
"rabbit_hide": {
"id": 415,
"name": "Rabbit Hide"
},
"armor_stand": {
"id": 416,
"name": "Armor Stand"
},
"iron_horse_armor": {
"id": 417,
"name": "Iron Horse Armor"
},
"golden_horse_armor": {
"id": 418,
"name": "Golden Horse Armor"
},
"diamond_horse_armor": {
"id": 419,
"name": "Diamond Horse Armor"
},
"lead": {
"id": 420,
"name": "Lead"
},
"name_tag": {
"id": 421,
"name": "Name Tag"
},
"command_block_minecart": {
"id": 422,
"name": "Minecart with Command Block"
},
"mutton": {
"id": 423,
"name": "Raw Mutton"
},
"cooked_mutton": {
"id": 424,
"name": "Cooked Mutton"
},
"banner": { "banner": {
"id": 425, "id": 425,
"name": "Banner", "name": "Banner",
},
"spruce_door": {
"id": 427,
"name": "Spruce Door"
},
"birch_door": {
"id": 428,
"name": "Birch Door"
},
"jungle_door": {
"id": 429,
"name": "Jungle Door"
},
"acacia_door": {
"id": 430,
"name": "Acacia Door"
},
"dark_oak_door": {
"id": 431,
"name": "Dark Oak Door"
},
"chorus_fruit": {
"id": 432,
"name": "Chorus Fruit"
},
"popped_chorus_fruit": {
"id": 433,
"name": "Popped Chorus Fruit"
},
"beetroot": {
"id": 434,
"name": "Beetroot"
},
"beetroot_seeds": {
"id": 435,
"name": "Beetroot Seeds"
},
"beetroot_soup": {
"id": 436,
"name": "Beetroot Soup"
},
"dragon_breath": {
"id": 437,
"name": "Dragon's Breath"
},
"splash_potion": {
"id": 438,
"name": "Splash Potion"
},
"spectral_arrow": {
"id": 439,
"name": "Spectral Arrow"
},
"tipped_arrow": {
"id": 440,
"name": "Tipped Arrow"
},
"lingering_potion": {
"id": 441,
"name": "Lingering Potion"
},
"shield": {
"id": 442,
"name": "Shield"
},
"elytra": {
"id": 443,
"name": "Elytra"
},
"spruce_boat": {
"id": 444,
"name": "Spruce Boat"
},
"birch_boat": {
"id": 445,
"name": "Birch Boat"
},
"jungle_boat": {
"id": 446,
"name": "Jungle Boat"
},
"acacia_boat": {
"id": 447,
"name": "Acacia Boat"
},
"dark_oak_boat": {
"id": 448,
"name": "Dark Oak Boat"
},
"totem_of_undying": {
"id": 449,
"name": "Totem of Undying"
},
"shulker_shell": {
"id": 450,
"name": "Shulker Shell"
},
"iron_nugget": {
"id": 452,
"name": "Iron Nugget"
},
"record_13": {
"id": 2256,
"name": "13 Disc"
},
"record_cat": {
"id": 2257,
"name": "Cat Disc"
} }
"record_blocks": {
"id": 2258,
"name": "Blocks Disc"
},
"record_chirp": {
"id": 2259,
"name": "Chirp Disc"
},
"record_far": {
"id": 2260,
"name": "Far Disc"
},
"record_mall": {
"id": 2261,
"name": "Mall Disc"
},
"record_mellohi": {
"id": 2262,
"name": "Mellohi Disc"
},
"record_stal": {
"id": 2263,
"name": "Stal Disc"
},
"record_strad": {
"id": 2264,
"name": "Strad Disc"
},
"record_ward": {
"id": 2265,
"name": "Ward Disc"
},
"record_11": {
"id": 2266,
"name": "11 Disc"
},
"record_wait": {
"id": 2267,
"name": "Wait Disc"
},
} }