From 3a8558a9e8516ff2d9d3c1b5c9f8500dacd0d83c Mon Sep 17 00:00:00 2001 From: JPG Date: Wed, 11 Oct 2017 11:29:04 +0200 Subject: [PATCH] update --- mods/creative/inventory.lua | 15 +++++++-------- mods/default/hud.lua | 7 +++++++ mods/player_api/init.lua | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mods/creative/inventory.lua b/mods/creative/inventory.lua index b8ce3a1..a85a9af 100644 --- a/mods/creative/inventory.lua +++ b/mods/creative/inventory.lua @@ -174,18 +174,17 @@ function creative.register_tab(name, title, items) else for item in pairs(fields) do if item:find(":") then if not is_mapmaker and not is_teacher and not sandbox then - if not sandbox then - minetest.chat_send_player(player_name, - minetest.colorize("#FF0000", - "ERROR: Privilege 'mapmaker' or 'teacher'" .. - " required to get this item")) - - elseif worldname == "coding_schools" or - worldname == "science_factory" then + if worldname == "coding_schools" or + worldname == "science_factory" then minetest.chat_send_player(player_name, minetest.colorize("#FF0000", "ERROR: You cannot use any other item " .. "on this map except the kidsbot")) + else + minetest.chat_send_player(player_name, + minetest.colorize("#FF0000", + "ERROR: Privilege 'mapmaker' or 'teacher'" .. + " required to get this item")) end return diff --git a/mods/default/hud.lua b/mods/default/hud.lua index 17d029f..142c0da 100644 --- a/mods/default/hud.lua +++ b/mods/default/hud.lua @@ -15,6 +15,13 @@ end minetest.register_on_joinplayer(function(player) minetest.after(0, add_text, player) + + local is_mapmaker = minetest.check_player_privs(player, "mapmaker") + local is_teacher = minetest.check_player_privs(player, "teacher") + + if is_teacher or is_mapmaker then + player:hud_set_hotbar_itemcount(16) + end end) minetest.register_globalstep(function(dtime) diff --git a/mods/player_api/init.lua b/mods/player_api/init.lua index 203f60e..e0b7ded 100644 --- a/mods/player_api/init.lua +++ b/mods/player_api/init.lua @@ -28,6 +28,6 @@ minetest.register_on_joinplayer(function(player) {x = 200, y = 219}, 30 ) - player:hud_set_hotbar_image("gui_hotbar.png") + --player:hud_set_hotbar_image("gui_hotbar.png") player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") end)