Jude Melton-Houghton
b38ffdec27
Implement vector and node conversion in Lua ( #12609 )
...
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-18 18:01:44 -04:00
fluxionary
440d966b93
add an 'equals' method to ItemStack and compatibility w/ lua '==' ( #12771 )
...
Co-authored-by: rubenwardy <rw@rubenwardy.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-09 08:06:09 -04:00
Jude Melton-Houghton
7632af3c73
Consolidate API object code ( #12728 )
...
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-04 08:31:36 -04:00
Jude Melton-Houghton
fe13f9dfd1
Fix potential use-after-free with item metadata ( #12729 )
...
This fixes a use-after-free bug in the case where itemstack metadata is accessed after the itemstack has been garbage-collected.
2022-09-11 19:28:37 +02:00
Herman Semenov
038da00e79
Code optimizations / refactor ( #12704 )
...
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-06 11:21:09 +01:00
Wuzzy
6a6b579c54
Add helper functions to make tool usable n times ( #12047 )
2022-06-03 21:47:04 +02:00
sfan5
a9a207685a
Reject registering node with empty name
...
fixes #10769
2022-05-29 14:00:19 +02:00
sfan5
e7659883cc
Async environment for mods to do concurrent tasks ( #11131 )
2022-05-02 20:56:06 +02:00
sfan5
56a558baf8
Refactor some Lua API functions in preparation for async env
2022-05-02 20:54:55 +02:00
sfan5
a0047d6edc
script: Replace calls to depreated luaL_openlib
2021-05-30 11:40:14 +02:00
JosiahWI
11f3deb9c4
Pass ContentFeatures as reference to read_content_features ( #10464 )
2020-10-13 16:36:01 +01:00
DS
f3ae45b2b2
Add a short_description to be used by mods ( #8980 )
2020-10-09 19:11:21 +01:00
Paul Ouellette
b16f841756
LuaItemStack: Add __tostring metamethod ( #8785 )
...
* LuaItemStack: Add __tostring metamethod
* Clean up LuaItemStack::checkobject
2020-06-09 19:37:25 +02:00
sfan5
338195ff25
Fix alias handling of get_content_id ( #9712 )
...
fixes #9632
2020-04-19 19:07:54 +02:00
Loic Blot
5146086a64
Drop content_sao.{cpp,h}
...
Move LuaEntitySAO to a new dedicated file
Drop TestSAO (useless object)
Drop the old static startup initialized SAO factory, which was pretty useless.
This factory was using a std::map for 2 elements, now just use a simple condition owned by ServerEnvironment, which will be lightweight, that will also drop a one time useful test on each LuaEntitySAO creation. This should reduce server load on massive SAO creation
2020-04-11 16:07:17 +02:00
sfan5
de73f989eb
Overall improvements to log messages ( #9598 )
...
Hide some unnecessarily verbose ones behind --trace or disable them entirely.
Remove duplicate ones. Improve their contents in some places.
2020-04-08 20:13:23 +02:00
HybridDog
fd4daefb29
minetest.get_content_id: error if the node does not exist ( #9458 )
...
If a mod creator makes a typing mistake, this function now causes an error instead of returning the id of "ignore".
2020-03-11 16:25:14 +01:00
Paul Ouellette
904b05b0d3
Allow calling ItemStack with no arguments ( #8783 )
2019-10-23 19:48:19 +02:00
Paul Ouellette
008b80fe1c
Add ItemStack:get_description() to get tooltip ( #8847 )
2019-08-24 18:38:02 +02:00
Loïc Blot
eef62c82a2
Modernize lua read (part 2 & 3): C++ templating assurance ( #7410 )
...
* Modernize lua read (part 2 & 3): C++ templating assurance
Implement the boolean reader
Implement the string reader
Also remove unused & unimplemented script_error_handler
Add a reader with default value
2018-06-30 17:11:38 +02:00
you
22df02d25b
Fix missing ignore textures ( #7326 )
2018-05-20 14:51:50 +02:00
Dániel Juhász
3face01a20
Node definition manager refactor ( #7016 )
...
* Rename IWritableNodeDefManager to NodeDefManager
* Make INodeDefManager functions const
* Use "const *NodeDefManager" instead of "*INodeDefManager"
* Remove unused INodeDefManager class
* Merge NodeDefManager and CNodeDefManager
* Document NodeDefManager
2018-02-10 21:04:16 +01:00
Loïc Blot
88b436e6a9
Code modernization: subfolders ( #6283 )
...
* Code modernization: subfolders
Modernize various code on subfolders client, network, script, threading, unittests, util
* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* C++ STL header style
* Make connection.cpp readable in a pointed place + typo
2017-08-19 22:23:47 +02:00
Loïc Blot
f3fe62a0bf
Fix various copy instead of const ref reported by cppcheck ( #5615 )
...
* Also remove InventoryList::peekItem unused function
* Fix some post increment to preincrement reported by cppcheck
2017-04-19 23:02:07 +02:00
numberZero
83508277ce
Fix inability to change metadata using stack:to_table() ( #5547 )
2017-04-12 16:51:07 +02:00
Loïc Blot
41c5483024
Replace luaL_reg with luaL_Reg as recent LuaJIT dropped the Lua 5.0 compat ( #5541 )
...
We are bundling Lua5.1 which has same macro
2017-04-08 09:28:37 +02:00
red-001
88df9fb5b6
Add get_wielded_item
2017-03-13 23:56:05 +01:00
rubenwardy
0680c47d6c
Fix incompatibility of ItemStack.to_table() introduced by stack meta
2017-02-07 21:18:17 +00:00
rubenwardy
f2aa2c6a98
Add ItemStack key-value meta storage
2017-02-04 22:07:55 +00:00
paly2
aa33166386
Add minetest.unregister_item and minetest.register_alias_force
2016-09-08 03:26:52 -04:00
sfan5
a58c0f458d
Make ItemStack:set_count(0) clear the item stack
...
fixes minetest/minetest_game#786
2016-01-15 13:44:45 +01:00
kwolekr
3c637b4baf
LuaItemStack: Fix and document behavior of set_name, set_count, set_wear, set_metadata
2014-12-28 23:59:24 -05:00
ShadowNinja
c4359ff65c
Use "core" namespace internally
2014-05-08 13:02:04 -04:00
ShadowNinja
31fe72dbac
Remove lua_State parameter from LuaError::LuaError
2014-03-15 16:28:59 -04:00
ShadowNinja
49cec3f782
Handle LuaErrors in Lua -> C++ calls on LuaJIT
2013-12-18 16:35:55 -05:00
PilzAdam
a9c0961e0c
Add set_name(), set_count(), set_wear() and set_metadata() to Lua ItemStack
2013-09-28 23:46:48 +02:00
Kahrl
4e1f50035e
Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu
2013-08-14 21:03:33 +02:00
Kahrl
112dbba7c4
Change ContentFeatures array to a vector
2013-07-14 23:06:31 +02:00
kwolekr
8aa930f28e
Add minetest.get_mapgen_object to API
2013-06-27 22:35:35 -04:00
kwolekr
d6ac3d8d9a
Add LuaVoxelManip
2013-06-27 22:35:35 -04:00
sapier
e464f19356
Fix itemstack:add item not working correct
2013-05-25 19:23:10 +02:00
sapier
ab43377577
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)
2013-05-25 00:51:02 +02:00