Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DIRT = "minecraft:dirt"
- COBBLE = "minecraft:cobblestone"
- GLOWSTONE = "minecraft:glowstone"
- local function place(block, direction)
- local currentDetail = turtle.getItemDetail()
- if not currentDetail or currentDetail.name ~= block then
- while true do
- local didFind = false
- for i = 1, 16 do
- local nextDetail = turtle.getItemDetail(i)
- if nextDetail and nextDetail.name == block then
- didFind = true
- turtle.select(i)
- break
- end
- end
- if didFind then
- break
- else
- print("Need more " .. block)
- print("Press any key...")
- os.pullEvent("key")
- end
- end
- end
- turtle.placeDown()
- end
- local doPlace = function(isWater, z)
- place(isWater and (z % 7 == 4 and GLOWSTONE or COBBLE) or DIRT)
- end
- local X_LIMIT, Y_LIMIT, Z_LIMIT = 14, 12, 33
- for y = 1, Y_LIMIT do
- for x = 1, X_LIMIT do
- local isWater = x == 4 or x == 11
- if isWater then
- turtle.down()
- end
- for z = 1, Z_LIMIT do
- doPlace(isWater, z)
- turtle.forward()
- end
- if x ~= X_LIMIT then
- local turn = (x % 2 ~= y % 2) and turtle.turnLeft or turtle.turnRight
- turn()
- doPlace(isWater, 1)
- turtle.forward()
- turn()
- if isWater then
- turtle.up()
- end
- else
- if isWater then
- turtle.up()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- place(isWater and COBBLE or DIRT)
- turtle.up()
- turtle.up()
- turtle.up()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement