CaKeSs wrote:Time clock =D
It shows the time, like it's time 6000(morning) then it shows like /
---Potion Flask mod
---By Michael<JusticeV; CaKeSs> <creslic_123@yahoo.com>
---
---furnace
local flask_inactive_formspec =
"invsize[8,9;]"..
"image[2,2;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;3,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]"
minetest.register_node("alchemy:flask", {
description = "Flask",
tiles = {"flask_top.png", "flask_bottom.png", "flask_side.png",
"flask_side.png", "flask_side.png", "flask_front.png"},
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", flask_inactive_formspec)
meta:set_string("infotext", "Flask")
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 3)
inv:set_size("dst", 4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
elseif not inv:is_empty("dst") then
return false
elseif not inv:is_empty("src") then
return false
end
return true
end,
})
minetest.register_node("alchemy:flask_active", {
description = "Flask",
tiles = {"flask_top.png", "flask_bottom.png", "flask_side.png",
"flask_side.png", "flask_side.png", "flask_front.png"},
paramtype2 = "facedir",
light_source = 8,
drop = "alchemy:flask",
groups = {cracky=2, not_in_creative_inventory=1},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", flask_inactive_formspec)
meta:set_string("infotext", "Flask");
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 3)
inv:set_size("dst", 4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
elseif not inv:is_empty("dst") then
return false
elseif not inv:is_empty("src") then
return false
end
return true
end,
})
function hacky_swap_node(pos,name)
local node = minetest.env:get_node(pos)
local meta = minetest.env:get_meta(pos)
local meta0 = meta:to_table()
if node.name == name then
return
end
node.name = name
local meta0 = meta:to_table()
minetest.env:set_node(pos,node)
meta = minetest.env:get_meta(pos)
meta:from_table(meta0)
end
minetest.register_abm({
nodenames = {"alchemy:flask","alchemy:flask_active"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local meta = minetest.env:get_meta(pos)
for i, name in ipairs({
"fuel_totaltime",
"fuel_time",
"src_totaltime",
"src_time"
}) do
if meta:get_string(name) == "" then
meta:set_float(name, 0.0)
end
end
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local Alchemized = nil
if srclist then
Alchemized = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
local was_active = false
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
meta:set_float("src_time", meta:get_float("src_time") + 1)
if Alchemized and Alchemized.item and meta:get_float("src_time") >= Alchemized.time then
-- check if there's room for output in "dst" list
if inv:room_for_item("dst",Alchemized.item) then
-- Put result in "dst" list
inv:add_item("dst", Alchemized.item)
-- take stuff from "src" list
srcstack = inv:get_stack("src", 1)
srcstack:take_item()
inv:set_stack("src", 1, srcstack)
else
--print("Could not insert '"..Alchemized.item.."'")
end
meta:set_string("src_time", 0)
end
end
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext","Alchemy active: "..percent.."%")
hacky_swap_node(pos,"alchemy:flask")
meta:set_string("formspec",
"invsize[8,9;]"..
"image[2,2;1,1;alchemycraft1.png^[lowpart:"..
(100-percent)..":alchemycraft.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]")
return
end
local fuel = nil
local Alchemized = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")
if srclist then
Alchemized = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
if fuellist then
fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
end
if fuel.time <= 0 then
meta:set_string("infotext","Alchemy is out of power")
hacky_swap_node(pos,"alchemy:flask")
meta:set_string("formspec", oven_inactive_formspec)
return
end
if cooked.item:is_empty() then
if was_active then
meta:set_string("infotext","Flask is empty")
hacky_swap_node(pos,"alchemy:flask")
meta:set_string("formspec", flask_inactive_formspec)
end
return
end
meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0)
local stack = inv:get_stack("fuel", 1)
stack:take_item()
inv:set_stack("fuel", 1, stack)
end,
})
---Items
minetest.register_craftitem("alchemy:apple_juice", {
description = "Apple juice",
inventory_image = "full_bottle.png",
on_use = minetest.item_eat(3.5),
})
minetest.register_craftitem("alchemy:potion", {
description = "Health potion",
inventory_image = "full_bottle.png",
on_use = minetest.item_eat(7),
})
minetest.register_craftitem("alchemy:empty_bottle", {
description = "Empty bottle",
inventory_image = "empty_bottle.png",
})
---Craft
minetest.register_craft({
output = 'alchemy:empty_bottle',
recipe = {
{'', '', ''},
{'', 'default:glass', ''},
{'', 'default:glass', ''},
}
})
minetest.register_craft({
output = 'alchemy:flask',
recipe = {
{'default:cobble', 'default:cobble', 'default:cobble'},
{'default:cobble', 'default:wood', 'default:cobble'},
{'default:cobble', 'default:cobble', 'default:cobble'},
}
})
---Alchemy recipes
minetest.register_craft({
type = "cooking",
output = "alchemy:potion",
recipe = "alchemy:empty_bottle","bucket:bucket_lava","default:stick"
})
minetest.register_craft({
type = "cooking",
output = "alchemy:apple_juice",
recipe = "alchemy:empty_bottle","bucket:bucket_water","default:apple"
})kaeza wrote:I don't know if this has already been suggested, but could we make an electrified fence?
Maybe two versions: one standalone, and one using mesecons.
cactuz_pl wrote:Or just hurt-blocks
cactuz_pl wrote:Achievements
Examples:
- Chop 200 tree blocks.
- Mine 10000 cobblestone.
- Eat 100 apples.
- Reach altitude: 100
- Reach altitude: 500
- Reach altitude: 1000
- Reach altitude: -100
- Reach altitude: -500
- Reach altitude: -1000
- Go 1000 km.
- Reach place where one of cords is higher than 1000.
- Craft 1000 tools.
- Craft 200 mese tools.
- Craft 100 books.
- Put 100000 blocks.
Any player could check their achievements (and achievements in progress) in game or in internet browser.
Existing example, Steam achievements:
Here
This is random profile, it doesn't belongs to me.
neko259 wrote:Node can hold text in its metadata. You can show text input dialogs AFAIK. So I assume someone can make a mailbox node that can accept messages from others and show them to its owner on use.
I could do that myself, but don't have time. Please somebody notify me if you're going to implement this :)
kylet115 wrote:you should make one with alot of decorative items like beds,sofas,tvs,tables, and alot of stuff in that nature.
aldobr wrote:Neon lights
Three superglow glass horizontally => Neon tube
On a 8x8 table, form letters by placing neon tubes (I believe 8x8 is the minimium ammount of pixels able to represent each letter in roman alphabet).
Chinchow wrote:A book you can write in so you can leave longer messages or explain the rates of a shop.
mauvebic wrote:Cannibalism - kinda like super-lite farming - though youre harvesting and eating other players. Soylent Greentest :-)
Chinchow wrote:How about some one makes 3d entities with api and instead of having villages spawn (at first) we build a village with village and they spawn on it slowly.
Chinchow wrote:They wouldnt in my idea unless a modder could think of a way but that would be interesting wouldnt it? to find villagers a hundred blocks away from a village?
Josh wrote:What about solar lights, they are obviously possible (Because of solar panels in mesecons)
Users browsing this forum: No registered users and 2 guests