438 Commits

Author SHA1 Message Date
Dániel Juhász
fc3bfe1c00 Light update for map blocks
This is not really different from the light update of a voxel
manipulator. This update does not assume that the lighting was correct
before, therefore it is useful for correction.

Also expose this function to the Lua API for light correction, and
allow voxel manipulators not to update the light.
2017-04-20 05:39:14 +02:00
Loïc Blot
6d77b9ce43 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
paramat
afe086801d Sneak: Add option for old move code
Temporary option for the old move code for specific old sneak behaviour.
Enabled by setting the added 'new move' physics override to false.
By default 'new move' is true.
2017-04-17 10:13:05 +01:00
Loïc Blot
c99bfa77db Implement delayed server shutdown with cancelation (#4664) 2017-04-15 23:19:18 +02:00
SmallJoker
afbc71e69e Minimap: Do a double-typecast to fix compiling with MSVC 2017-04-15 14:30:27 +02:00
bigfoot547
a6e3e4b81e [CSM] Add function to set minimap shape (#5569)
* [CSM] Add function to set minimap shape

Also deprecates `toggle_shape`.

* Oh fish, I messed that one up!

* Fix Style

* Sorry, I missed something

I still had the `luamethod` call in there!

* Add getters

* Remove extra line

* Remove useless variable

Please review again @nerzhul . Thanks!

* Satisfy nerzhul
2017-04-14 09:04:41 +02:00
numberZero
8636bffd69 Fix inability to change metadata using stack:to_table() (#5547) 2017-04-12 16:51:07 +02:00
t0ny2
4d935250b7 Replace occurrence of luaL_reg in l_localplayer (#5566)
Related to commit 41c5483. Replace a final occurrence of luaL_reg in
src/script/lua_api/l_localplayer.cpp
2017-04-11 19:29:24 +02:00
Loïc Blot
0dca330064 Clang-format styles fixes since previous commit 2017-04-10 09:17:53 +02:00
Loic Blot
903b6ed951 Clang format: fix LINT on old PR which doesn't have LINT enabled 2017-04-10 08:05:03 +02:00
Vincent Glize
679790df61 LocalPlayer api lua 2017-04-08 22:04:30 -07:00
Dániel Juhász
88b956fe8e Hardware coloring for itemstacks
Adds the possibility to colorize item stacks based on their metadata.

In the item/node definition you can specify palette (an image file)
and color (fallback color if the item has no palette or metadata).
Then you can add palette_index to the metadata.

Dropped itemstacks with different colors do not merge.
2017-04-08 18:39:15 -07:00
Loïc Blot
3fe2ed00ed 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
Loic Blot
feb0cb119c Pass clang-format on 14 trivial header files fixes
Also remove them from whitelist
2017-04-07 23:22:00 +02:00
Loic Blot
31717a1e67 Clang-format: fix some header files and remove them from whitelist 2017-04-07 08:50:17 +02:00
Loïc Blot
0cf9479af4 LINT: Switch whitelist check from egrep to awk
Bonus: make CI happy with the last rules fix
2017-04-06 23:21:40 +02:00
red-001
1ffa35176b [CSM] Add function to get the server protocol version. (#5529) 2017-04-06 22:50:45 +02:00
Loic Blot
d93892d774 Move LINT process in dedicated shell & fix
Move lint to dedicated shell permit to use it from your shell easily to check what is wrong
Also fix recent regressions in code style
2017-04-06 09:10:59 +02:00
red-001
f86c274718 [CSM] Add support for positional audio. (#5516)
Fixes parts of #5389.
2017-04-06 08:14:31 +02:00
red-001
450c75a365 [CSM] Add local node meta reference. (#5508) 2017-04-04 07:41:37 +02:00
red-001
887549792a [CSM] Add function and chat command to disconnect from server. (#5487) 2017-04-01 13:40:56 +02:00
Loic Blot
114b1d89de Fix clang-format Columns Width
Also fix l_client.cpp/h and remove them from whitelist
2017-03-31 22:29:34 +02:00
Loïc Blot
6310f842bc l_minimap: don't show minimap if configuration doesn't allow it 2017-03-29 15:50:22 +02:00
bigfoot547
06aac53a03 [CSM] Add function to get player names in range (#5435)
* [CSM] Add function to get currently connected player names
2017-03-22 21:13:03 +01:00
Loïc Blot
d6c34a3407 Refactor Game class (part 2) (#5422)
* showPauseMenu is now part of game
* remove many flags parameters passed to game functions, use the member.
* rename VolatileRunFlags to GameUIFlags (this will permit to share structure with client and CSM
* updatePointedThing: remove pointer ref, we already have the pointer in rundata
* move some attributes outside of VolatileRunFlags after renaming, to game class
* rename statustext to m_statustext
* make some const variables static
* All those changes permit to reduce a little bit function class cost and will permit to interface CSM with some interesting Game flags
* Expose GameUIFlags to client
* Client now have GameUIFlags parameter and setters for other classes
* Fix minimap show/hide in Lua because we now have access to the real flag
2017-03-19 13:18:52 +01:00
Loïc Blot
6ec8516c8f [CSM] Fix minimap problems (#5405)
This fixes issue #5404
2017-03-17 07:54:49 +01:00
Loïc Blot
6483d88b89 [CSM] Add core.get_timeofday & core.get_day_count env calls (#5401)
* [CSM] Add core.get_timeofday & core.get_day_count env calls

* [CSM] Add core.get_node_level, core.get_node_max_level, core.find_node_near
2017-03-17 07:48:29 +01:00
Loïc Blot
b9e61d4da3 [CSM] Add minimap API modifiers (#5399)
* Rename Mapper (too generic) to Minimap
* Add lua functions to get/set position, angle, mode for minimap
* Client: rename m_mapper to m_minimap
* Add minimap to core.ui namespace (core.ui.minimap)
* Add various functions to manage minimap (show, hide, toggle_shape)
* Cleanup trivial declaration in client
2017-03-16 10:34:54 +01:00
Loïc Blot
aadc6b9f06 Add ModStorageAPI to client side modding (#5396)
mod storage is located into user_path / client / mod_storage
2017-03-16 07:53:39 +01:00
paramat
fc7d75c19d Get biome list: Downgrade missing biome message to infostream
It is harmless for a biome listed in an ore or decoration registration
to be missing.
Now that we are registering certain biomes or not based on options
(such as floatland biomes), the biome lists in ore and decoration
registrations trigger these error messages, avoiding these error
messages would need a large amount of duplication of ore and decoration
registrations.
2017-03-16 02:56:03 +00:00
red-001
c43ad771f6 Add get_wielded_item 2017-03-13 23:56:05 +01:00
red-001
b261ab875f [CSM] Add get_node and get_node_or_nil 2017-03-13 23:56:05 +01:00
Loic Blot
cff2797dd4 [CSM] storage + fixes 2017-03-13 23:56:05 +01:00
red-001
2001a8c195 [CSM] Add local formspecs. (#5094) 2017-03-13 23:56:05 +01:00
Loïc Blot
04680f648a [CSM] sound_play & sound_stop support + client_lua_api doc (#5096)
* squashed: CSM: Implement register_globalstep
  * Re-use fatal error mechanism from server to disconnect client on CSM error
  * Little client functions cleanups

* squashed: CSM: add core.after function
  * core.after is shared code between client & server
  * ModApiUtil get_us_time feature enabled for client
2017-03-13 23:56:05 +01:00
red-001
1c7fd8a35c [CSM] Add client-sided chat commands (#5092) 2017-03-13 23:56:05 +01:00
red-001
4fea6c30de [CSM] Add method that display chat to client-sided lua. (#5089) (#5091)
* squashed: [Client-sided scripting] Don't register functions that don't work. (#5091)
2017-03-13 23:56:05 +01:00
Loic Blot
045cc40d91 [CSM] Client side modding
* rename GameScripting to ServerScripting
* Make getBuiltinLuaPath static serverside
* Add on_shutdown callback
* Add on_receiving_chat_message & on_sending_chat_message callbacks
* ScriptApiBase: use IGameDef instead of Server
  This permits to share common attribute between client & server
* Enable mod security in client side modding without conditions
2017-03-13 23:56:05 +01:00
Dániel Juhász
fe21088bca Light calculation: New bulk node lighting code
This commit introduces a new bulk node lighting algorithm to minimize
lighting bugs during l-system tree generation, schematic placement and
non-mapgen-object lua voxelmanip light calculation.

If the block above the changed area is not loaded, it gets loaded to avoid
lighting bugs.
Light is updated as soon as write_to_map is called on a voxel manipulator,
therefore update_map does nothing.
2017-03-11 02:06:18 +00:00
Loïc Blot
65e75bba93 Add ModMetadata API (#5131)
* mod can create a ModMetadata object where store its values and retrieve it.
* Modmetadata object can only be fetched at mod loading
* Save when modified using same time as map interval or at server stop
* add helper function to get mod storage path
* ModMetadata has exactly same calls than all every other Metadata
2017-02-08 00:15:55 +01:00
rubenwardy
75153f5323 Fix incompatibility of ItemStack.to_table() introduced by stack meta 2017-02-07 21:18:17 +00:00
rubenwardy
8441029477 Add ItemStack key-value meta storage 2017-02-04 22:07:55 +00:00
rubenwardy
1303719641 Derive NodeMetaRef from MetaDataRef 2017-02-04 22:07:55 +00:00
rubenwardy
f861226cc1 Make NodeMetaRef::getmeta a non-static member 2017-02-04 22:07:55 +00:00
kilbith
833c48dc59 Serverlist: Add ping indicators (#5164) 2017-02-03 23:53:43 +10:00
SmallJoker
1ca1d9ae97 from_table: Fix crash for missing inventory or field 2017-01-28 16:38:46 +01:00
Loïc Blot
b24578ef70 Implement player attribute backend (#4155)
* This backend permit mods to store extra players attributes to a common interface.
* Add the obj:set_attribute(attr, value) Lua call
* Add the obj:get_attribute(attr) Lua call

Examples:
* player:set_attribute("home:home", "10,25,-78")
* player:get_attribute("default:mana")

Attributes are saved as a json in the player file in extended_attributes
key

They are saved only if a modification on the attributes occurs and loaded
when emergePlayer is called (they are attached to PlayerSAO).
2017-01-27 08:59:30 +01:00
sfan5
a4f76cfa40 Initialize TileAnimationParams to prevent crashes/bugs for legacy invocations of add_particle{,spawner} (fixes #5108) 2017-01-24 15:19:29 +01:00
Loïc Blot
576308cb1d Revert "Detach the player from entities on death." (#5087) 2017-01-21 17:30:55 +01:00
sapier
8df666f56e Add Entity get_texture_mod() to Lua API
Send texture modifier to clients connecting later too
2017-01-21 17:01:02 +01:00