From 0800609a1ae05191cf533664be303da909b8ae2f Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Fri, 11 Aug 2017 02:24:43 -0400 Subject: [PATCH] build using command computer --- sys/apis/blocks.lua | 18 +++++++++--------- sys/apps/builder.lua | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/apis/blocks.lua b/sys/apis/blocks.lua index b78ebbe..3b0d03c 100644 --- a/sys/apis/blocks.lua +++ b/sys/apis/blocks.lua @@ -769,14 +769,14 @@ function blockTypeDB:seedDB() { '+12', nil, nil }, }) blockTypeDB:addTemp('door', { - { 0, nil, 0, 'east-door', { door = true } }, - { 1, nil, 0, 'south-door', { door = true } }, - { 2, nil, 0, 'west-door', { door = true } }, - { 3, nil, 0, 'north-door', { door = true } }, - { 4, nil, 0, 'east-door', { door = true } }, - { 5, nil, 0, 'south-door', { door = true } }, - { 6, nil, 0, 'west-door', { door = true } }, - { 7, nil, 0, 'north-door', { door = true } }, + { 0, nil, 0, 'east-door' }, + { 1, nil, 0, 'south-door' }, + { 2, nil, 0, 'west-door' }, + { 3, nil, 0, 'north-door' }, + { 4, nil, 0, 'east-door' }, + { 5, nil, 0, 'south-door' }, + { 6, nil, 0, 'west-door' }, + { 7, nil, 0, 'north-door' }, { 8,'minecraft:air', 0 }, { 9,'minecraft:air', 0 }, { 10,'minecraft:air', 0 }, @@ -819,7 +819,7 @@ function Blocks:init(args) end -- for an ID / dmg (with placement info) - return the correct block (without the placment info embedded in the dmg) -function Blocks:getRealBlock(id, dmg) +function Blocks:getPlaceableBlock(id, dmg) local p = placementDB:get({id, dmg}) if p then diff --git a/sys/apps/builder.lua b/sys/apps/builder.lua index 1bf7253..3374df2 100644 --- a/sys/apps/builder.lua +++ b/sys/apps/builder.lua @@ -373,7 +373,7 @@ function Builder:substituteBlocks(throttle) b.dmg = pb.dmg b.direction = pb.direction b.extra = pb.extra - b.odmg = pb.odmg + b.odmg = pb.odmg or pb.dmg local sub = subDB:get({ b.id, b.dmg }) if sub then @@ -1220,9 +1220,9 @@ function Builder:build() placeBlock(id, b.odmg, b.x, b.y, b.z) - if b.extra and b.extra.door then - local _, doorTop = schematic:findIndexAt(b.x, b.z, b.y + 1, true) - placeBlock(id, doorTop.odmg, b.x, b.y + 1, b.z) + if b.twoHigh then + local _, topBlock = schematic:findIndexAt(b.x, b.z, b.y + 1, true) + placeBlock(id, topBlock.odmg, b.x, b.y + 1, b.z) end elseif self.mode == 'destroy' then