From ceaf8edaded4c9e8f2e6fa285d9765e7095df332 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sun, 4 Dec 2011 03:28:30 +0100 Subject: Use plain IBillboardSceneNode instead of MyBillboardSceneNode (improves Irrlicht 1.8 compat); also find dungeon master's fireball texture again; add /spawnentity command --- data/mods/default/init.lua | 22 ++++++++++++++++++++++ data/mods/default/textures/default_fireball.png | Bin 603 -> 0 bytes data/mods/legacy/textures/fireball.png | Bin 0 -> 603 bytes 3 files changed, 22 insertions(+) delete mode 100644 data/mods/default/textures/default_fireball.png create mode 100644 data/mods/legacy/textures/fireball.png (limited to 'data') diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua index a843063ef..7f0614e20 100644 --- a/data/mods/default/init.lua +++ b/data/mods/default/init.lua @@ -1472,6 +1472,28 @@ minetest.register_on_chat_message(function(name, message) end return true -- Handled chat message end + local cmd = "/spawnentity" + if message:sub(0, #cmd) == cmd then + if not minetest.get_player_privs(name)["give"] then + minetest.chat_send_player(name, "you don't have permission to spawn (give)") + return true -- Handled chat message + end + local entityname = string.match(message, cmd.." (.*)") + if entityname == nil then + minetest.chat_send_player(name, 'usage: '..cmd..' entityname') + return true -- Handled chat message + end + print(cmd..' invoked, entityname="'..entityname..'"') + local player = minetest.env:get_player_by_name(name) + if player == nil then + print("Unable to spawn entity, player is nil") + return true -- Handled chat message + end + minetest.env:add_luaentity(player:getpos(), entityname) + minetest.chat_send_player(name, '"'..entityname + ..'" spawned.'); + return true -- Handled chat message + end end) -- diff --git a/data/mods/default/textures/default_fireball.png b/data/mods/default/textures/default_fireball.png deleted file mode 100644 index 523142850..000000000 Binary files a/data/mods/default/textures/default_fireball.png and /dev/null differ diff --git a/data/mods/legacy/textures/fireball.png b/data/mods/legacy/textures/fireball.png new file mode 100644 index 000000000..523142850 Binary files /dev/null and b/data/mods/legacy/textures/fireball.png differ -- cgit v1.2.3