illuna_aestival: include wiki branding
parent
a342653496
commit
cd94ee57ee
|
@ -267,3 +267,56 @@ minetest.override_item("nether_mobs:dragon_scale_block", {
|
|||
end
|
||||
})
|
||||
|
||||
illuna = {}
|
||||
|
||||
function illuna.wikiconstruct(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
minetest.add_entity({x=pos.x, y=pos.y+0.96, z=pos.z}, "illuna:wikitop")
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(5.0)
|
||||
end
|
||||
|
||||
function illuna.wikidestruct(pos)
|
||||
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0.96)) do
|
||||
if obj and obj:get_luaentity() and
|
||||
obj:get_luaentity().name == "illuna:wikitop" then
|
||||
obj:remove()
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.override_item("wiki:wiki", {
|
||||
tiles= {
|
||||
"illuna_wiki_top.png",
|
||||
"illuna_wiki_bottom.png",
|
||||
"illuna_wiki_side.png",
|
||||
"illuna_wiki_side.png",
|
||||
"illuna_wiki_side.png",
|
||||
"illuna_wiki_side.png",
|
||||
},
|
||||
on_construct = illuna.wikiconstruct,
|
||||
on_destruct = illuna.wikidestruct
|
||||
})
|
||||
|
||||
minetest.register_entity(":illuna:wikitop", {
|
||||
visual = "wielditem",
|
||||
visual_size = {x=0.4, y=0.4},
|
||||
collisionbox = {0},
|
||||
physical = false,
|
||||
automatic_rotate = math.pi * 0.15,
|
||||
nametag = "Illuna Wiki",
|
||||
nametag_color = "#6893c4",
|
||||
textures = {"illuna:wikitop"},
|
||||
on_activate = function(self)
|
||||
local pos = self.object:getpos()
|
||||
local pos_under = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
if minetest.get_node(pos_under).name ~= "wiki:wiki" then
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craftitem(":illuna:wikitop", {
|
||||
inventory_image = "illuna_wikitop.png",
|
||||
})
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 256 B |
Binary file not shown.
After Width: | Height: | Size: 436 B |
Binary file not shown.
After Width: | Height: | Size: 330 B |
Binary file not shown.
After Width: | Height: | Size: 186 B |
Loading…
Reference in New Issue