diff --git a/README.md b/README.md index c4bdd00..0bc3db8 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,9 @@ -# Commander -Chat commands Gui for Minetest - -Mahmut Elmas - -License WTFPL - -Minecraft Aliases License CC0 1.0 Universal +Commander Mod for minetest by Mahmut Elmas -This mod provides Guid for all commands added to minetest by default or mods. - -All possible commands will be shown in the gui. - -Some new commands also provided by the mod - - -1 -- Suicide command from minetest for fun server - -/Killme - - -2 -- Almost all default Minecraft commands by Mrlbby's Commands mod - -3 -- The commands gui with the help of Rui - -4 -- Commander tool to use in game +License = MIT +Dependecies = Default +This mod adds a tool to run command by gui. + + \ No newline at end of file diff --git a/commands.lua b/commands.lua deleted file mode 100644 index eff4a97..0000000 --- a/commands.lua +++ /dev/null @@ -1,47 +0,0 @@ --- Suicide from minetest for fun server - -minetest.register_chatcommand("killme", { - params = "", - description = "Kills yourself", - func = function(name, param) - local player = minetest.get_player_by_name(name) - if not player then return end - player:set_hp(0) - if minetest.setting_getbool("enable_damage") == false then - minetest.chat_send_player(name, "[X] Damage is disabled on this server.") - else - minetest.chat_send_player(name, "[X] You suicided.") - end - end, -}) - --- List banned players - - minetest.register_chatcommand("banlist", { - description = "List bans", - privs = minetest.chatcommands["ban"].privs, - func = function(name) - return true, "Ban list: " .. core.get_ban_list() - end, - }) - - - - -- Aliases function - -local function register_chatcommand_alias(alias, cmd) - local def = minetest.chatcommands[cmd] - minetest.register_chatcommand(alias, def) -end - --- Minecraft commands for minetest - -register_chatcommand_alias("?", "help") -register_chatcommand_alias("list", "status") -register_chatcommand_alias("pardon", "unban") -register_chatcommand_alias("stop", "shutdown") -register_chatcommand_alias("tell", "msg") -register_chatcommand_alias("w", "msg") -register_chatcommand_alias("tp", "teleport") -register_chatcommand_alias("suicide", "killme") - diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..7f2b3e9 --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +default + diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..0bc3db8 --- /dev/null +++ b/description.txt @@ -0,0 +1,9 @@ +Commander Mod for minetest by Mahmut Elmas + + +License = MIT +Dependecies = Default + +This mod adds a tool to run command by gui. + + \ No newline at end of file diff --git a/init.lua b/init.lua index a9e4df4..808d42b 100644 --- a/init.lua +++ b/init.lua @@ -44,12 +44,13 @@ -- Open command gui by chat - minetest.register_chatcommand("command_gui", { + minetest.register_chatcommand("commander", { func = function(name) minetest.after(0.5, minetest.show_formspec, name, "command_gui:menu", formspec()) end }) + minetest.register_on_player_receive_fields(function(player, formname, fields) if formname ~= "command_gui:menu" then return @@ -80,6 +81,26 @@ end end) +------ +-- Commander Tool -dofile(minetest.get_modpath("commander").."/commands.lua") \ No newline at end of file +-- items +minetest.register_craftitem("commander:commander", { + description = "Commander", + inventory_image = "commander.png", + on_use = function(itemstack, user, pointed_thing) + local name = user:get_player_name() + minetest.after(0.5, minetest.show_formspec, name, "command_gui:menu", formspec()) + + end, +}) + + +-- recipes +minetest.register_craft({ + output = "commander:commander", + recipe = { + {"vessels:glass_fragments", "default:iron_lump", ""} + } +}) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..eebbf35 --- /dev/null +++ b/mod.conf @@ -0,0 +1 @@ +name = commander diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..25cb802 Binary files /dev/null and b/screenshot.png differ diff --git a/screenshot2.png b/screenshot2.png new file mode 100644 index 0000000..92cbabc Binary files /dev/null and b/screenshot2.png differ diff --git a/textures/commander.png b/textures/commander.png new file mode 100644 index 0000000..6c69473 Binary files /dev/null and b/textures/commander.png differ