Improve TooManyItems a bit

This commit is contained in:
oilboi 2020-03-25 15:35:51 -04:00
parent 69ce46aa56
commit fd268e3835
2 changed files with 31 additions and 30 deletions

View File

@ -1,5 +1,5 @@
ALPHA STATE CHANGELOG
0.01
# ALPHA STATE CHANGELOG
## 0.01
- make a grass biome
- make trees
- make hand - mod another mod
@ -22,7 +22,7 @@ ALPHA STATE CHANGELOG
- torches with particle
- make a mob
- 0.02
## 0.02
- fix tools causing crash on pigs with no fleshy definition
- ladders - only placeable on walls
- eating animation - particles? - entity?
@ -35,7 +35,7 @@ ALPHA STATE CHANGELOG
- made saplings
0.03
## 0.03
- make grass spread
- water buckets
- buckets water farmland
@ -58,10 +58,13 @@ ALPHA STATE CHANGELOG
- redstone ore - drops 4,5 redstone dust, turns on when punched
- pressure plate, detects players (output max), detects items (output based on number of items)
- fix item size based on number of items in stack to fixed size
- add hoppers
IDEAS:
# IDEAS:
farming -
- add fertilizer (pig drops bone randomly)

View File

@ -2,39 +2,37 @@
--[[this is a recreation of an old minecraft mod]]--
--THIS IS EXTREMELY sloppy because it's a prototype
function create_craft_formspec(item)
local recipe = minetest.get_craft_recipe(item)
local output = ""
if recipe.method == "normal" then
output = "size[17.2,8.75]"
--recipe.width
--output = output.."item_image_button["..1+x..","..y..";1,1;"..data.name..";"..data.name..";]"
local sorted_recipe = {}
print(dump(recipe))
output = "size[17.2,8.75]"..
"background[-0.19,-0.25;9.41,9.49;gui_hb_bg.png]"..
"listcolors[#8b8a89;#c9c3c6;#3e3d3e;#000000;#FFFFFF]"..
"list[current_player;main;0,4.5;9,1;]".. --hot bar
"list[current_player;main;0,6;9,3;9]" --big part
local width = recipe.width
for index,item in ipairs(recipe.items) do
local y = index
local x = 1
local i = index
if i > width and i <= width*2 then
y = i - width
x = 2
elseif i > width*2 then
y = i - width*2
x = 3
local i = 1
local base_x = 0.75
local base_y = -0.5
for x = 1,width do
for y = 1,3 do
for index,item in pairs(recipe.items) do
if index == i then
if width > 1 then
output = output.."item_image_button["..base_x+y..","..base_y+x..";1,1;"..item..";"..item..";]"
else
output = output.."item_image_button["..base_x+x..","..base_y+y..";1,1;"..item..";"..item..";]"
end
end
end
--if sorted_recipe[i] then
--print("adding item")
print(dump(item),y,x)
output = output.."item_image_button["..y..","..x..";1,1;"..item..";"..item..";]"
--end
--i = i + 1
i = i + 1
end
end
end
return(output)
end