Commit Graph

178 Commits

Author SHA1 Message Date
kwolekr 97c03436f6
Revert "Fix serverlist not beeing escaped correctly"
This reverts commit 39d03148e5d98ef5f9a31b131a79ff2bbd71a877.
2022-05-21 16:10:43 +02:00
sapier 6a3d716bf7
Fix header not beeing shown except on singleplayer tab 2022-05-21 16:10:42 +02:00
sapier 32cf551e9d
Fix serverlist not beeing escaped correctly Always use address for server Fix first (empty) element beeing selected after deleting last world 2022-05-21 16:10:42 +02:00
sapier c82ccfcf2d
fix crash on play/start with empty world list make enter button work in create world dialog 2022-05-21 16:10:41 +02:00
PilzAdam 65702a45bb
Make sure that coordinates passed to /teleport are actual numbers 2022-05-21 16:10:41 +02:00
ShadowNinja 0d12f10568
Move math.hypot() to misc_helpers.lua and fix zero-division error 2022-05-21 16:10:41 +02:00
kwolekr 356c2b5def
Lua main menu: Fix world creation dialog 2022-05-21 16:10:40 +02:00
PilzAdam 08d7219736
Set numeric locale in Lua in main menu 2022-05-21 16:10:40 +02:00
sapier 8b89cf28fa
Fix many formspec menu bugs 2022-05-21 16:10:39 +02:00
sfan5 7ecd865028
Fix parseColor, change remaining colorkeys to new format, fix Contributor list 2022-05-21 16:10:39 +02:00
ShadowNinja c95567ac55
Handle 0 vectors in vector.normalize() 2022-05-21 16:10:39 +02:00
ShadowNinja b8071a74f1
Add vector helpers 2022-05-21 16:10:38 +02:00
sfan5 5d8ea4dc07
Use hexadecimal RRGGBB instead of colorkeys, rename getColor to parseColor 2022-05-21 16:10:38 +02:00
kwolekr 5864868a03
Lua main menu: Fix crash on init lua error, mapgen dropdown index, and new worlds not saving index 2022-05-21 16:10:37 +02:00
sapier eb5a9131cc
Replace C++ mainmenu by formspec powered one 2022-05-21 16:10:37 +02:00
PilzAdam 3cb4de50b5
Remove unnecessary debug output in node_dig() 2022-05-21 16:10:36 +02:00
Lord James e4f0c69a53
Infinite tools in creative mode 2022-05-21 16:10:36 +02:00
kwolekr c982b18d74
Add Lua VoxelArea methods: contains, containsp, containsi 2022-05-21 16:10:36 +02:00
kwolekr 1c7092eee6
Add voxelarea.lua helper to builtin 2022-05-21 16:10:35 +02:00
kwolekr 1a2db073d5
Add Lua on_mapgen_init callback, and minetest.set_mapgen_params API 2022-05-21 16:10:35 +02:00
Diego Martínez 93b7336c01
Restore old output format of dump() 2022-05-21 16:10:34 +02:00
khonkhortisan 99f845852a
Fix crash in dump() when index is a table 2022-05-21 16:10:34 +02:00
sapier 85ae766dcb
Move scriptapi to separate folder (by sapier)
On the lua side, notably minetest.env:<function>(<args>) should now
be replaced by minetest.<function>(<args>).
The old way is and will stay supported for a long time.

Also:
Update and clean up lua_api.txt (by celeron55)
Move EnvRef to lua and remove add_rat and add_firefly (by kahrl)
Add separate src/util/CMakeLists.txt, other minor fixes (by kahrl)
2022-05-21 16:10:34 +02:00
PilzAdam db27434100
Fix minetest.features 2022-05-21 16:10:33 +02:00
sfan5 eba3824cb4
Add a Way of checking for specific Feature with Lua Adds minetest.get_feature() and minetest.has_feature() 2022-05-21 16:10:33 +02:00
ShadowNinja 98bf5d2d81
Add option to not prepend "Server -!- " to messages sent with minetest.chat_send_player() 2022-05-21 16:10:32 +02:00
RealBadAngel c1cbc596e4
Use system wide LuaJIT if aviable. 2022-05-21 16:10:32 +02:00
PilzAdam dda94512be
Only enqueue falling nodes if they really want to fall 2022-05-21 16:10:31 +02:00
khonkhortisan 93ce8191b1
unkn own block -> unkn own node 2022-05-21 16:10:31 +02:00
ShadowNinja 308902af73
Add private messaging with /msg 2022-05-21 16:10:31 +02:00
Diego Martínez 6dfa35ea48
Use the nodebox as selection box if it's not set manually 2022-05-21 16:10:30 +02:00
PilzAdam de38f0be50
Add a delay to nodeupdate() 2022-05-21 16:10:30 +02:00
PilzAdam b3bbf4a068
Return an ItemStack in minetest.item_place() if nodes' on rightclick doesnt return it 2022-05-21 16:10:29 +02:00
0gb.us 11f86d1def
Don't grant priveleges to non-existent players.
When accidentally misspelling a name, privileges are sometimes granted to non-existent players, leaving them with the extra privileges, but without the default privileges, if they ever join the server. This corrects that by disallowing /grant from working with invalid players. For completeness, it does the same for /revoke.
2022-05-21 16:10:29 +02:00
0gb.us 1c5c5dde8e
Fix node replacement in not-quite-loaded chunks
When first entering an area, sometimes placing nodes replaces other nodes that are not buildable_to. This seems to be caused by the fact that nodes in unloaded map blocks are treated as ignore, a node that is buildable_to. This fixes that, by using get_node_or_nil() instead of the previously-used get_node(), then checking to see if the nodes were actually loaded before replacing.
2022-05-21 16:10:29 +02:00
Splizard 8bddbb6381
Allow falling nodes to pass through solid "buildable_to" nodes. 2022-05-21 16:10:28 +02:00
PilzAdam b573ff1e73
Prevent passing nil to unpack() in minetest.after 2022-05-21 16:10:28 +02:00
Jeija c9a7b492b5
Allow minetest.after to take a variable number of arguments 2022-05-21 16:10:27 +02:00
kwolekr cf03131c13
Allow any character in formspec strings with escape char 2022-05-21 16:10:27 +02:00
PilzAdam dc253e3127
Fix pickup of dropped items when the player only takes a part of them 2022-05-21 16:10:26 +02:00
PilzAdam 21830e51a8
Drop nodes as items when dugged and no room in inventory and dont remove dropped items when no room in inventory 2022-05-21 16:10:26 +02:00
PilzAdam 5b6085743e
Dont drop tools on rightclick 2022-05-21 16:10:26 +02:00
Ilya Zhuravlev 577381e132
Set numeric locale for Lua 2022-05-21 16:10:25 +02:00
PilzAdam b611857ef5
Fix minetest.item_place_node() and minetest.item_drop() to always return an ItemStack 2022-05-21 16:10:25 +02:00
RealBadAngel eb7274214f
Fix to on_rightclick not able to change wielded_item 2022-05-21 16:10:24 +02:00
PilzAdam 049b8638c1
Dont call on_rightclick() if sneak is pressed 2022-05-21 16:10:24 +02:00
PilzAdam 279833455c
Fix spread of items in falling code 2022-05-21 16:10:24 +02:00
PilzAdam 42e67c79c1
Add on_rightclick(pos, node, clicker) callback for nodes 2022-05-21 16:10:23 +02:00
PilzAdam f264cf9833
Add ability to change the itemstack in placenode callbacks 2022-05-21 16:10:23 +02:00
jordan4ibanez 3fe947a986
Fix item entity's collision with nodeboxes 2022-05-21 16:10:22 +02:00
PilzAdam f8946b1dc0
Only fly through walls in noclip mode wich requires the noclip privilege 2022-05-21 16:10:22 +02:00
Ilya Zhuravlev f834e7cbad
Fix minetest.get_node_drops(). It should always return list of item names, not ItemStack(s). 2022-05-21 16:10:21 +02:00
PilzAdam ee0d38b5a6
Only check attachment for nodes with group attached_node 2022-05-21 16:10:21 +02:00
PilzAdam fd6ec68aab
Add the group attached_node Nodes in this group will be dropped as items if the node under them or the node in the wallmounted direction is not walkable. 2022-05-21 16:10:21 +02:00
DannyDark 0fabe42737
Log /grant and /revoke command usage 2022-05-21 16:10:20 +02:00
Matthew I f171cb855f
Add shutdown hook interface to Lua API
Scripts can call minetest.register_on_shutdown() to register a
shutdown hook.

Document that minetest.register_on_shutdown() callbacks may not be run

If the server crashes, it is unlikely that callbacks registered using
minetest.register_on_shutdown() will be called.
2022-05-21 16:10:20 +02:00
Perttu Ahola 2d07416f38
Revert "Use wielditem drawtype for all nodes in item_entity"
This reverts commit ffad18e42442fed10c312adc989fc62b74e05896.
2022-05-21 16:10:19 +02:00
PilzAdam 6417609dec
Use wielditem drawtype for all nodes in item_entity 2022-05-21 16:10:19 +02:00
Anthony a0f937099e
Fix server crash on /clearpassword
According to #253, using `/clearpassword` without an argument causes the server to crash from an assertion failure. I've resubmitted matttpt's patch as a pull request to aid in merging.
2022-05-21 16:10:19 +02:00
PilzAdam b646e953b6
Make air and ignore drop nothing 2022-05-21 16:07:53 +02:00
PilzAdam ff098bc4bb
Fix a bug in falling code where entities get stuck 2022-05-21 16:07:53 +02:00
PilzAdam 4742943383
Remove a useless comment 2022-05-21 16:07:52 +02:00
PilzAdam 0f873a3beb
Move falling to builtin 2022-05-21 16:07:52 +02:00
Perttu Ahola 7d6ff32d8c
Statically store always_collect field of __builtin:item 2022-05-21 16:07:51 +02:00
Perttu Ahola 38506bfbe6
Add overridable function for handling dropped items from nodes 2022-05-21 16:07:51 +02:00
Perttu Ahola fb96b0f99e
Fix github issue #213: Dropping unknown items crashes the game
The items will now just disappear when dropped.
2022-05-21 16:07:50 +02:00
Matthew I a70919257c
Move chat commands to Lua and remove servercommand.{cpp,h}
Commands moved:
 /me
 /status
 /time
 /shutdown
 /ban
 /clearobjects
2022-05-21 16:07:50 +02:00
Matthew I 3b4219b79f
Allow digging of unknown nodes
This allows the removal of nodes with unknown types.
get_item_callback() (C++) would fail if a node has an unknown type.  Now it
will try using the callback from minetest.nodedef_default in this case.
Also, minetest.node_dig() (Lua) was altered to always allow digging when
the node definition is empty (i.e. unknown node).
2022-05-21 16:07:50 +02:00
Perttu Ahola 02416dc628
Make the rollback system VERY FUCKING GOD DAMN POWERFUL 2022-05-21 16:07:49 +02:00
Perttu Ahola ebe1842d0b
Don't track liquids for rollback because of too much log 2022-05-21 16:07:49 +02:00
Perttu Ahola 5fbf87d54d
Experimental-ish rollback functionality 2022-05-21 16:07:48 +02:00
Perttu Ahola 2df90c2bf0
Deprecate minetest.add_to_creative_inventory and use group not_in_creative_inventory instead 2022-05-21 16:07:48 +02:00
Perttu Ahola e6ec4258db
Remove special handling of creative mode 2022-05-21 16:07:47 +02:00
Perttu Ahola a87451a0fe
Detached inventory callbacks and reworked node metadata callbacks 2022-05-21 16:07:47 +02:00
Perttu Ahola 47a9ab6fb0
builtin/item.lua: callbacks with copies of positions and nodes rather than recycle the same ones, which callbacks can modify 2022-05-21 16:07:46 +02:00
Perttu Ahola eb9b1ffc15
Add oldnode parameter to minetest.register_on_placenode callback 2022-05-21 16:07:46 +02:00
Perttu Ahola ea97707ef2
Fix building on top of (pointable && buildable_to) nodes 2022-05-21 16:07:45 +02:00
Perttu Ahola 66a549d9ea
Move /give, /giveme, /spawnentity and /pulverize to builtin/chatcommands.lua 2022-05-21 16:07:44 +02:00
Perttu Ahola dbaef1b2c6
minetest.register_on_player_receive_fields() 2022-05-21 16:07:43 +02:00
Matthew I 9a002ec0b7
Add "/mods" command to list mods to client 2022-05-21 16:07:43 +02:00
Perttu Ahola db3d37aaa8
Actually fix facedir-rotated nodes placed using minetest.env:place_node() 2022-05-21 16:07:42 +02:00
Perttu Ahola 05b928da0a
Check whether node is known before reading definition in __builtin:item:on_step() 2022-05-21 16:07:42 +02:00
Calinou 64a2c71b95
Message cleanups (consistency) and prevent /me when not allowed to shout 2022-05-21 16:07:41 +02:00
darkrose af6f80ba63
Handle nil placer as it might occur when using minetest.env:place_node. (Uberi) 2022-05-21 16:07:41 +02:00
Perttu Ahola 299ce58169
Fix /setpassword and /clearpassword 2022-05-21 16:07:41 +02:00
Perttu Ahola a8b475d195
Remove tiles and special_tiles from node definition prototype because otherwise the old names can't be used 2022-05-21 16:07:40 +02:00
Perttu Ahola 7f37a08eba
Update field names to non-deprecated ones in node definition prototype 2022-05-21 16:07:40 +02:00
Perttu Ahola 15213d8768
Node placement client-side prediction 2022-05-21 16:07:39 +02:00
Perttu Ahola 70b13374d6
Don't deprecate minetest.register_on_placenode and minetest.register_on_dignode 2022-05-21 16:07:39 +02:00
Perttu Ahola 361a4d575c
Add minetest.serialize() and minetest.deserialize() 2022-05-21 16:07:38 +02:00
Perttu Ahola 3519373773
place_node, dig_node and punch_node; an in-game tester tool; remove old code 2022-05-21 16:07:38 +02:00
darkrose 28d4194f24
Add can_dig callback 2022-05-21 16:07:38 +02:00
Perttu Ahola 7b4cdba449
Add ObjRef:is_player() and modify ObjRef:get_player_name() to always return a string to aid better inter-object compatibility of code that assumes objects to be players 2022-05-21 16:07:37 +02:00
Perttu Ahola 157b198e0f
Implement locked chest; add after_place_node and after_dig_node node callbacks 2022-05-21 16:07:37 +02:00
Perttu Ahola c8727f8c5a
on_metadata_inventory_{move,offer,take} 2022-05-21 16:07:36 +02:00
Perttu Ahola 1656cbdaa2
Random node metadata things 2022-05-21 16:07:36 +02:00
Perttu Ahola 1bd4c6b208
Attempt to begin to implement chests and furnace in Lua (with problems) 2022-05-21 16:07:35 +02:00
Perttu Ahola 235ac5dae5
Take out the "Privileges of foo are hidden from you." response of /privs 2022-05-21 16:07:34 +02:00
Perttu Ahola e50d7926d6
Fix executing register_chatcommand-defined commands even in the middle of a chat line 2022-05-21 16:07:33 +02:00
Perttu Ahola e7654568ed
basic_privs to allow granting/revoking interact_extra too 2022-05-21 16:07:33 +02:00