Commit Graph

4606 Commits

Author SHA1 Message Date
Dániel Juhász
57e5aa6628 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
Dániel Juhász
6d1e6f8898 Split light update into two parts
The common part can be reused.
2017-04-20 05:31:50 +02:00
Loïc Blot
f98bbe193e Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)
* Also remove 2 non declared but defined functions
* Make some functions around const ref changes const
2017-04-20 00:12:52 +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
Hybrid Dog
858c722974 Tools: Fix tool digging speed limit 2017-04-19 02:01:15 +01:00
Loïc Blot
cf37a55690 Fix various variables passed by copy instead of const ref (#5610)
Pointed by cppcheck
2017-04-19 00:36:30 +02:00
Loïc Blot
5f2af7c4e8 Fix broken lint since 04cc9de8f2fbcb11f133c88f02fc11504b3ea6f3 2017-04-18 17:13:50 +02:00
Auke Kok
93c1d511e3 Reorder TileSpec. (#5591)
Put accessed members that are needed by updateFastFaceRow()
all in the same cacheline.
2017-04-18 07:48:17 +02:00
Ekdohibs
eddf16eee9 Fix always using the xbox layout (reported by coverity). 2017-04-18 06:47:08 +02:00
Auke Kok
5433e9bd19 Don't make TAB exit game if bound to inventory.
I play with the TAB key bound to the inventory. However, the
code here assumes that TAB means "close formspec" in all contexts,
including the main menu. This causes my game to exit when I attempt
to TAB in between USERNAME and PASSWORD fields.

We know when m_client != NULL that the game is a client game and
not in the main menu, and then it's OK to use the INVENTORY bound
key to exit the formspec, since it's not the main menu.
2017-04-17 21:45:40 -07:00
SmallJoker
6120251320 Fix MSVC build broken by 34d32ce
`round` -> `myround`
Remove superflous `floor` calls
2017-04-17 14:02:26 +02:00
Perttu Ahola
04cc9de8f2 MeshUpdateQueue: Add a MapBlock cache that minimizes the amount of MapBlock copying done in the main thread
Cache size is configurable by the meshgen_block_cache_size (default 20 MB).

New profiler stats:
- MeshUpdateQueue MapBlock cache hit %
- MeshUpdateQueue MapBlock cache size kB

Removes one type of stutter that was seen on the client when received MapBlocks
were being handled. (the "MeshMakeData::fill" stutter)

Kind of related to at least #5239

Originally preceded by these commits, now includes them:
- Move the mesh generator thread into src/mesh_generator_thread.{cpp,h}
- mesh_generator_thread.cpp: Update code style
- MeshUpdateThread: Modify interface to house a different implementation: Actual functionality will be changed by next commits.
- MeshMakeData: Add fillBlockData() interface (so that caller can fill in stuff from eg. a MapBlock cache)
2017-04-17 14:58:29 +03:00
Perttu Ahola
4323ad163f Include container.h in util/thread.h. util/thread.h doesn't compile without it 2017-04-17 14:58:29 +03:00
paramat
f6da7b3fda 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
Loic Blot
907be0ab91
Remove an unused variable in Android Build 2017-04-17 09:37:12 +02:00
Auke Kok
97988a1044 Plug two minor Leaks (#5603)
* Resource leak: CHECK_FILE_ERR returns, without freeing chunk_name.

Found with static analysis.

* Resource leak: leaks `page` on error path.

Found with static analysis.
2017-04-17 09:04:58 +02:00
Loïc Blot
73de17afa8 Android progressbar fix (#5601)
* Fix progressbar for Android

Fixes #5599
Fixed #5403 

* draw_load_screen: use texturesource
  this permits to unify texture loading code
* scale progress bar

* Add gl version check for GL_OES_texture_npot. This fixed the texture on loading screen

* Remove two sanity checks pointed by @celeron55

* sfan5 comments + android ratio fixes
2017-04-16 14:44:15 +02:00
Loïc Blot
34d32ce55a Implement delayed server shutdown with cancelation (#4664) 2017-04-15 23:19:18 +02:00
SmallJoker
0f955bf7fa Minimap: Do a double-typecast to fix compiling with MSVC 2017-04-15 14:30:27 +02:00
Loïc Blot
a9aad4d061 Partial damage cheat fix: node damages server side (#4981)
* Damage cheat fix: server side

* Lava/Node damages overtime server side
* lava hurt interval is only for old protocol
2017-04-15 09:25:43 +02:00
Loic Blot
b1e6c2a9b8
NetworkPacket: don't copy push std::string and std::wstring 2017-04-14 18:26:24 +02:00
Loic Blot
093e621643
Fix wrong channel type in Client/Server CommandFactories
This is a u8 not a u16
2017-04-14 15:56:40 +02:00
Loïc Blot
b0be7ab61e ClientIface::sendToAll: honor packet configuration (#5590) 2017-04-14 15:34:01 +02:00
bigfoot547
e80a83d1cb [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
Dániel Juhász
6f641df8a5 Only use palette if param_type2 is correct 2017-04-13 09:52:48 -07:00
Dániel Juhász
021e667511 Add documentation for map block format 27 (#5576) 2017-04-13 10:19:46 +02:00
numberZero
83508277ce Fix inability to change metadata using stack:to_table() (#5547) 2017-04-12 16:51:07 +02:00
Loic Blot
1399678ffd
Fix fips_cipher_abort warning and other duplicate macros 2017-04-12 09:06:26 +02:00
t0ny2
a3e7372686 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
paramat
59911761ef Sneak glitch: Detect ledge for 2-node climb-up
Re-creates the old sneak-jump behaviour in new code.
Enabled by the 'sneak glitch' physics override.
When a ledge is detected the jump speed modifier is set to the larger
of 'physics override jump' and 1.3 to allow a 2-node climb-up.

An unexpected side-effect is the simple sneak ladder working smoothly.
2017-04-11 05:41:13 +01:00
Loïc Blot
0bc306e337 Clang-format fix for Android 2017-04-10 09:40:06 +02:00
Loïc Blot
b4106ca58f Clang-format styles fixes since previous commit 2017-04-10 09:17:53 +02:00
Loic Blot
0419552c92
Clang format: fix LINT on old PR which doesn't have LINT enabled 2017-04-10 08:05:03 +02:00
number Zero
0a8834608d Hard-coded undersampling.
Adds uniform undersampling for the 3D rendered scene. GUI elements
are not undersampled, resulting in better playability for users
with low-performance platforms with readable fonts and formspecs.

The undersampling setting can be set to 0 (disabled), 2, 3, 4 pixels
which translates into a resolution reduction of x4, x9 or x16, and
is significant.
2017-04-09 17:30:19 -07:00
Vincent Glize
8ad3dad137 LocalPlayer api lua 2017-04-08 22:04:30 -07:00
Dániel Juhász
58d83a7bb2 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
red-001
d4e9dd4643 Move chat command handling code from C++ to Lua (#5528) 2017-04-08 20:03:57 +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
Loic Blot
01f9d05f23
code style fix on src/script/cpp_api/s_client.h 2017-04-08 08:45:58 +02:00
Vincent Glize
f73534640a [CSM] Add event on_connect player API lua (#5540)
* Add event on_connect player API lua
2017-04-08 08:20:30 +02:00
Loic Blot
4af99b75cf
Pass clang-format on 14 trivial header files fixes
Also remove them from whitelist
2017-04-07 23:22:00 +02:00
rubenwardy
271d7c31e6 Fix signed/unsigned conversion warning
There was no bug here (as I checked for negativeness),
however it's good to get rid of warnings.
2017-04-07 19:06:50 +01:00
SmallJoker
c28a843592 Cavegen: Fix non-constant array initializer error for MSVC 2017-04-07 17:59:27 +02:00
SmallJoker
71ffe699d0 Settings: Update documentation (#5534)
Now documented (sorted a-z):
enable_console
enable_particles
creative_mode
hud_scaling
inventory_image_hack
keymap_console
keymap_zoom
shader_path
view_bobbing
2017-04-07 17:10:26 +02:00
Loic Blot
f7088f69ab
Clang-format: fix some header files and remove them from whitelist 2017-04-07 08:50:17 +02:00
adrido
676951d90d Windows: Skip cmd for release builds (#5416) 2017-04-07 07:14:39 +02:00
Auke Kok
94358a709b Fix "error: ‘playerSAO’ was not declared"
Cause: 351cc2e79a7d78f7ec97ff9b33e4f0bad4042b19

A rebase issue missed a rename from playerSAO to playersao.

Tested.
2017-04-06 22:05:31 -07:00
Ekdohibs
a5c9174bad Fix spacing 2017-04-06 21:27:29 -07:00
Ekdohibs
08b680d588 Fix problems when overriding the hand:
- If the hand can dig a node the item wielded can't, allow to dig it anyway.
- Fix the API callbacks from setting the hand instead of the wielded item.
2017-04-06 21:27:29 -07:00
rubenwardy
bce0d458d8 Add Joystick type detection and Xbox controller support
* Add joystick type detection (with joystick_type setting to override it)
* Fix multiple joysticks from interfering with each other by only reading from one (add joystick_id setting)
* Add support for Xbox controllers
2017-04-06 20:58:52 -07:00
presstabstart
351cc2e79a Fix multiple death messages (#5305)
Fix multiple death messages (#3565) and damage server logs after death.
2017-04-06 20:32:50 -07:00
orwell96
63e175dd70 Show media download progress in percent on progress screen (#5498) 2017-04-07 00:03:29 +02:00
Loïc Blot
3a90b78a03
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
88b9b9652a [CSM] Add function to get the server protocol version. (#5529) 2017-04-06 22:50:45 +02:00
Loïc Blot
be06636965 Clang-format continuation indent fixes + .gitignore additions
* Proper support for continuation indents in clang format
* make src/wieldmesh.h proper and remove it from whitelist
* Add CLion default build directories in .gitignore
2017-04-06 15:37:02 +02:00
Loic Blot
4b15f76ed1
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
4ee6be856d [CSM] Add support for positional audio. (#5516)
Fixes parts of #5389.
2017-04-06 08:14:31 +02:00
Loïc Blot
54ffc4e915 Memleak fix: LocalPlayer object was not deleted
Delete LocalPlayer when ClientEnvironment (object owner) is destroyed
2017-04-05 12:30:52 +02:00
paramat
1eca9ecf7d Mapgen: Remove '#include treegen.h' from non-mgv6 mapgens
Only mgv6 uses the tree functions from treegen.cpp.
2017-04-05 07:30:00 +01:00
Paramat
b8a4c95971 MapgenBasic: Add lava source as commonly used content (#5512)
Future mapgens are likely to use this for magma and volcanos.
Remove the getting of lava source content id in mgvalleys.
2017-04-04 07:51:58 +02:00
Loïc Blot
563199698d Client handlers: Remove useless stringstream usage in two handlers (#5510) 2017-04-04 07:47:04 +02:00
red-001
000ec26001 [CSM] Add local node meta reference. (#5508) 2017-04-04 07:41:37 +02:00
paramat
859141a0ce Cavegen/Mgv5/Mgv7: Add optional giant caverns
Add to MapgenBasic for use by multiple mapgens.
Add to mgv5 and mgv7, enabled by default.

Similar to mgvalleys caverns but half the scale.
Parameters for upper y limit, distance caverns taper to full size, and
noise threshold (full cavern size).
As with mgvalleys caverns are generated first and classic caves are
disabled in any mapchunk containing a cavern, to avoid excessive
spreading volumes of liquids.
This also avoids floating blobs of liquid where a large classic cave
has overgenerated out into a neighbouring previously-generated mapchunk.
2017-04-03 04:49:32 +01:00
Loïc Blot
86b1542181 Update embedded jsoncpp from unk version to 0.10.6 + move libs to lib/ instead of src/ (#5473)
* Update embedded jsoncpp from unk version to 0.10.6

0.10.6 is last release without c++11

* Make jsoncpp more compliant with its amalgamate

Jsoncpp cpp file should be upper, make the library like it does in amalgamate

* Reorganization: move minetest embedded libs outside of source tree to /lib

* Fix a dead grep in LINT
2017-04-02 10:51:50 +02:00
Loïc Blot
987eb2b761 Clang-format: trivial fix on some headers (#5495)
Fix some headers style and remove them from whitelist
2017-04-01 14:48:16 +02:00
red-001
63ac62ec8a [CSM] Add function and chat command to disconnect from server. (#5487) 2017-04-01 13:40:56 +02:00
number Zero
813a9a36b2 Signlike, glasslike drawtypes: Fix inverted textures 2017-04-01 10:08:28 +01:00
SmallJoker
773efc19b1 mapgen: Fix segfault when selecting invalid mapgen (#5491) 2017-04-01 10:18:13 +02:00
Loic Blot
a4874270f7
Fix clang-format Columns Width
Also fix l_client.cpp/h and remove them from whitelist
2017-03-31 22:29:34 +02:00
kilbith
529ba8002d
Wieldmesh: Natural orientation depending on pitch (#5490) 2017-03-31 22:00:05 +02:00
adrido
cc1ff26c3f Windows: Set window icon (#5486) 2017-03-30 20:28:37 +02:00
paramat
ea549bbae3 Paramtype2: Add missing type CPT2_GLASSLIKE_LIQUID_LEVEL
Add the missing paramtype2 for param2 controlling the liquid level
inside the glasslike_framed drawtype.
Add missing documentation of the feature to lua_api.txt.
Update and improve comments for drawtype enumerations in nodedef.h.
2017-03-30 04:52:54 +01:00
Loïc Blot
fbc1432fe8 l_minimap: don't show minimap if configuration doesn't allow it 2017-03-29 15:50:22 +02:00
Loïc Blot
b605b95749 Add CPP11 header to define nullptr & constexpr (#5471)
This header permit to use nullptr & constexpr keywords in portable code segments and benefit from nullptr & constexpr when using C++11 and greater
2017-03-29 13:34:57 +02:00
sfan5
5e806690fc Sneak: Fix sneaking on free-floating lower-half slabs 2017-03-29 10:19:49 +02:00
sfan5
b85301ce69 Sneak: Fix stair lower step bug and ladder in 1x1 hole bugs 2017-03-29 00:51:13 +01:00
Loïc Blot
a9878a0da5 PostgreSQL: fix delete block
Typo fix: we are doing select on delete block.

This fix issue #5426
2017-03-27 15:03:13 +02:00
paramat
ec0c4d33db Map generation limit: Make per-world
The setting limits map generation but affects nothing else.
Add 'mapgen_limit' to global mapgen parameters.
Move 'blockpos_over_mapgen_limit()' to the only place it is called
from: map.cpp.
Allow teleportation to any part of the world even if over the set
mapgen limit.
Simplify the reading of this limit in mgvalleys.
Remove the 'map_generation_limit' setting.
2017-03-27 03:18:09 +01:00
Diego Martínez
09f2cd0264 Pathfinder: Send errors to warningstream.
Avoids spamming the chat about several errors.
2017-03-27 03:17:37 +01:00
Loic Blot
53d1b3d924
Fix mismatch struct/class for GameUIFlags 2017-03-26 18:54:39 +02:00
sfan5
1139a18c3a Sneak: Replicate sneak ladder in new code, is optional
Enabled using the existing 'sneak_glitch' physics override.
2017-03-26 05:53:30 +01:00
red-001
e70e15134c Change command prefix to "." and add "help" command. 2017-03-26 05:51:14 +01:00
number Zero
4d5177ff70 Add mesh generation delay 2017-03-26 05:50:59 +01:00
Loïc Blot
22567d107f Add clang format & skip build if no source file modified (#5433)
* [BUILD] Add clang format + build skipping

* Add clang-format tool to check codestyle.
Warning: it check the whole modified file, not the diff part, it's why it's lazy. Please also look if rules are perfect, i take the Linux codestyle from LLVM site

Fix issue #5415

* Skip building project if no file is modified
* Fix a wrong brace to trigger LINT

* Make lint step outside of unix build scope

* Add AccessModifierOffset: -8

* Typo fix & needs compile fix

* Fix header priorities
2017-03-25 19:12:18 +01:00
SmallJoker
5a59ad2307 Tile.cpp: Fix MSVC build broken by 072bbba 2017-03-24 20:05:15 +01:00
Loïc Blot
072bbba69a Some performance optimizations (#5424)
* Some performance optimizations

This is globally removing some memory useless copy

* use a const ref return on std::string Settings::get to prevent data copy on getters which doesn't need to copy it
 * pass some stack created strings to static const as they are not modified anywhere
 * Camera: return nametags per const ref instead of a list pointer, we only need to read it
 * INodeDefManager: getAll should be a result ref writer instead of a return copy
 * INodeDefManager: getAlias should return a const std::string ref
 * Minimap: unroll a Scolor creation in blitMinimapPixersToImageRadar to prvent many variable construct/destruct which are unneeded (we rewrite the content in the loop)
 * CNodeDefManager::updateAliases: prevent a idef getall copy
 * Profiler: constness
 * rollback_interface: create real_name later, and use const ref
 * MapBlockMesh updateFastFaceRow: unroll TileSpec next_tile, which has a cost of 1.8% CPU due to variable allocation/destruction,
 * MapBlockMesh updateFastFaceRow: copy next_tile to tile only if it's a different tilespec
 * MapBlockMesh updateFastFaceRow: use memcpy to copy next_lights to lights to do it in a single cpu operation
2017-03-22 21:41:02 +01:00
bigfoot547
9efc5da0fb [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
number Zero
d4e0c0f9b8 Content_mapblock.cpp: Refactor 2017-03-20 20:28:22 +00:00
Ben Deutsch
e7246d3f0d Refactored client event if-else cascade to switch statement 2017-03-20 18:35:33 +00:00
paramat
d3131aeae7 Map generation limit: Rewrite
The previous implementation applied the setting to blockpos_over_limit(),
objectpos_over_limit() and in createSector(), causing many bugs near the
world edge.

First revert the previous implementation.
Rename blockpos_over_limit() to blockpos_over_max_limit() for clarity.
Add a new function to mapblock.h called blockpos_over_mapgen_limit() that
checks against the map_generation_limit setting, and call this only from
the code that decides where mapgen stops.
Use MAX_MAP_GENERATION_LIMIT in objectpos_over_limit() to reduce the
chance of bugs, there is no need to use map_generation_limit here.
2017-03-20 18:34:18 +00:00
sfan5
525d2a0d51 Fix /shutdown or ^C no longer causing server exit
Broken since b8484ef24e8e1ec90a2967372808ab2bea538c7c
2017-03-19 18:21:18 +01:00
Loïc Blot
3c4ac70348 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
red-001
2e3778ec0c Block access to the io library 2017-03-19 12:34:33 +01:00
Loïc Blot
f8ad01ab7c Update server min protocol version to v24 (#5411)
* Update server min protocol version to v24

It's based on @sfan5 stats. See https://kitsunemimi.pw/tmp/serverlist_stats_2017-03-17.txt

v24 was bumped 25/08/14 and 0.4.11 was released 25/12/14

* Drop protocol v23 and lesser code
2017-03-19 08:44:29 +01:00
ShadowNinja
b8484ef24e Server list cleanup
This removes the hacky server_dedicated pseudo-setting.
2017-03-18 12:37:57 +01:00
Wuzzy
2cc518dcaf Show itemstring as tooltip if no item description 2017-03-18 12:36:28 +01:00
Loic Blot
9f4916a452
TOGGLE_CHAT keymap should togglechat not HUD
Fixes #5413
2017-03-18 10:00:04 +01:00
Loïc Blot
a7485e40ff Reduce memory & function cost of Game class functions (#5406)
GameRunData is passed on many game functions, or one of its attributes whereas it's a member of the class. Remove it from functions arguments and call object directly from concerned functions.
This will reduce a little bit the Game class loop usage & very little bit the memory usage (due to non creation of pointer/references)
2017-03-17 22:15:25 +01:00
zeuner
ba0a8dabef avoid crashing when accessing mapgen early (#5384) 2017-03-17 21:28:43 +01:00
Loïc Blot
7b74f04a61 [CSM] Fix minimap problems (#5405)
This fixes issue #5404
2017-03-17 07:54:49 +01:00
Loïc Blot
0891975ad6 [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
b52f3005c3 Fix indentation problem since merge resolution
Github merge conflict resolution is not the best with indent
2017-03-16 11:09:06 +01:00
Loïc Blot
40ce538aad [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
eb88e5dd4b 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
46276414ed 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
sfan5
14aa990cdd Sneak: Fix various problems with sneaking
Sneaking won't actually hover you in the air, releasing shift guarantees not
falling down (same as in MC).
Sneak-jump no longer goes higher than a normal jump (^ was required for this).
Sneaking no longer avoids fall damage.
You can sneak on partial nodes (slabs, sideways slabs) correctly.
Sneaking doesn't "go out" as far anymore (0.29 instead of 0.4).
Can't jump when sneaking out as far as possible (breaks the sneak ladder).
2017-03-16 02:52:59 +00:00
Lars Hofhansl
454483f266 Use true distance for block priority. 2017-03-15 20:30:34 +01:00
red-001
88df9fb5b6 Add get_wielded_item 2017-03-13 23:56:05 +01:00
nerzhul
44ca9c9cb2 [CSM] Add enable_client_modding param (default: false) 2017-03-13 23:56:05 +01:00
red-001
0727bb3ddd [CSM] Add on_punchnode callback 2017-03-13 23:56:05 +01:00
red-001
37df9cb7d7 [CSM] Add get_node and get_node_or_nil 2017-03-13 23:56:05 +01:00
red-001
073f5cf03d [CSM] Add on_dignode callback (#5140) 2017-03-13 23:56:05 +01:00
Loic Blot
ba66fce833 [CSM] storage + fixes 2017-03-13 23:56:05 +01:00
red-001
a50d07d39a [CSM] Improve security for client-sided mods (#5100) 2017-03-13 23:56:05 +01:00
Loïc Blot
92b45b2a18 [CSM] implement client side mod loading (#5123)
* client side mods are located in clientmods/
* move builtin/preview.lua to clientmods/preview/init.lua as a preview mod
* refactor ModConfiguration class to work properly with client and server using child objects
* move some Server constructor mod load code to ModConfiguration to reduce code duplication between client and server
* remove mods.{cpp,h} unused functions
* use UNORDERED_SET instead of std::set in some modspec storages
2017-03-13 23:56:05 +01:00
red-001
c42c53fccf [CSM] Add local formspecs. (#5094) 2017-03-13 23:56:05 +01:00
Loïc Blot
2c19d51409 [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
d7bc346981 [CSM] Add client-sided chat commands (#5092) 2017-03-13 23:56:05 +01:00
Loïc Blot
9978f5af82 [CSM] Add on_death, on_hp_modification & oh_damage_taken callbacks (#5093)
* Add on_death callback
* Add on_hp_modification & on_damage_taken callbacks
* move preview code to preview.lua
2017-03-13 23:56:05 +01:00
red-001
cb3a61f8db [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
2efae3ffd7 [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
kilbith
c9492b4d37 GUI: Allow texture packs to customize the progress bar (#5368) 2017-03-13 08:07:14 +01:00
Lars Hofhansl
ff80696947 Enable server side occlusion culling by default. 2017-03-11 18:11:19 -08:00
Lars Hofhansl
ba4b704ebf Allow server side occlusion culling. 2017-03-11 18:11:19 -08:00
Auke Kok
6738c7e9a3 Do not increase breath if at full breath.
Prevents the server from sending TOCLIENT_BREATH packets
every 0.5seconds, if there is no reason to.
2017-03-11 17:00:40 -08:00
sfan5
f83d8687a7 database-redis: Support password authentication 2017-03-11 21:39:32 +01:00
paramat
d34f149bdc Climb speed: Increase default setting from 2 to 3 2017-03-11 02:17:16 +00:00
number Zero
25a24c0cdf Minimap: Optimise 2017-03-11 02:15:21 +00:00
Dániel Juhász
ab371cc934 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
kilbith
2baa191a64 GUI: Convert loading screen's progress bar to image (#5362) 2017-03-10 13:26:24 +01:00
paramat
e10e5fd16c Dungeons: Use 'block' instead of 'brick' for nodebox stairs
Affects only sandstone dungeons. Nodebox stairs made from
'sandstone_block' look better because every step is undivided.
2017-03-05 09:47:03 +00:00
Auke Kok
f1ab42fdff Font: attempt fallback font, abort if no fonts found.
If you happen to have a font_path setting that is incorrect,
minetest will just attempt to start the gui without a valid
font which leads to a segfault later on.

We can attempt to load the fallback font path fairly easy,
but if that fails we should give up with a proper error message
and not a weird segfault later. This forces an abort() if
the fallback fails as well, and prints a useful error
message to the console.
2017-03-05 09:46:52 +00:00
adelcoding1
6de83a2756 FormSpec: Add position and anchor elements (#5284) 2017-03-04 10:46:55 +01:00
paramat
a901a56859 Dungeongen: Add and improve parameters
Add:
Bool for 'only_in_ground'.
Min and max corridor length.
Min and max room size with X, Y, Z components.
Min and max large room size with X, Y, Z components.

'only_in_ground = false' allows core mapgens to create structures
in air and water using dungeongen.
Corridor length parameters replace a fixed random range.
Room size parameters replace the former system where one parameter
'roomsize' was added to fixed random ranges.

All parameters are set for no change to current dungeon behaviour.

Remove some now-redundant and long-unused code.
2017-02-26 06:46:14 +00:00
rubenwardy
2d1fca51e9 Fix wrong meta key in item meta on ItemStack construction 2017-02-22 10:14:12 -08:00
Dániel Juhász
00123ee04d Fixes for colorwallmounted and colorfacedir nodes
Correct node placement prediction for attached colorwallmounted nodes.
Correct placement direction for colorfacedir and colorwallmounted nodes.
Correct detatch mechanism for attached colorwallmounted nodes.
2017-02-18 22:47:24 +00:00
paramat
111e7e1cc8 Voxelmanip: Do not emerge or blit to blocks over map gen limit
Placing a structure that extends into mapblocks that extend past
map_gen_limit causes a crash. For example a sapling growing at the
world edge which adds leaves beyond the edge, or placing a structure
using the lua voxelmanip, or placing a schematic or l-system tree.

Do not run the 'load_if_inexistent' block of code if the mapblock
is over limit, this also marks the mapblock with the flag
VMANIP_BLOCK_DATA_INEXIST which later prevents blitting back those
mapblocks.

This fix therefore uses existing functionality by having the same
effect as the 'load_if_inexistent' bool being false.
2017-02-18 22:47:24 +00:00
red-001
d988f9b769 Use the ARRLEN macro in more places and remove an unused macro. (#5260) 2017-02-18 15:24:49 +01:00
Auke Kok
d0ce27edd8 Revert part of eb49009d023e6e3b5d59a97b8fb5fed5eee83296 (#5230)
This reverts the removal of Droid Sans as fallback font. The
license for this font used to be GPL2. I've updated the font
files to Liberation 2.00, which are SIL, and do not require
us to ship source code.

I've attempted to fix all the attribution and license strings,
and used the strings as provided by redhat for attribution
to make sure they're correct.

Last, I've removed a bunch of executable bits on files that do
not need them.

Fixes #5231
2017-02-16 20:18:22 -08:00
paramat
9aabfd5188 Cavegen: Place correct biome surface in tunnel entrances
Previously in tunnel entrance floors only a single biome 'top' node was
placed and 'filler' nodes were missing.

Place 'top' and 'filler' nodes in tunnel entrance floors with depths
defined by the biome.
In tunnel entrances under rivers 'riverbed' nodes are placed to the
biome-defined depth.
2017-02-16 22:25:14 +00:00
paramat
3955f51253 Objectpos over limit: Avoid crash caused by sector over limit
Reduce the object limit by mapblock size, to avoid objects being
added just inside the map generation limit but in a block and sector
that extend beyond the map generation limit.

Change notification of 'objectpos over limit' from red in-chat ERROR
to in-terminal only WARNING, since this will happen often using mob
mods near the world's edge.
2017-02-16 22:25:07 +00:00
red-001
2dcbc01904 Fix a small regression caused by e2ad76f. 2017-02-16 12:59:19 +01:00
sfan5
a5e4273575 Fix >5 year old PlayerSAO deletion bug
force_delete=true is usually set at shutdown in order to
also remove PlayerSAOs, however when too many objects
per block are detected force_delete is also set to true.
This was intended only for the current loop iteration but
obviously persisted to the next iterations thereby
deleting all other remaining SAOs.
2017-02-15 17:36:47 +01:00
Auke Kok
eb49009d02 FreeType: address font license issues (#5230)
It appears we were shipping font files without license text, and I
had my doubts about the bitmap fonts being usable directly.

This replaces existing TTF fonts with Apache-2.0 licensed fonts from
chome core (Cousine, Arimo, Tinos). Include the full license file
for all three fonts.

The Lucida Sans font bitmap is removed entirely for non-freetype
builds. There is therefore only mono fonts for non-freetype builds.
2017-02-14 01:08:17 -08:00
Dániel Juhász
f17c9c45dc Lighting: Update lighting at block loading
This commit updates mapblocks' light if necessary when they are loaded.
This removes ghost lighting.
2017-02-13 00:05:49 +00:00
paramat
984e063374 Footsteps: Fix offset footstep and shallow water sound bugs
Fix footstep sounds coming from nodes to either side when walking on a
1 node wide row of nodebox slabs such as default:snow.
Fix sand footsteps when swimming in 1 node deep water.

Use a new function 'getFootstepNodePos()' instead of 'getStandingNodePos()'
to avoid using a horizontally-offset 'sneak node' for sounds.

Sound is selected from the node BS * 0.05 below the player's feet, so
that 1/16th slabs will play the slab sound but 1/32nd slabs will not.
If the player is not 'touching ground' the node detection position is
changed to BS * 0.5 below to preserve footstep sounds when landing after
a jump or fall.
2017-02-12 01:52:12 +00:00
paramat
1de08e1961 Plantlike: Fix visual_scale being applied squared
This re-applies 2 commits that were reverted.

Visual_scale was applied twice to plantlike by accident sometime between
2011 and 2013, squaring the requested scale value. Visual_scale is
correctly applied once in it's other uses in signlike and torchlike.

Two lines of code are removed, they also had no effect for the vast
majority of nodes with the default visual_scale of 1.0.
The texture continues to have it's base at ground level.

Send sqrt(visual_scale) to old clients.

Keep compatibility with protocol < 30 clients now that visual_scale
is no longer applied twice to plantlike drawtype and mods are being
updated to a new value.
2017-02-10 17:59:31 +00:00
Craig Robbins
7760948b7c Revert "Plantlike: Fix visual_scale being applied squared (#5115)"
This reverts commit 953cbb3b15997a0e7c7c32af2365cb5046a9e476.
2017-02-10 22:21:49 +10:00
Craig Robbins
7bd3e2bceb Revert "Plantlike visual scale: Send sqrt(visual_scale) to old clients"
This reverts commit cdc538e0a242167cd7031d40670d2d4464b87f2c.
2017-02-10 22:21:23 +10:00
Auke Kok
5707b739f3 Change default nodetimer_interval to 0.2s. (#5193)
We want to reduce the chance that we get lots and lots of node
timers all happening once a second, because we're better off doing
small bits of work as they are available.

Reducing this to 0.2 seconds will greatly reduce the total amount
of nodetimers that elapse at the same instance, while not effecting
total work load. This results in a far better chance of the server
keeping up with work loads.
2017-02-09 08:00:37 +01:00