Commit Graph

154 Commits

Author SHA1 Message Date
Muhammad Rifqi Priyo Susanto a1e1a19ac3 Improvements/fixes for noise parameter input in advanced settings
Formspec input for each individual noise parameter and flag.
Allow noise flags to be set in advanced settings, previously only settable
in minetest.conf.

Standardise 'group format' for noise parameters set in minetest.conf, as
only these support noise flags. However the older 'single line' format is
still accepted to support existing minetest.conf files.
Therefore auto-generate minetest.conf.example with noise parameters in
'group format'.

Setting 'type' in settingtypes.txt is now either 'noise_params_2D' or
'noise_params_3D', the dimension number is displayed in the advanced
settings edit page.
2017-10-23 01:28:13 +01:00
Vitaliy 75320e7e88 Real global textures (#6105)
* Real global textures

* Add world-aligned textures
* Update minimal to support world-aligned tiles
* Update minimal
2017-10-15 09:34:14 +02:00
orwell96 08846cd05c Add static_save property to luaentites to not save them statically. (#5112)
* Add no_static_save property to luaentites to not save them statically.
This allows for temporary objects that would get deleted anyway as soon as they are loaded again without the static saving overhead.

* Use positive meaning for static_save object property

* Invert meaning also for the LUA parameter
Note: getboolfield() does not change &result when field does not exist, so it defaults to the default value in the header file, which is 'true'.

* Extend push_object_properties()
2017-09-28 17:11:51 +02:00
SmallJoker edbc533414 Customizeable max breath for players (#6411)
* Customizeable maximal breath for players
2017-09-15 12:18:47 +02:00
Rob Blanckaert a9d43a0471 Object properties: Add 'glow', disables light's effect if negative
The 'glow' value is added to the ambient light value.
Negative 'glow' disables light's effect on object colour, for faking
self-lighting, UI-style entities, or programmatic colouring in mods.
2017-09-14 04:06:05 +01:00
Auke Kok 5b3fbf9cf7 Implement client node dig prediction
Dig prediction allows clients to remove dug nodes without
waiting for server acknowledgement.
This patch allows mods to override dig prediction,
it can either be turned off or a different "prediction node"
can be selected.
2017-09-11 20:54:20 +02:00
SmallJoker 5f489efc69 Object properties: Fix loss of custom selectionbox
Only adjust it to the collisionbox value when the collisionbox was really set.
2017-09-10 20:26:03 +02:00
paramat 561a01cc2a Zoom: Move enabling zoom to a new player object property
Default enabled for no change in default behaviour.
Remove 'zoom' privilege.
2017-08-30 19:39:05 +01:00
Dániel Juhász f6a33a1a7a Overlays for wield and inventory images (#6107)
* Overlays for wield and inventory images
2017-08-25 13:20:53 +02:00
stujones11 ac4884c3d6 Make entity selection and collision boxes independently settable (#6218)
* Make entity selection and collision boxes independently settable
2017-08-24 10:01:16 +02:00
SmallJoker f7d50a8078 Respect object property hp_max field for players (#6287)
* Respect object property hp_max field for players
This allows modders to configure the maximal HP per player

* Statbars: Downscale bar to full 20 HP when exceeding this value
Add default max HP for players and breath constants to builtin
Document the constants

* Rename PLAYER_MAX_HP -> PLAYER_MAX_HP_DEFAULT
2017-08-23 22:32:10 +02:00
Loïc Blot 1c1c97cbd1 Modernize source code: last part (#6285)
* Modernize source code: last par

* Use empty when needed
* Use emplace_back instead of push_back when needed
* For range-based loops
* Initializers fixes
* constructors, destructors default
* c++ C stl includes
2017-08-20 13:30:50 +02:00
number Zero ef285b2815 Add 'plantlike_rooted' drawtype
Useful for underwater plants.
Node consists of a base cube plus a plantlike extension that can pass through
liquid nodes above without creating air bubbles or interfering with liquid flow.
Uses paramtype2 'leveled', param2 defines height of plantlike extension.
2017-07-11 01:02:22 +01:00
Rui ff73c7a5da Sound: Add pitch option (#5960)
* Sound: Add pitch option
2017-06-11 13:58:26 +02:00
Loïc Blot a98baef5e4 C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821) 2017-06-04 21:00:04 +02:00
bigfoot547 dfa0c15ce0 [CSM] Add function to get the definition of items (#5732)
Add node def and item def documentation.

Please be ready for merge!
2017-05-21 14:40:55 +02:00
red-001 772944daf6 Fix CSM crash (#5779)
Caused by dc5bc6c and them made worse by 5ebf8f9
2017-05-20 16:45:49 +02:00
Brandon bd921a7916 Sound API: Add fading sounds 2017-05-03 03:12:45 +01:00
Vincent Glize dc5bc6cac7 [CSM] Add event on_place_node API lua (#5548)
* [CSM] Add event on_place_node API lua
2017-04-29 12:08:16 +02:00
Dániel Juhász 1ffb180868 Soft node overlay (#5186)
This commit adds node overlays, which are tiles that are drawn on top of
other tiles.
2017-04-21 23:34:59 +10: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
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 88df9fb5b6 Add `get_wielded_item` 2017-03-13 23:56:05 +01:00
rubenwardy 2d1fca51e9 Fix wrong meta key in item meta on ItemStack construction 2017-02-22 10:14:12 -08: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
Dániel Juhász d04d8aba70 Add hardware node coloring. Includes:
- Increase ContentFeatures serialization version
- Color property and palettes for nodes
- paramtype2 = "color", "colored facedir" or "colored wallmounted"
2017-01-23 07:27:12 +01:00
sfan5 7279f0b373 Add particle animation, glow
This is implemented by reusing and extending the
TileAnimation code for the methods used by particles.
2017-01-18 23:21:01 +01:00
sfan5 a07b032245 Add 2D sheet animation for nodes 2017-01-02 15:28:06 +01:00
sfan5 523f0e8c5b Move TileAnimation code to seperate file 2017-01-02 15:28:06 +01:00
juhdanad 2fe3bf5a18 Limit light_source in the engine (#4814)
Since light_source>15 causes crash, it must be limited.
2016-11-28 18:43:33 +10:00
sfan5 5fd1ef9b58 Revert "Adding particle blend, glow and animation (#4705)"
This reverts commit 93e3555eae.
2016-11-14 15:28:06 +01:00
Foghrye4 93e3555eae Adding particle blend, glow and animation (#4705) 2016-11-15 00:09:59 +10:00
Loic Blot 613797a304 Replace various std::map with UNORDERED_MAP + various cleanups
This is part 2 for 5f084cd98d

Other improvements:

* Use the defined ItemGroupList when used
* make Client::checkPrivilege const
* inline some trivial functions
* Add ActiveObjectMap typedef
* Add SettingsEntries typedef
2016-10-05 10:53:19 +02:00
Loic Blot 5f084cd98d Make some maps unordered to improve performance
* This permit to improve performance on C++11 builds
* use some existing typedefs in tools maps
* minor code style changes
2016-10-05 07:30:32 +02:00
SmallJoker 2de8c22a99 Make getStackMax return the correct maximal stack size 2016-09-08 03:37:03 -04:00
Rogier-5 4503b5097f Fixes for compiling with a newer (system) jsoncpp (#4429)
* Move included json code to jsoncpp subdirectory

This is needed to avoid having to specify the minetest src directory
as a system include when fixing the json includes.

* Fix json includes

They used "", so that the compiler searches the project's directory
first. The result was that when compiling with a system jsoncpp,
the project's own version of json.h was still included, instead of
the system version.

The includes now use <>, so a system location, or one specified with
'-Ilocation' is searched only.

* Fix for jsoncpp deprecated function warning

When compiling with a newer version of jsoncpp (and
ENABLE_SYSTEM_JSONCPP=true), jsoncpp emits a warning
about a deprecated function that minetest uses.
2016-08-10 12:10:00 +02:00
Auke Kok 37b4f0d34c Allow nodes to specify which sides to connect to.
NDT_CONNECTED attempts to connect to any side of nodes that it can
connect to, which is troublesome for FACEDIR type nodes that generally
may only have one usable face, and can be rotated.

We introduce a node parameter `connect_sides` that is valid for
any node type. If specified, it lists faces of the node (in "top",
"bottom", "front", "left", "back", "right", form, as array) that
connecting nodeboxes can connect to. "front" corresponds to the south
facing side of a node with facedir = 0.

If the node is rotatable using *simple* FACEDIR, then the attached
face is properly rotated before checking. This allows e.g. a chest
to be attached to only from the rear side.
2016-03-12 12:08:17 -05:00
Auke Kok e737b1c271 Nodebox: Allow nodeboxes to "connect"
We introduce a new nodebox type "connected", and allow these nodes to
have optional nodeboxes that connect it to other connecting nodeboxes.

This is all done at scenedraw time in the client. The client will
inspect the surrounding nodes and if they are to be connected to,
it will draw the appropriate connecting nodeboxes to make those
connections.

In the node_box definition, we have to specify separate nodeboxes for
each valid connection. This allows us to make nodes that connect only
horizontally (the common case) by providing optional nodeboxes for +x,
-x, +z, -z directions. Or this allows us to make wires that can connect
up and down, by providing nodeboxes that connect it up and down (+y,
-y) as well.

The optional nodeboxes can be arrays. They are named "connect_top,
"connect_bottom", "connect_front", "connect_left", "connect_back" and
"connect_right". Here, "front" means the south facing side of the node
that has facedir = 0.

Additionally, a "fixed" nodebox list present will always be drawn,
so one can make a central post, for instance. This "fixed" nodebox
can be omitted, or it can be an array of nodeboxes.

Collision boxes are also updated in exactly the same fashion, which
allows you to walk over the upper extremities of the individual
node boxes, or stand really close to them. You can also walk up
node noxes that are small in height, all as expected, and unlike the
NDT_FENCELIKE nodes.

I've posted a screenshot demonstrating the flexibility at
    http://i.imgur.com/zaJq8jo.png
In the screenshot, all connecting nodes are of this new subtype.

Transparent textures render incorrectly, Which I don't think is
related to this text, as other nodeboxes also have issues with this.

A protocol bump is performed in order to be able to send older clients
a nodeblock that is usable for them. In order to avoid abuse of users
we send older clients a "full-size" node, so that it's impossible for
them to try and walk through a fence or wall that's created in this
fashion. This was tested with a pre-bump client connected against a
server running the new protocol.

These nodes connect to other nodes, and you can select which ones
those are by specifying node names (or group names) in the
connects_to string array:
      connects_to = { "group:fence", "default:wood" }
By default, nodes do not connect to anything, allowing you to create
nodes that always have to be paired in order to connect. lua_api.txt
is updated to reflect the extension to the node_box API.

Example lua code needed to generate these nodes can be found here:
    https://gist.github.com/sofar/b381c8c192c8e53e6062
2016-03-12 12:08:17 -05:00
Auke Kok 882a89d65a Allow per-tiles culling.
Backface culling is enabled by default for all tiles, as this
is how the lua parser initializes each tiledef. We revert to
always using the value from the tiledef since it is always
read and serialized.

Mods that wish to enable culling for e.g. mesh nodes, now can
specify the following to enable backface culling:

    tiles = {{ name = "tex.png", backface_culling = true }},

Note the double '{' and use of 'name' key here! In the same
fashion, backface_culling can be disabled for any node now.

I've tested this against the new door models and this properly
allows me to disable culling per node. I've also tested this
against my crops mod which uses mesh nodes where culling needs
to be disabled, and tested also with plantlike drawtype nodes
where we want this to continue to be disabled.

No default setting has changed. The defaults are just migrated
from nodedef.cpp to c_content.cpp.
2016-01-20 00:36:48 +00:00
RealBadAngel 87291ea44a Show infotext with description for item entities 2016-01-18 17:21:41 +00:00
paramat 0bbbc6e13d Liquids: Flow into and destroy 'floodable' nodes
Add new node property 'floodable', default false
Define "air" as floodable = true in C++ and lua
2016-01-07 05:57:19 +00:00
Sapier 25d128da36 Revert "Add support for using arbitrary meshes as items"
This reverts commit 91bafceee6.

Reverted due to missinterpretation of agreement, obvious dislike and me not interested in doing fights for feature I don't actually need
2015-12-29 19:53:38 +01:00
Sapier 91bafceee6 Add support for using arbitrary meshes as items 2015-12-29 16:27:06 +01:00
Sapier 5de8e026a3 Fix lua object:get_properties() being broken 2015-12-21 00:27:13 +01:00
est31 f192a5bc43 Fix missing pop
Previous commit

70ea5d552e "Add support for limiting rotation of automatic face movement dir entitys"

by sapier has broken minetest's feature to open worlds. This was due to a
missing stack pop operation.

Thanks to @oleastre for reporting this bug and suggesting the fix.
2015-12-20 03:36:47 +01:00
Sapier 70ea5d552e Add support for limiting rotation of automatic face movement dir entitys 2015-12-19 17:00:36 +01:00
BlockMen 9eee3c3f46 Add option to give every object a nametag
or change the nametag text of players
2015-12-15 23:32:19 +01:00
BlockMen 2a12579fab Add support for audio feedback if placing node failed 2015-11-07 13:23:38 +01:00
BlockMen 50ba7e114d Add option to disable backface culling for models
- Disabled by default (except players)
- Fixes #2984
2015-10-25 12:06:08 +01:00
ShadowNinja 7b8d372947 Use warningstream for deprecated field messages and refactor log_deprecated 2015-10-15 01:14:38 -04:00
RealBadAngel 3295f3c401 Fix tiling issues for PLANTLIKE and FIRELIKE with FSAA 2015-08-05 22:52:32 +02:00
RealBadAngel 655fc6010f Fix relief mapping issues 2015-07-16 15:36:48 +02:00
kwolekr 7b171ea2be Fix code style from recent commits and add misc. optimizations 2015-07-02 23:14:30 -04:00
TeTpaAka c0335f7d13 Add some missing getter functions to the lua API
ObjectRef:
get_properties
get_armor_groups
get_animation
get_attach
get_bone_position

Players:
get_physics_override
hud_get_hotbar_itemcount
hud_get_hotbar_image
hud_get_hotbar_selected_image
get_sky
get_day_night_ratio
get_local_animation
get_eye_offset

Global:
minetest.get_gen_notify
minetest.get_noiseparams
2015-05-28 16:46:35 +02:00
kwolekr fb36c471d7 SAPI: Accept either ARGB8 table or ColorString to specify colors 2015-05-16 20:15:03 -04:00
kwolekr 3d4244cc75 Add 'persistence' alias for Lua noiseparams and validate more vector parameters 2015-04-19 21:42:40 -04:00
ShadowNinja d75a0a7394 Don't use luaL_checkstring to read node names, it's only for arguments
This caused confusing error messages like "argument #4 to set_node is not a string."
2015-03-07 20:04:01 -05:00
kwolekr 6fdb32361a Remove freezemelt (the remainder of proller nonsense) 2015-01-04 03:30:10 -05:00
kwolekr dcc48976ce Move get_schematic and read_schematic to l_mapgen.cpp 2014-12-10 01:49:57 -05:00
kwolekr cfba55ba0a Remove get_noiseparams function. read_noiseparams should be used from now on 2014-12-10 00:56:44 -05:00
kwolekr 2fd3d52020 Add flags and lacunarity as new noise parameters
Add 'absolute value' option to noise map functions
Extend persistence modulation to 3D noise
Extend 'eased' option to noise2d_perlin* functions
Some noise.cpp formatting fixups
2014-12-07 21:59:32 -05:00
kwolekr 390c0cd691 Schematics: Fix minetest.place_schematic() when defined by a Lua table 2014-12-06 18:39:05 -05:00
Ciaran Gultnieks 77137a92cf Don't corrupt stepheight when setting other properties 2014-11-26 20:02:48 +01:00
SmallJoker 874109c520 Add option 'eased' to NoiseParams
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-11-13 23:06:38 +10:00
kwolekr 7616537bc0 Add Generator Element Management framework
Add BiomeManager, OreManager, DecorationManager, and SchematicManager
2014-11-12 23:02:41 -05:00
kwolekr 9e811a92e7 Split up mapgen.cpp 2014-11-01 13:16:23 -04:00
RealBadAngel e5652cb75c Custom collision boxes node property. 2014-10-19 20:48:21 +02:00
RealBadAngel 0066bd77d2 Add meshnode drawtype. 2014-10-18 16:42:23 +02: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 f8b7555558 Revert "Make sure we get a stacktrace for as many lua errors as possible"
This reverts commit 362ef5f6ce.

Stack tracebacks couldn't be generated in LuaError::LuaError anyway and this
caused a second, empty traceback in most cases.  In cases where there wasn't
annother traceback the stack had already unwound and the traceback was empty.
2014-03-15 16:01:06 -04:00
Sfan5 362ef5f6ce Make sure we get a stacktrace for as many lua errors as possible 2014-03-15 14:51:00 +01:00
kwolekr 28d6326bd4 Update set_mapgen_params and set_gen_notify Lua API to use new flag format 2014-03-08 11:35:04 -05:00
kwolekr 3570f3e396 Add minetest.set_noiseparam_defaults() Lua API 2014-02-15 19:13:14 -05:00
kwolekr a0683b811c Define strlcpy on platforms that do not have it 2014-02-09 13:57:29 -05:00
kwolekr 2a01050a0c Add capability to read table flag fields from Lua API 2014-02-09 12:44:31 -05:00
kwolekr 83bafbe08b Make flag strings clear specified flag with 'no' prefix
Remove flagmask field from set_mapgen_params table
Add small bits of needed documentation
2014-02-08 17:50:59 -05:00
kwolekr 21c96249fa Schematic: Read slice probability table from schematic descriptors 2014-01-19 02:44:45 -05:00
ShadowNinja a3586cd18d Add maximum recursion depth to read_json_value 2014-01-11 14:08:02 -05:00
ShadowNinja a9df87ede0 Rename get_json_value to read_json_value 2014-01-11 13:52:26 -05:00
ShadowNinja 829426c714 Fix InventoryList reading order
Lua does not guarantee that the indexes of a table will be in numerical order.
2013-12-30 14:00:05 -05:00
ShadowNinja e1f9ba435f Don't throw a error when writing JSON fails 2013-12-18 18:18:43 -05:00
ShadowNinja 1ed90c90c3 Add 'minetest.write_json' 2013-12-18 16:46:53 -05:00
ShadowNinja 49cec3f782 Handle LuaErrors in Lua -> C++ calls on LuaJIT 2013-12-18 16:35:55 -05:00
RealBadAngel 2330267d22 Shaders rework. 2013-12-03 18:55:25 +01:00
ShadowNinja 4594ba6522 Optimize table creation 2013-11-30 13:05:13 -05:00
MetaDucky 35606cfb67 fixed array limit check when reading Lua specialtiles table 2013-11-16 15:31:17 +01:00
ShadowNinja 371b39a09a Pass a errfunc to lua_pcall to get a traceback 2013-11-15 14:13:31 -05:00
PilzAdam 4feea0ac68 Add offset to automatic_face_movement_dir 2013-09-10 23:31:44 +02:00
Kahrl 1ecf51a13f Add minetest.parse_json, engine.parse_json 2013-09-02 02:20:08 +02:00
Kahrl 4e1f50035e Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
sapier fc571ad46d Add support for entities to automatic face movement direction 2013-08-13 23:48:47 +02:00
kwolekr c06caa14c3 Decoration: Fix schematic probability mess with new MTS file version 2013-08-11 15:34:49 -04:00
BlockMen 7b13d119ed Add support for different drowning damage and allow drowning in other nodetypes 2013-08-06 17:49:39 +02:00
sapier 251e3e01c7 Add support for setting stepheight for entities 2013-07-30 19:48:02 +02:00
proller 3aedfac968 Weather support 2013-07-27 23:21:48 +04:00
PilzAdam 8cae659786 Add an option to disable object <-> object collision for Lua entities 2013-07-20 20:43:11 +02:00
PilzAdam 413f0d0353 Add liquid_range to nodedef 2013-07-20 20:41:17 +02:00
PilzAdam cba90d4441 Make range of tools configureable 2013-07-20 20:37:59 +02:00