From fcc750a36a682d51c8a4b1cd2638e045a62d86f6 Mon Sep 17 00:00:00 2001 From: kepler155c Date: Wed, 27 Sep 2017 23:38:58 -0400 Subject: [PATCH] all block names + cleanup --- apis/blocks.lua | 13 - apps/recorder.lua | 5 +- apps/simpleMiner.lua | 40 ++- etc/blocks.json | 796 ++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 820 insertions(+), 34 deletions(-) diff --git a/apis/blocks.lua b/apis/blocks.lua index f99665f..377de7b 100644 --- a/apis/blocks.lua +++ b/apis/blocks.lua @@ -570,22 +570,9 @@ function Blocks:init(args) self.nameDB = nameDB blockDB:load() --- standardBlockDB:load() blockTypeDB:load() nameDB:load(self.dir, blockDB) --- placementDB:load(standardBlockDB, 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 -- for an ID / dmg (with placement info) - return the correct block (without the placment info embedded in the dmg) diff --git a/apps/recorder.lua b/apps/recorder.lua index b889475..d925302 100644 --- a/apps/recorder.lua +++ b/apps/recorder.lua @@ -91,8 +91,9 @@ end bbpack = loadAPI('http://pastebin.com/raw/PdrJjb5S', 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 myEvent = tostring({}) os.queueEvent(myEvent) diff --git a/apps/simpleMiner.lua b/apps/simpleMiner.lua index e9519ec..24a4566 100644 --- a/apps/simpleMiner.lua +++ b/apps/simpleMiner.lua @@ -28,16 +28,19 @@ local options = { local fortuneBlocks = { [ 'minecraft:redstone_ore' ] = true, - [ 'minecraft:lapis_ore' ] = true, - [ 'minecraft:coal_ore' ] = true, - [ 'minecraft:diamond_ore' ] = true, - [ 'minecraft:emerald_ore' ] = true, + [ 'minecraft:lapis_ore' ] = true, + [ 'minecraft:coal_ore' ] = true, + [ 'minecraft:diamond_ore' ] = true, + [ 'minecraft:emerald_ore' ] = true, } local MIN_FUEL = 7500 local LOW_FUEL = 1500 local MAX_FUEL = 100000 +local PROGRESS_FILE = 'usr/config/mining.progress' +local TRASH_FILE = 'usr/config/mining.trash' + if not term.isColor() then MAX_FUEL = 20000 end @@ -159,7 +162,7 @@ function nextChunk() mining.x = nc.x mining.z = nc.z - Util.writeTable('mining.progress', mining) + Util.writeTable(PROGRESS_FILE, mining) return true end @@ -177,7 +180,7 @@ function addTrash() end trash['minecraft:bucket:0'] = nil - Util.writeTable('mining.trash', trash) + Util.writeTable(TRASH_FILE, trash) end function log(text) @@ -195,7 +198,7 @@ function refuel() local oldStatus = turtle.status status('refueling') - if turtle.select'minecraft:coal:0') then + if turtle.select('minecraft:coal:0') then local qty = turtle.getItemCount() print('refueling ' .. qty) turtle.refuel(qty) @@ -236,7 +239,7 @@ end function safeGoto(x, z, y, h) 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') if turtle.abort then return false @@ -300,6 +303,7 @@ function normalChestUnload() end end end + turtle.condense() turtle.select(1) safeGoto(pt.x, pt.z, 0, pt.heading) @@ -315,6 +319,10 @@ function ejectTrash() turtle.eachFilledSlot(function(slot) 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 end @@ -565,17 +573,18 @@ unload = normalChestUnload mining.x = 0 mining.z = 0 mining.locations = getBoreLocations(0, 0) -trash = Util.readTable('mining.trash') +trash = Util.readTable(TRASH_FILE) if options.resume.value then - mining = Util.readTable('mining.progress') -elseif fs.exists('mining.progress') then - print('use -r to resume') + mining = Util.readTable(PROGRESS_FILE) +elseif fs.exists(PROGRESS_FILE) then + print('Use -r to resume') + print('Teminate or enter to continue') read() end 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() addTrash() end @@ -599,8 +608,6 @@ if options.fortunePick.value then trash['cctweaks:toolHost:0'] = nil end -_G._p = trash - local function main() repeat while #mining.locations > 0 do @@ -608,7 +615,7 @@ local function main() if not boreCommand() then return end - Util.writeTable('mining.progress', mining) + Util.writeTable(PROGRESS_FILE, mining) end until not nextChunk() end @@ -626,6 +633,7 @@ turtle.run(function() printError(m) end + turtle.abort = false safeGotoY(0) safeGoto(0, 0, 0, 0) unload() diff --git a/etc/blocks.json b/etc/blocks.json index 99b7ef3..f4f1ab9 100644 --- a/etc/blocks.json +++ b/etc/blocks.json @@ -1300,27 +1300,392 @@ "Structure Block (Data)"], "id": 255 }, - "string": { - "name": "String", - "id": 287 + "iron_shovel": { + "id": 256, + "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": { "name": ["Coal", "Charcoal"], "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": { "id": 295, "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": { "id": 323, "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": { "id": 331, "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": { "id": 351, "name": ["Ink Sack", @@ -1340,6 +1705,18 @@ "Orange Dye", "Bone Meal"] }, + "bone": { + "id": 352, + "name": "Bone" + }, + "sugar": { + "id": 353, + "name": "Sugar" + }, + "cake": { + "id": 354, + "name": "Cake" + }, "bed-block": { "id": 355, "name": "Bed", @@ -1350,6 +1727,142 @@ "name": "Redstone 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": { "id": 391, "name": "Carrot", @@ -1358,13 +1871,290 @@ "id": 392, "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": { "id": 404, "name": "Redstone 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": { "id": 425, "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" + }, }