aboutsummaryrefslogtreecommitdiff
path: root/src/client.h
Commit message (Expand)AuthorAge
* Performance of main client loop up to 2x faster In places, up to 3 times fasterCraig Robbins2014-12-07
* Fix node 0,0,0 being highlighted when enable_node_highlighting == falseCraig Robbins2014-12-01
* Fix client "double saving" simple singleplayer local mapsCraig Robbins2014-11-26
* Add (optional) client-side saving of server map to disksfan52014-11-19
* Recalculate normals for cached meshes.RealBadAngel2014-10-21
* Allow taking screenshots of formspecs and move message to chatBlockMen2014-09-21
* Node highlighting.RealBadAngel2014-09-17
* Fix heart + bubble bar size on different texture packssapier2014-05-07
* Add download rate to media progress bar (non http mode only!)sapier2014-04-29
* Bunch of small fixes (coding style, very unlikely errors, warning messages)sapier2014-04-19
* Cleanup client init states by bumping protocol versionsapier2014-04-08
* Pass arguments by referenceSelat2014-03-12
* Fix rendering glitches when far from the center of the mapNovatux2014-03-04
* Remove lots of dead codesapier2014-02-07
* Add player:override_day_night_ratio() for arbitrarily controlling sunlight br...Perttu Ahola2014-02-01
* Add player:set_sky() with simple skybox supportPerttu Ahola2014-02-01
* New HUD element - waypoint.RealBadAngel2014-01-26
* Allow vertical axis particle rotation constraintkhonkhortisan2014-01-13
* Make MutexQueue use jsemaphore for signalingsapier2014-01-10
* Create new instance of mesh every time it's required (Solves #703)Perttu Ahola2014-01-06
* Replace SimpleThread by JThread now implementing same featuressapier2013-12-15
* Rewrite client media download and support hash-based remote downloadKahrl2013-12-13
* Add minetest.swap_nodeNovatux2013-11-30
* Always use builtin JThread librarykwolekr2013-09-15
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Remove farmeshKahrl2013-08-13
* Add set_breath and get_breath to lua API.RealBadAngel2013-07-20
* Add support for IPv6proller2013-06-23
* Add drowningPilzAdam2013-06-19
* Add progress bar to item visuals preloadingZeg92013-05-13
* Generalize hud_builtin_enable into hud_set_flagskwolekr2013-04-25
* Added support to disable built-in HUD elementsDiego Martínez2013-04-24
* Added offset support for HUD itemsDiego Martínez2013-04-23
* Added support for alignment in HUD itemsDiego Martínez2013-04-23
* Split HUD code off to hud.cpp, make into a class, extensive Lua HUD modificationkwolekr2013-04-18
* Lua HUDJonathon Anderson2013-04-18
* Fix nick completionPilzAdam2013-04-05
* Allow spawning particles from the server, from luaJeija2013-03-23
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Add particlesJeija2013-01-14
* Fix buttons not working for Lua-triggered formspecssapier2013-01-07
* Add TOCLIENT_SHOW_FORMSPEC to display formspecs at client from luasapier2013-01-02
* Make m_media_fetch_threads to contain MediaFetchThread* instead of MediaFetch...Ilya Zhuravlev2012-12-17
* Added ability to fetch media from remote server (using cURL library)Ilya Zhuravlev2012-12-16
* ShaderSource and silly example shadersKahrl2012-12-02
* Default server step to 0.1s and sync object/player update intervals to itPerttu Ahola2012-11-26
* Detached inventoriesPerttu Ahola2012-07-24
* minetest.register_on_player_receive_fields()Perttu Ahola2012-07-22
rlike", paramtype = "light", sunlight_propagates = true, walkable = false, buildable_to = false, is_ground_content = false, on_dig = function(pos, node, player) minetest.remove_node(pos) minetest.set_node(pos, {name="elevator:placeholder"}) end }) end if mineclone_path then moditems.el_shaft_groups = {pickaxey=1,axey=1,handy=1,swordy=1,transport=1,dig_by_piston=1} moditems.el_motor_groups = {pickaxey=1,axey=1,handy=1,swordy=1,transport=1,dig_by_piston=1} moditems.elevator_groups = {pickaxey=1,axey=1,handy=1,swordy=1,transport=1,dig_by_piston=1} moditems.elevator_special_groups = {not_in_creative_inventory=1,pickaxey=1,axey=1,handy=1,swordy=1,transport=1,dig_by_piston=1} moditems.sounds_stone = mcl_sounds.node_sound_stone_defaults moditems.el_motor_gfx = "elevator_motor_mcl.png" moditems.el_shaft_gfx = "elevator_shaft_mcl.png" moditems.el_box_gfx = "elevator_box_mcl.png" elseif default_path then moditems.el_shaft_groups = {cracky=2,oddly_breakable_by_hand=0} -- removing ability to destroy by hand to prevent accidental breakage of whole elevators moditems.el_motor_groups = {cracky=1} moditems.elevator_groups = {cracky=1,choppy=1,snappy=1} moditems.elevator_special_groups = {not_in_creative_inventory=1} moditems.sounds_stone = default.node_sound_stone_defaults moditems.el_motor_gfx = "elevator_motor.png" moditems.el_shaft_gfx = "elevator_shaft.png" moditems.el_box_gfx = "elevator_box.png" end minetest.register_node("elevator:shaft", { description = "Elevator Shaft", tiles = { moditems.el_shaft_gfx }, drawtype = "nodebox", paramtype = "light", on_rotate = screwdriver.disallow, sunlight_propagates = true, groups = moditems.el_shaft_groups, sounds = moditems.sounds_stone(), node_box = { type = "fixed", fixed = { {-8/16,-8/16,-8/16,-7/16,8/16,8/16}, {7/16,-8/16,-8/16,8/16,8/16,8/16}, {-7/16,-8/16,-8/16,7/16,8/16,-7/16}, {-7/16,-8/16,8/16,7/16,8/16,7/16}, }, }, collisionbox = { type = "fixed", fixed = { {-8/16,-8/16,-8/16,-7/16,8/16,8/16}, {7/16,-8/16,-8/16,8/16,8/16,8/16}, {-7/16,-8/16,-8/16,7/16,8/16,-7/16}, {-7/16,-8/16,8/16,7/16,8/16,7/16}, }, }, after_place_node = function(pos) -- We might have connected a motor above to an elevator below. elevator.build_motor(elevator.locate_motor(pos)) end, on_destruct = function(pos) -- Remove boxes and deactivate elevators below us. elevator.unbuild(pos, 1) end, _mcl_blast_resistance = 15, -- mineclone2 specific _mcl_hardness = 5, -- mineclone2 specific }) minetest.register_node("elevator:motor", { description = "Elevator Motor", tiles = { "default_steel_block.png", "default_steel_block.png", moditems.el_motor_gfx, moditems.el_motor_gfx, moditems.el_motor_gfx, moditems.el_motor_gfx, }, groups = moditems.el_motor_groups, sounds = moditems.sounds_stone(), after_place_node = function(pos, placer, itemstack) -- Set up the motor table. elevator.motors[phash(pos)] = { elevators = {}, pnames = {}, labels = {}, } elevator.save_elevator() elevator.build_motor(phash(pos)) end, on_destruct = function(pos) -- Destroy everything related to this motor. elevator.boxes[phash(pos)] = nil elevator.motors[phash(pos)] = nil elevator.save_elevator() end, _mcl_blast_resistance = 15, -- mineclone2 specific _mcl_hardness = 5, -- mineclone2 specific }) local box = { { 0.48, -0.5,-0.5, 0.5, 1.5, 0.5}, {-0.5 , -0.5, 0.48, 0.48, 1.5, 0.5}, {-0.5, -0.5,-0.5 ,-0.48, 1.5, 0.5}, {-0.5 , -0.5, -0.48, 0.5, 1.5, -0.5}, { -0.5,-0.5,-0.5,0.5,-0.48, 0.5}, { -0.5, 1.45,-0.5,0.5, 1.5, 0.5}, } -- Elevator box node. Not intended to be placeable. minetest.register_node("elevator:elevator_box", { description = "Elevator", drawtype = "nodebox", paramtype = 'light', paramtype2 = "facedir", wield_scale = {x=0.6, y=0.6, z=0.6}, selection_box = { type = "fixed", fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 } }, collision_box = { type = "fixed", fixed = box, }, node_box = { type = "fixed", fixed = box, }, tiles = { "default_steel_block.png", "default_steel_block.png", moditems.el_box_gfx, moditems.el_box_gfx, moditems.el_box_gfx, moditems.el_box_gfx, }, groups = moditems.elevator_special_groups, light_source = 4, _mcl_blast_resistance = 15, -- mineclone2 specific _mcl_hardness = 5, -- mineclone2 specific }) for _,mode in ipairs({"on", "off"}) do local nodename = "elevator:elevator_"..mode local on = (mode == "on") local box local cbox if on then -- Active elevators have a ceiling and floor. box = { { 0.48, -0.5,-0.5, 0.5, 1.5, 0.5}, {-0.5 , -0.5, 0.48, 0.48, 1.5, 0.5}, {-0.5, -0.5,-0.5 ,-0.48, 1.5, 0.5}, { -0.5,-0.5,-0.5,0.5,-0.48, 0.5}, { -0.5, 1.45,-0.5,0.5, 1.5, 0.5}, } cbox = table.copy(box) -- But you can enter them from the top. cbox[5] = nil else -- Inactive elevators are almost like shafts. box = { { 0.48, -0.5,-0.5, 0.5, 1.5, 0.5}, {-0.5 , -0.5, 0.48, 0.48, 1.5, 0.5}, {-0.5, -0.5,-0.5 ,-0.48, 1.5, 0.5}, {-0.5 , -0.5, -0.48, 0.5, 1.5, -0.5}, } cbox = box end minetest.register_node(nodename, { description = "Elevator", drawtype = "nodebox", sunlight_propagates = false, paramtype = "light", paramtype2 = "facedir", on_rotate = screwdriver.disallow, selection_box = { type = "fixed", fixed = box, }, collision_box = { type = "fixed", fixed = cbox, }, node_box = { type = "fixed", fixed = box, }, tiles = on and { "default_steel_block.png", "default_steel_block.png", moditems.el_box_gfx, moditems.el_box_gfx, moditems.el_box_gfx, moditems.el_box_gfx, } or { moditems.el_box_gfx, moditems.el_box_gfx, moditems.el_box_gfx, moditems.el_box_gfx, moditems.el_box_gfx, moditems.el_box_gfx, }, groups = moditems.elevator_groups, drop = "elevator:elevator_off", -- Emit a bit of light when active. light_source = (on and 4 or nil), after_place_node = function(pos, placer, itemstack) local meta = minetest.get_meta(pos) meta:set_int("version", elevator.VERSION) -- Add a placeholder to avoid nodes being placed in the top. local p = vector.add(pos, {x=0, y=1, z=0}) local p2 = minetest.dir_to_facedir(placer:get_look_dir()) minetest.set_node(p, {name="elevator:placeholder", paramtype2="facedir", param2=p2}) -- Try to build a motor above. local motor = elevator.locate_motor(pos) if motor then elevator.build_motor(motor) end end, after_dig_node = function(pos, node, meta, digger) elevator.unbuild(pos, 2) end, on_place = function(itemstack, placer, pointed_thing) local pos = pointed_thing.above local node = minetest.get_node(vector.add(pos, {x=0, y=1, z=0})) if (node ~= nil and node.name ~= "air" and node.name ~= "elevator:placeholder") then return end return minetest.item_place(itemstack, placer, pointed_thing) end, on_rightclick = function(pos, node, sender) if not sender or not sender:is_player() then return end local formspec local meta = minetest.get_meta(pos) elevator.formspecs[sender:get_player_name()] = {pos} local motorhash = meta:get_string("motor") if on and elevator.motors[motorhash] then if vector.distance(sender:getpos(), pos) > 1 or minetest.get_node(sender:getpos()).name ~= nodename then minetest.chat_send_player(sender:get_player_name(), "You are not inside the booth.") return end -- Build the formspec from the motor table. local tpnames = {} local tpnames_l = {} local motor = elevator.motors[motorhash] for ji,jv in ipairs(motor.pnames) do if tonumber(jv) ~= pos.y then table.insert(tpnames, jv) table.insert(tpnames_l, (motor.labels[ji] and motor.labels[ji] ~= "") and (jv.." - "..minetest.formspec_escape(motor.labels[ji])) or jv) end end elevator.formspecs[sender:get_player_name()] = {pos, tpnames} if #tpnames > 0 then if not minetest.is_protected(pos, sender:get_player_name()) then formspec = "size[4,6]" .."label[0,0;Click once to travel.]" .."textlist[-0.1,0.5;4,4;target;"..table.concat(tpnames_l, ",").."]" .."field[0.25,5.25;4,0;label;;"..minetest.formspec_escape(meta:get_string("label")).."]" .."button_exit[-0.05,5.5;4,1;setlabel;Set label]" else formspec = "size[4,4.4]" .."label[0,0;Click once to travel.]" .."textlist[-0.1,0.5;4,4;target;"..table.concat(tpnames_l, ",").."]" end else if not minetest.is_protected(pos, sender:get_player_name()) then formspec = "size[4,2]" .."label[0,0;No targets available.]" .."field[0.25,1.25;4,0;label;;"..minetest.formspec_escape(meta:get_string("label")).."]" .."button_exit[-0.05,1.5;4,1;setlabel;Set label]" else formspec = "size[4,0.4]" .."label[0,0;No targets available.]" end end minetest.show_formspec(sender:get_player_name(), "elevator:elevator", formspec) elseif not elevator.motors[motorhash] then if not minetest.is_protected(pos, sender:get_player_name()) then formspec = "size[4,2]" .."label[0,0;This elevator is inactive.]" .."field[0.25,1.25;4,0;label;;"..minetest.formspec_escape(meta:get_string("label")).."]" .."button_exit[-0.05,1.5;4,1;setlabel;Set label]" else formspec = "size[4,0.4]" .."label[0,0;This elevator is inactive.]" end minetest.show_formspec(sender:get_player_name(), "elevator:elevator", formspec) elseif elevator.boxes[motorhash] then if not minetest.is_protected(pos, sender:get_player_name()) then formspec = "size[4,2]" .."label[0,0;This elevator is in use.]" .."field[0.25,1.25;4,0;label;;"..minetest.formspec_escape(meta:get_string("label")).."]" .."button_exit[-0.05,1.5;4,1;setlabel;Set label]" else formspec = "size[4,0.4]" .."label[0,0;This elevator is in use.]" end minetest.show_formspec(sender:get_player_name(), "elevator:elevator", formspec) end end, on_destruct = function(pos) local p = vector.add(pos, {x=0, y=1, z=0}) if get_node(p).name == "elevator:placeholder" then minetest.remove_node(p) end end, _mcl_blast_resistance = 15, -- mineclone2 specific _mcl_hardness = 5, -- mineclone2 specific }) end -- Compatability with an older version. minetest.register_alias("elevator:elevator", "elevator:elevator_off")