Commit Graph

42 Commits

Author SHA1 Message Date
Gregor Parzefall 517f1602aa Re-add "long tap to punch" as a client-side setting 2024-03-30 11:40:50 +01:00
cx384 aaf77025b6 Split up tile.cpp/h 2024-03-03 15:52:05 +01:00
techno-sam 176e674a51
Add wear bar color API (#13328)
---------

Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
Co-authored-by: grorp <gregor.parzefall@posteo.de>
2024-02-02 21:21:00 +01:00
cx384 5958714309
Tool specific pointing and blocking pointable type (#13992) 2024-01-22 18:27:08 +01:00
grorp 404a063fdf
Touchscreen: Allow mods to swap the meaning of short and long taps (punch with single tap) (#14087)
This works through a new field "touch_interaction" in item definitions.
The two most important use cases are:
 - Punching players/entities with short tap instead of long tap (enabled by default)
 - Making items usable that require holding the place button (e.g. bows and shields in MC-like games)
2024-01-21 17:44:08 +01:00
cx384 2ea8d9ca11
Fix out of range enum casts in deSerialize functions (#14090) 2024-01-17 20:05:46 +01:00
Wuzzy 08ee6d8d4b
Add rotation support for wallmounted nodes in 'ceiling' or 'floor' mode (#11073) 2024-01-17 17:47:06 +01:00
SmallJoker 4ef93fe25f
Allow place_param2 = 0 node placement predictions (#13787)
The placement prediction value 0 was accidentally ignored
and made the clients fall back to automatic rotation based
on the node paramtype2 value.

This now changes the internal representation to properly
indicate the disabled state (e.g. 'nil' in Lua).
2023-09-13 13:57:57 +02:00
DS edcbfa31c9
Sound refactor and improvements (#12764) 2023-06-16 20:15:21 +02:00
rubenwardy 4158b72971
Add ability to override item images using meta (#12614) 2023-04-17 19:44:41 +01:00
sfan5 525fc3833c Implement tool use sounds 2022-09-30 14:02:14 +02:00
SmallJoker a463620edb
Re-order sound-related code (#12382)
Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated
'fade' and 'pitch' values on server-side where only one was used anyway.
SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included.

Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the
future. Per-type version numbers are kept for now as a safety rope in a special case.
2022-06-20 21:56:12 +02:00
sfan5 bf8fb2672e
Use place_param2 client-side for item appearance & prediction (#11024) 2021-03-09 00:56:53 +01:00
DS f3ae45b2b2
Add a short_description to be used by mods (#8980) 2020-10-09 19:11:21 +01:00
Hugues Ross 5cf6318117
Refactor texture overrides and add new features (#9600)
* Refactor texture overrides, and add new features:

- Texture overrides can support multiple targets in one line
- Texture override files can have comment lines
- Item images/wield images can be overridden

* Formatting changes

* Address soime feedback

- Pass vectors by const reference
- Log syntax errors as warnings
- Remove 'C' prefix from TextureOverrideSource

* Simplify override target checks with an inline helper function

* make linter happy

* Apply feedback suggestions

Co-Authored-By: rubenwardy <rw@rubenwardy.com>

* Remove remaining != 0 checks

* Update copyright notice

Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2020-04-14 20:41:29 +02: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
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
Loïc Blot 921151d97a C++ modernize: Pragma once (#6264)
* Migrate cpp headers to pragma once
2017-08-17 22:19:39 +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
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
Ner'zhul 8e7449e092 Environment & IGameDef code refactoring (#4985)
* Environment code refactoring
* Cleanup includes & class declarations in client & server environment to improve build speed
* ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts.
* Cleanup IGameDef
  * Move ITextureSource* IGameDef::getTextureSource() to Client only.
  * Also move ITextureSource *IGameDef::tsrc() helper
  * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call
  * drop unused emerge() call
  * cleanup server unused functions (mentionned before)
* Drop one unused parameter from ContentFeatures::updateTextures
* move checkLocalPrivilege to Client
* Remove some unnecessary casts
* create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it
* Fix some comments
* Change required IGameDef to Server/Client pointers
* Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects
* Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu
* drop ClientMap::sectorWasDrawn which is unused
2017-01-09 20:39:22 +01:00
SmallJoker 2de8c22a99 Make getStackMax return the correct maximal stack size 2016-09-08 03:37:03 -04:00
paly2 aa33166386 Add minetest.unregister_item and minetest.register_alias_force 2016-09-08 03:26:52 -04:00
Sapier 1735c20549 Revert "Refactoring and code style fixes in preparation of adding mesh typed items"
This reverts commit f14e7bac54.

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:55:50 +01: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 f14e7bac54 Refactoring and code style fixes in preparation of adding mesh typed items 2015-12-29 16:27:06 +01:00
BlockMen 2a12579fab Add support for audio feedback if placing node failed 2015-11-07 13:23:38 +01:00
PilzAdam cba90d4441 Make range of tools configureable 2013-07-20 20:37:59 +02:00
PilzAdam 5e7e0347cd Add different place sound for nodes 2013-03-29 20:14:18 +01:00
PilzAdam 7d9329ecfe New damage system, add damageGroups to ToolCapabilities, bump protocol version 2013-03-29 20:14:09 +01:00
PilzAdam 0183bdad04 Fix nodeplacement prediction 2013-02-27 20:23:32 +01:00
Sfan5 6d0ea26c2d Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam 497ff1ecd6 Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
Jeija 365c169b43 Disable placement prediction for nodes that use on_rightclick 2013-02-19 20:02:40 +01:00
Perttu Ahola bee170570d On-demand item meshes and textures 2012-12-02 00:38:26 +02:00
Perttu Ahola 9f031a6759 Optimize headers 2012-06-17 04:03:39 +03:00
Perttu Ahola 6a0388bb4b Node placement client-side prediction 2012-06-10 12:46:48 +03:00
Perttu Ahola 037b259197 Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2/later, by agreement of major contributors 2012-06-05 18:54:07 +03:00
Perttu Ahola 07ed57476f itemgroup.h and ItemGroupList typedef 2012-03-10 11:28:13 +02:00
Perttu Ahola 562ac3bce9 Digging time groups WIP 2012-03-10 11:28:12 +02:00
Kahrl 6a76c226e1 The huge item definition and item namespace unification patch (itemdef), see http://c55.me/minetest/wiki/doku.php?id=changes:itemdef 2012-01-12 06:10:39 +01:00