From 93b57256af4a6d5de49294bb145522a599d625fd Mon Sep 17 00:00:00 2001 From: BadToad2000 Date: Mon, 25 Jul 2016 14:36:38 -0500 Subject: [PATCH] Fix right-click on town plot markers. Additionally: - address some deprecated procedure calls. - ensure doors are not "group:wood" (only planks are used in crafting, and tidies crafting guide) --- mods/adventuretest/register_functions.lua | 8 -------- mods/boats/init.lua | 2 +- mods/cottages/nodes_furniture.lua | 6 +++--- mods/default/nodes.lua | 8 ++++---- mods/handle_schematics/init.lua | 10 +++++----- mods/magic/magicmissle.lua | 2 +- mods/mg_villages/map_of_world.lua | 2 +- mods/mg_villages/protection.lua | 23 ++++++++++++----------- mods/moreblocks/circular_saw.lua | 12 ++++++++---- mods/throwing/init.lua | 2 +- mods/ts_doors/init.lua | 6 +++--- mods/workbench/init.lua | 6 ++++-- 12 files changed, 43 insertions(+), 44 deletions(-) diff --git a/mods/adventuretest/register_functions.lua b/mods/adventuretest/register_functions.lua index 58b1ed6..a7109ae 100644 --- a/mods/adventuretest/register_functions.lua +++ b/mods/adventuretest/register_functions.lua @@ -75,14 +75,6 @@ local function adventuretest_dignode(pos, node, digger) -- ENERGY pd.increment(name,"energy",-0.05) - -- EXPERIENCE - if minetest.registered_nodes[node.name] ~= nil then - if minetest.registered_nodes[node.name]["skill"] ~= nil then - default.drop_item(pos,"experience:1_exp") - skills.add_exp(name,5) - end - end - pd.increment(name,STAT_DUG,1) local dug = pd.get(name,STAT_DUG) if dug % 100 == 0 then diff --git a/mods/boats/init.lua b/mods/boats/init.lua index a47c5a0..c5b063e 100644 --- a/mods/boats/init.lua +++ b/mods/boats/init.lua @@ -79,7 +79,7 @@ function boat.on_rightclick(self, clicker) minetest.after(0.2, function() default.player_set_animation(clicker, "sit" , 30) end) - self.object:setyaw(clicker:get_look_yaw() - math.pi / 2) + self.object:setyaw(clicker:get_look_horizontal() - math.pi / 2) end end diff --git a/mods/cottages/nodes_furniture.lua b/mods/cottages/nodes_furniture.lua index 6d39445..b56b038 100644 --- a/mods/cottages/nodes_furniture.lua +++ b/mods/cottages/nodes_furniture.lua @@ -9,7 +9,7 @@ -- * table - very simple one -- * shelf - for storing things; this one is 3d -- * stovepipe - so that the smoke from the furnace can get away --- * washing place - put it over a water source and you can 'wash' yourshelf +-- * washing place - put it over a water source and you can 'wash' yourself --------------------------------------------------------------------------------------- -- TODO: change the textures of the bed (make the clothing white, foot path not entirely covered with cloth) @@ -224,8 +224,8 @@ minetest.register_node("cottages:shelf", { meta:set_string("formspec", "size[8,8]".. "list[current_name;main;0,0;8,3;]".. - "list[current_player;main;0,4;8,4;]" - .."listring[current_name;main]".."listring[current_player;main]") + "list[current_player;main;0,4;8,4;]".. + "listring[current_name;main]".."listring[current_player;main]") meta:set_string("infotext", S("open storage shelf")) local inv = meta:get_inventory(); inv:set_size("main", 24); diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 40b0c2f..dbaf3b1 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -815,16 +815,16 @@ minetest.register_node("default:sign_wall", { default.chest_formspec = "size[8,9]".. "list[current_name;main;0,0;8,4;]".. - "list[current_player;main;0,5;8,4;]" - .."listring[current_name;main]".."listring[current_player;main]" + "list[current_player;main;0,5;8,4;]".. + "listring[]" function default.get_locked_chest_formspec(pos) local spos = pos.x .. "," .. pos.y .. "," ..pos.z local formspec = "size[8,9]".. "list[nodemeta:".. spos .. ";main;0,0;8,4;]".. - "list[current_player;main;0,5;8,4;]" - .."listring[[nodemeta:".. spos ..";main]".."listring[current_player;main]" + "list[current_player;main;0,5;8,4;]".. + "listring[]" return formspec end diff --git a/mods/handle_schematics/init.lua b/mods/handle_schematics/init.lua index a3b043a..a253a61 100644 --- a/mods/handle_schematics/init.lua +++ b/mods/handle_schematics/init.lua @@ -42,15 +42,15 @@ dofile(handle_schematics.modpath.."/replacements_get_table.lua") -- uses build_chest.* namespace -- a chest for spawning buildings manually ---dofile(handle_schematics.modpath.."/build_chest.lua") +dofile(handle_schematics.modpath.."/build_chest.lua") -- makes the replacements from replacements_group.* available to the build chest ---dofile(handle_schematics.modpath.."/build_chest_handle_replacements.lua"); +dofile(handle_schematics.modpath.."/build_chest_handle_replacements.lua"); -- creates 2d previews of the schematic from left/right/back/front/top ---dofile(handle_schematics.modpath.."/build_chest_preview_image.lua"); +dofile(handle_schematics.modpath.."/build_chest_preview_image.lua"); -- reads a file and adds the files listed there as menu entries ---dofile(handle_schematics.modpath.."/build_chest_add_schems_from_file.lua"); +dofile(handle_schematics.modpath.."/build_chest_add_schems_from_file.lua"); -- locate schematics through directories ---dofile(handle_schematics.modpath.."/build_chest_add_schems_by_directory.lua"); +dofile(handle_schematics.modpath.."/build_chest_add_schems_by_directory.lua"); -- the main functionality of the mod; -- provides the function handle_schematics.place_building_from_file diff --git a/mods/magic/magicmissle.lua b/mods/magic/magicmissle.lua index ff32464..19747e7 100644 --- a/mods/magic/magicmissle.lua +++ b/mods/magic/magicmissle.lua @@ -139,7 +139,7 @@ local magicmissle_spell = { local dir = user:get_look_dir() obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19}) obj:setacceleration({x=dir.x*-3, y=-1, z=dir.z*-3}) - obj:setyaw(user:get_look_yaw()+math.pi) + obj:setyaw(user:get_look_horizontal()+math.pi) obj:get_luaentity().player = user magic.update_magic(user,name) else diff --git a/mods/mg_villages/map_of_world.lua b/mods/mg_villages/map_of_world.lua index 7df3c40..0fe1d81 100644 --- a/mods/mg_villages/map_of_world.lua +++ b/mods/mg_villages/map_of_world.lua @@ -128,7 +128,7 @@ mg_villages.map_of_world = function( pname ) end -- code and arrows taken from mapp mod - local yaw = player:get_look_yaw() + local yaw = player:get_look_horizontal() local rotate = 0; if yaw ~= nil then -- Find rotation and texture based on yaw. diff --git a/mods/mg_villages/protection.lua b/mods/mg_villages/protection.lua index 6563a2c..4994f61 100644 --- a/mods/mg_villages/protection.lua +++ b/mods/mg_villages/protection.lua @@ -44,8 +44,8 @@ minetest.is_protected = function(pos, name) local is_houseowner = false; for nr, p in pairs( mg_villages.all_villages[ village_id ].to_add_data.bpos ) do - trustedusers = p.can_edit - trustedUser = false + local trustedusers = p.can_edit + local trustedUser = false if trustedusers ~= nil then for _,trusted in pairs(trustedusers) do if trusted == name then @@ -136,8 +136,10 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) return; end - local owner = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].owner; - local btype = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].btype; + local village = mg_villages.all_villages[ village_id ]; + local plot = village.to_add_data.bpos[ plot_nr ]; + -- local owner = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].owner; + local btype = plot.btype; local owner_name = plot.owner; if( not( owner_name ) or owner_name == "" ) then @@ -160,8 +162,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) -- create the header local formspec = "size[13,10]".. "label[3.3,0.0;Plot No.: "..tostring( plot_nr )..", with "..tostring( mg_villages.BUILDINGS[ plot.btype ].scm ).."]".. - "label[0.3,0.4;Located at:]" .."label[3.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..", which is "..tostring( distance ).." m away]" - .."label[7.3,0.4;from the village center]".. + "label[0.3,0.4;Located at:]" .."label[3.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..", which is "..tostring( distance ).."m from the village center]".. "label[0.3,0.8;Part of village:]" .."label[3.3,0.8;"..(village.name or "- name unknown -").."]" .."label[7.3,0.8;located at "..(village_pos).."]".. "label[0.3,1.2;Owned by:]" .."label[3.3,1.2;"..(owner_name).."]".. @@ -338,10 +339,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) local original_formspec = "size[8,3]".. "button[7.0,0.0;1.0,0.5;info;Info]".. "label[1.0,0.5;Plot No.: "..tostring( plot_nr ).."]".. - "label[2.5,0.5;Building:]".. - "label[3.5,0.5;"..tostring( mg_villages.BUILDINGS[btype].scm ).."]".. + "label[2.5,0.5;Building: "..tostring( mg_villages.BUILDINGS[btype].scm ).." ]".. "field[20,20;0.1,0.1;pos2str;Pos;"..minetest.pos_to_string( pos ).."]"; - local formspec = ""; + local formspec = ""; local ifinhabit = ""; -- Get Price @@ -368,8 +368,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player ) if (not(owner) or owner=='') then formspec = original_formspec .. - "label[1,1;You can buy this plot for]".. - "label[3.8,1;"..tostring( price_stack:get_count() ).." x ]".. + --"label[1,1;You can buy this plot for]".. + --"label[3.8,1;"..tostring( price_stack:get_count() ).." x ]".. + "label[1,1;You can buy this plot for "..tostring( price_stack:get_count() ).." x ]".. "item_image[4.3,0.8;1,1;"..( price_stack:get_name() ).."]".. ifinhabit.. "button[2,2.5;1.5,0.5;buy;Buy plot]".. diff --git a/mods/moreblocks/circular_saw.lua b/mods/moreblocks/circular_saw.lua index 1ac1dec..3ebfc17 100644 --- a/mods/moreblocks/circular_saw.lua +++ b/mods/moreblocks/circular_saw.lua @@ -321,10 +321,14 @@ function circular_saw.on_construct(pos) "button[1,3.2;1,1;Set;" ..S("Set").. "]" .. "list[current_name;output;2.8,0;8,6;]" .. "list[current_player;main;1.5,6.25;8,4;]".. - "listring[current_name;output]".."listring[current_player;main]".. - "listring[current_name;input]".."listring[current_player;main]".. - "listring[current_name;micro]".."listring[current_player;main]".. - "listring[current_name;recyle]".."listring[current_player;main]".. + "listring[current_name;output]".. + "listring[current_player;main]".. + "listring[current_name;input]".. + "listring[current_player;main]".. + "listring[current_name;micro]".. + "listring[current_player;main]".. + "listring[current_name;recyle]".. + "listring[current_player;main]" ) meta:set_int("anz", 0) -- No microblocks inside yet. diff --git a/mods/throwing/init.lua b/mods/throwing/init.lua index 142ce4b..675ad9a 100644 --- a/mods/throwing/init.lua +++ b/mods/throwing/init.lua @@ -21,7 +21,7 @@ local throwing_shoot_arrow = function(itemstack, player) local dir = player:get_look_dir() obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19}) obj:setacceleration({x=dir.x*-3, y=weapon_def.drop_rate, z=dir.z*-3}) - obj:setyaw(player:get_look_yaw()+math.pi) + obj:setyaw(player:get_look_horizontal()+math.pi) obj:get_luaentity().player = player obj:get_luaentity().max_damage = obj:get_luaentity().max_damage + weapon_def.damage_modifier minetest.sound_play("throwing_sound", {object=player}) diff --git a/mods/ts_doors/init.lua b/mods/ts_doors/init.lua index 304de32..55123cb 100755 --- a/mods/ts_doors/init.lua +++ b/mods/ts_doors/init.lua @@ -14,7 +14,7 @@ function ts_doors.register_door(recipe, description, texture) tiles = {{ name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base.png^[noalpha^[makealpha:0,255,0", backface_culling = true }}, description = description .. " Door", inventory_image = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_inv.png^[noalpha^[makealpha:0,255,0", - groups = groups, + groups = door_groups, recipe = { {recipe, recipe}, {recipe, recipe}, @@ -23,14 +23,14 @@ function ts_doors.register_door(recipe, description, texture) }) - groups.level = 2 + door_groups.level = 2 doors.register("ts_door_locked_" .. recipe:gsub(":", "_"), { tiles = {{ name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_locked.png^[noalpha^[makealpha:0,255,0", backface_culling = true }}, description = description .. " Locked Door", inventory_image = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_locked_inv.png^[noalpha^[makealpha:0,255,0", protected = true, - groups = groups, + groups = door_groups, sound_open = "doors_steel_door_open", sound_close = "doors_steel_door_close", recipe = { diff --git a/mods/workbench/init.lua b/mods/workbench/init.lua index fde9cea..27999b0 100644 --- a/mods/workbench/init.lua +++ b/mods/workbench/init.lua @@ -49,6 +49,8 @@ local function inventory_set_formspec(player, size) .."list[current_player;main;"..(fsize_x-msize_x)..","..(fsize_y-msize_y+1.25)..";"..msize_x..","..(msize_y - 1)..";"..msize_x.."]" .."list[current_player;craft;"..(fsize_x-size-2)..",0;"..size..","..size..";]" .."list[current_player;craftpreview;"..(fsize_x-1)..","..(size/2-0.5)..";1,1;]" + .."listring[current_player;main]" + .."listring[current_player;craft]" for i = 0, msize_x - 1, 1 do formspec = formspec.."image["..(fsize_x-msize_x + i)..","..(fsize_y-msize_y)..";1,1;gui_hb_bg.png]" end @@ -56,8 +58,8 @@ local function inventory_set_formspec(player, size) -- add the shortcut buttons if size ~= 3 then formspec = formspec .. "image_button[0.25,0.25;1,1;inventory_plus_zcg.png;zcg;]" - formspec = formspec .. "image_button[1.25,0.25;1,1;inventory_plus_skins.png;skins;]" - formspec = formspec .. "image_button[0.25,1.25;1,1;inventory_plus_armor.png;armor;]" + .. "image_button[1.25,0.25;1,1;inventory_plus_skins.png;skins;]" + .. "image_button[0.25,1.25;1,1;inventory_plus_armor.png;armor;]" end player:set_inventory_formspec(formspec)