View difference between Paste ID: bQJ0m077 and iLxujriW
SHOW: | | - or go back to the newest paste.
1
function getItemName()
2
	local arr = {"minecraft:dirt", "minecraft:grass"}
3
	local item = turtle.getItemDetail()
4
	if item then
5-
		if item.name == arr[1] or arr[2] then
5+
		if item.name == arr[1] or item.name == arr[2] then
6
		return "blockOfDirt"	    
7
		else
8
  		return item.name
9
		end
10
	else
11
	  print("Error!")
12
	end
13
end
14
15
function getDownBlockName()
16
	local arr = {"minecraft:dirt", "minecraft:grass"}
17
	local success, block = turtle.inspectDown()
18
	if success then
19-
		if block.name == arr[1] or arr[2] then
19+
		if block.name == arr[1] or block.name == arr[2] then
20
			return "blockOfDirt"
21
		else
22-
			return item.name
22+
			return block.name
23
		end
24
	else
25
		print("Error!")
26
	end
27
end