mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
0bd2efcfc1
This merges the current state of the well-maintained and tested `torches` mod as I've maintained it for the last 6 months. This started out as a thorough cleanup of 3D torches by blockmen, where some of the initial code still remains. The models were redone entirely from scratch and have been extensively tested with dozens of animated textures converted with mcimport, and look a lot better than the original 3D Torches mod. The ceiling torch is retained and functional. The `wieldlight` addition that the torches mod has was removed, since it relies on wieldview to look decent. This can stay external mod code. I've opted to move the torch nodes to a separate file. It's not a lot of code but nodes.lua is already huge, and I wanted to retain the copyright header and some of the readme.txt notes, and this was the easiest way of doing it. This code passes "default:torch" to nodes with on_rightclick, fixing problems with itemframes. Essentially it has a more elaborate item_place() routine to make sure we're not passing the wall torch to nodes that may display it. The ceiling torch is a separate model and not the same as the floor model. That does mean that there are 3 models in this mod.
53 lines
1.6 KiB
Lua
53 lines
1.6 KiB
Lua
-- Minetest 0.4 mod: default
|
|
-- See README.txt for licensing and other information.
|
|
|
|
-- The API documentation in here was moved into game_api.txt
|
|
|
|
-- Definitions made by this mod that other mods can use too
|
|
default = {}
|
|
|
|
default.LIGHT_MAX = 14
|
|
|
|
-- GUI related stuff
|
|
default.gui_bg = "bgcolor[#080808BB;true]"
|
|
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
|
|
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
|
|
|
|
function default.get_hotbar_bg(x,y)
|
|
local out = ""
|
|
for i=0,7,1 do
|
|
out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]"
|
|
end
|
|
return out
|
|
end
|
|
|
|
default.gui_survival_form = "size[8,8.5]"..
|
|
default.gui_bg..
|
|
default.gui_bg_img..
|
|
default.gui_slots..
|
|
"list[current_player;main;0,4.25;8,1;]"..
|
|
"list[current_player;main;0,5.5;8,3;8]"..
|
|
"list[current_player;craft;1.75,0.5;3,3;]"..
|
|
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
|
|
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
|
"listring[current_player;main]"..
|
|
"listring[current_player;craft]"..
|
|
default.get_hotbar_bg(0,4.25)
|
|
|
|
-- Load files
|
|
local default_path = minetest.get_modpath("default")
|
|
|
|
dofile(default_path.."/functions.lua")
|
|
dofile(default_path.."/trees.lua")
|
|
dofile(default_path.."/nodes.lua")
|
|
dofile(default_path.."/furnace.lua")
|
|
dofile(default_path.."/torch.lua")
|
|
dofile(default_path.."/tools.lua")
|
|
dofile(default_path.."/item_entity.lua")
|
|
dofile(default_path.."/craftitems.lua")
|
|
dofile(default_path.."/crafting.lua")
|
|
dofile(default_path.."/mapgen.lua")
|
|
dofile(default_path.."/player.lua")
|
|
dofile(default_path.."/aliases.lua")
|
|
dofile(default_path.."/legacy.lua")
|