Commit Graph

81 Commits

Author SHA1 Message Date
Thomas--S
1940961d63 Move duplicate recipe from books to default.register_craft_metadata_copy()
This allows mods to easily implement the same behaviour, e.g. for letters.
2020-01-04 00:09:58 +00:00
An0n3m0us
05375c0fd4 Fix glass panes sides (#2500) 2019-09-27 00:35:06 +02:00
sfan5
b4c7522248
Fix more translation strings (#2487) 2019-09-18 20:38:27 +02:00
sfan5
e4adb01fbf
Fix and improve translation strings (#2471) 2019-09-12 19:03:10 +02:00
sfan5
b701e500aa Support for icesheet dungeons in dungeon_loot 2019-07-16 22:26:35 +02:00
Paramat
5c48c76aa2
Fix trapdoor side textures and orientations
Previously, opening a trapdoor caused the side textures to flip.

Fix the incorrect textures.
Also add a texture transform to a tile of the open trapdoor, such
that the closed trapdoor sides use the lower part of the texture
and the open trapdoor sides use the higher part.

Clean up some codestyle issues.
2019-05-03 23:49:07 +01:00
HybridDog
efd090228d fire: Document flammable group, a little code cleanup 2019-03-30 20:33:08 +00:00
Ryan Nolan
bae58b3806 Doors: Allow on_rightclick to be overidden
Allow mods such as protection mods to over ride on_rightclick.
Usecase is creating shared doors without the need for keys.
2018-12-20 22:45:24 +00:00
rubenwardy
1fa8180e7f
Add sfinv.get_page() 2018-11-28 14:14:33 +00:00
random-geek
ab1a79b13c Add blueberry bushes 2018-10-09 20:54:22 +01:00
Paramat
5b3b609270
Stairs: Add field to determine world-aligned textures (#2219)
All stair/slab nodes with parent nodes that are rotatable (wood and bricks)
are reverted to not having world-aligned textures, to fix the breakage of
rotated stair/slab appearence in worlds.

Update, and add missing documentation to, game_api.txt.
2018-10-04 00:33:11 +01:00
Paramat
5673a71752
Game_api.txt: Update and improve dye documentation 2018-08-28 19:12:10 +01:00
TumeniNodes
9318c71659 Biomes: Add pine bush to taiga and snowy grassland
Replaces 'bush' in snowy grassland.
2018-07-13 01:17:07 +01:00
bell07
5692c15b4d Disallow digging a bed if in use
Use a new table beds.bed_position to check if a bed is in use.
2018-06-19 22:07:01 +01:00
Andrew Ward
b0e55c52c8
Add formspec theming, remove sfinv's dependency on default 2018-03-28 18:28:26 +01:00
Paramat
da877ccf57 Rename 'subgame' to 'game' 2018-03-13 20:00:29 +00:00
Tim
283636bfdb Bones: Iterate player inventory lists dynamically (#1229)
Avoid hard-coded player inventory lists.
Expose `bones.player_inventory_lists` for mods to look up or change,
which player inventory lists are being dropped or placed into bones.
2018-02-20 19:15:03 +01:00
MarkuBu
faa088e2c5 Xpanes: Add optional 'use_texture_alpha' parameter to registration 2018-01-02 22:43:42 +00:00
ForbiddenJ
b75a17984a Default: Expose open_chests and chest_lid_obstructed 2017-11-27 01:50:37 +00:00
paramat
d4e1bd053e Player API: Set eye height property for new player model
Correct the collisionbox height.
2017-11-06 15:40:14 +00:00
sfan5
49cc4c7c63 Add loot to dungeons (#1921) 2017-10-27 13:34:41 +02:00
tenplus1
3ff296961e TNT: Add tnt.boom defaults
This adds def, def.radius and def.damage_radius defaults to the
tnt.boom() function if they aren't specified on call.
2017-10-10 22:55:49 +01:00
tenplus1
fe67ffda7c TNT: Add explode_center flag
Add 'explode_centre' flag which when false explodes as normal and when true runs on_blast on centre node as well as dropping items.
2017-08-26 22:14:44 +01:00
tenplus1
bb084294ce TNT: Allow a custom explosion sound to be used 2017-08-18 18:41:15 +01:00
paramat
77c9408721 Player API: Integrate settable player step height
Split some long lines.
Some nearby code cleanup.
2017-08-09 11:27:37 +01:00
paramat
b4abb07572 Player_api: Integrate settable player collisionbox 2017-08-06 01:54:47 +01:00
rubenwardy
5d19fd6923 Separate player code into new mod 2017-08-01 03:57:29 +01:00
SmallJoker
e5189760b3 Default: Expose the formspec getter functions (#1783) 2017-07-16 14:31:34 +02:00
DS-Minetest
2e413b521a Add backface_culling to open chests and fencegates 2017-07-02 11:32:34 +01:00
Fernando Carmona Varo
be9121214c TNT: Gunpowder (and tnt.burn) will trigger the on_ignite of nodes
The previous behaviour is kept as fallback for compatibility, for when the on_ignite
is not defined in the node.
2017-05-01 19:38:38 +01:00
paramat
a57d2db54a Bushes: Add saplings
Bush saplings grow in half the time of tree saplings.
Bushes do not need 'from sapling' schematic variants because only the
stem node is force-placed in the mapgen schematic, so only the sapling
is force-replaced.
Bush leaves drop saplings with a rarity that ensures at least 1 sapling
per bush on average.
2017-04-12 17:18:50 +01:00
paramat
d68d2c08ef PB&J Pup: Remove mod
Also delete nyancat API documentation from game_api.txt.
2017-04-12 17:18:35 +01:00
MarkuBu
60e5b299af Leafdecay: Node timer based implementation, API
This implements a node-timer based leafdecay mechanism, and exposes
an API to use it in mods.

The API is documented in game_api.txt.

`default.register_leafdecay(leafdecaydef)`

`leafdecaydef` is a table, with following members:
{
	trunks = { "default:tree"}, -- nodes considered trunks
	leaves = { "default:leaves", "default:apple"}, -- nodes considered leaves
	radius = 3, -- activates leafdecay this far from the trunk
}

The algorithm will drop `leaves` items in the area if no `trunks` are found
in the `trunk_radius` sized area around the position of the leaf. If a node
listed in `leaves` has a group `leafdecay_drop > 0`, then the item is dropped,
otherwise the item is removed but not dropped.

The algorithm also implements a value `default.leafdecay_speed` (default
15) which can be modified to increase or decrease of the leaf decay. The
algorithm will vary the actual speed a bit to introduce randomness.

Leaf decay is randomized by 0.1 seconds to reduce the chance that
decay happens many times on the same second interval. This requires
nodetimer_interval to be set to values lower than 1.0 to have an
effect.

The leaves will decay between 2 and 10 seconds after digging the trunk,
and happen at non-integer second intervals.

-- The API was added by sofar.
2017-02-25 03:50:15 +00:00
rubenwardy
e3dd3d19cd Add sfinv.set_page, plus other helper functions 2017-02-10 23:54:57 +00:00
rubenwardy
bee5b316a8 Creative: Add creative.is_enabled_for 2017-01-26 17:54:45 +00:00
rubenwardy
0ff09e018d Add sfinv.get_homepage_name(player)
Also sets creative:all as default inventory page
Fixes #1423
2016-12-05 01:39:50 +00:00
rubenwardy
d42ae715b8 Sfinv: Add sfinv to allow tabs to be added to the inventory 2016-11-27 03:27:12 +00:00
Auke Kok
e4b1c93512 Keys: Allow easy sharing of access without commands
This code adds the key concept to minetest_game, and integrates it
with lockable nodes. Currently supported lockable items are the Steel
Door, the Steel Trapdoor, and the Locked Chest.

The goal of this modification is to introduce a fine-grained multi-
player permission system that is intuitive and usable without any
console or chat commands, and doesn't require extra privileges to
be granted or setup. Keys can also physically be conveyed to other
players, adding to gameplay and adding some personality that is
preferable to console commands or editing formspecs.

A skeleton key can be crafted with 1 gold ingot. Skeleton keys can
then be matched to a lockable node by right-clicking the skeleton
key on a lockable node, which changes the skeleton key to a "key".

Gold was chosen as it's currently a not-so very useful item, and
therefore it's likely that players have some, but aren't really
using it for any purpose.

This key can subsequently used by any player to open or access that
lockable node, including retrieving items from Locked Chests, or
putting items in them.

They key is programmed to fit only the particular locked node it is
programmed to. This is achieved by storing a secret value in both
key and locked node. If this secret value doesn't match, the key
will not open the locked node. This allows many keys to be created
for one chest or door, but a key will only fit one node ever. The
secrets are stored in node, and item meta for the key.

If a locked node is removed, all keys that opened it are no longer
valid. Even if a new door/chest is placed in exactly the same spot,
the old keys will no longer fit that node.

Keys can be smelted back in gold ingots if they are no longer useful.

The method of storing a secret in nodemeta and itemstackmeta is secure
as there is no way for the client to create new items on the server
with a particular secret metadata value. Even if you could possible
create such an itemstack on the client, the server does not ever read
itemstackmeta from a client package.

The patch adds an API that allows other nodes and nodes added by
mods to use the same keys as well. The method how to implement this
is described in game_api.txt. The mod should add 2 callbacks to it's
node definition. Example code is given.

Textures are from PixelBOX, thanks to Gambit.
2016-11-25 03:01:14 +00:00
Auke Kok
1e691c4429 Carts: Merge boost_cart as "carts" mod
This is all the working code from SmallJoker's boost_cart, poored into
a more suitable form for minetest_game.

- Mesecons and moreores stuff was removed entirely.
- Textures were all renamed and moved out of default/
- Updated license, readme.txt, attribution
- Changed code license to MIT, left artwork at CC0
- removed default:rail and made aliases for it
- :carts:rail is now carts:rail.
- localized entity def
- removed copper rail entirely
- startstop rail was removed, as well as detector rail
- remodeled to b3d using stujones11 excellent blend model, but sizes
  of cart adjusted to make pixel sizes consistent (0.625) everywhere.
- slightly more complex texture map for the cart (front/side visibly
  different)
- rail parameters are passed as a separate def table, and stored in
  a private list. This avoids having to call `get_meta` on every
  node. In return, we need the node name, though.
- adds metal sounds (based on default metal sound function) and
  cart moving sound.
- reduced cart speeds to max 7, 5 by pushing.
- Added on_step() rail event handler, gets called when a cart is on
  a rail.
- Added various rebased updates from upstream (thanks Krock)
- Included a fix that removes the 'reverse jiggle' when stopping.
- Included reworked textures by sofar.

The mod namespace is still public, but I'm NOT declaring it an API. I'd
rather see it localized instead, for now. Any public interface in this
code is *experimental* at best, and should be considered non-stable and
unsupported for now.
2016-11-21 03:15:04 +00:00
Fernando Carmona Varo
c824d69182 Fire / tnt: Make flint-and-steel use node on_ignite functions
Add on_ignite functions to tnt, gunpowder, coalblock.
2016-11-07 14:10:00 +00:00
Fernando Carmona Varo
5b2a896180 Bucket: Allow buckets to trigger the on_punch of entities and nodes
The purpose of this is to allow mods to be able to interact (e.g. fill up)
an empty bucket when it is used to punch a node that's not a liquid source
or when punching a custom entity (e.g. milking a cow).
2016-11-02 12:39:56 +00:00
LNJ
138eb71db6 game_api.txt: Add new metal sounds func. 2016-10-25 14:15:53 -07:00
paramat
7b30c26a45 Bucket: Add optional 'force-renew' bool to registration
River water needs to be 'liquid_renewable = false' to avoid a mess caused by
spreading of sources, however picking it up with a bucket then creates
a hole in the river. Allow a 'force-renew' of the source node if it has a
source neighbour.
2016-10-12 04:11:36 +01:00
bas080
78311a27a1 Store registered plant on namespace
Handy for when modders want to use these definitions to extend or add to the mod
2016-10-12 00:14:11 +01:00
tenplus1
6fdfd2554c Tnt: Various optimisations
Pass nodename to tnt.burn function where possible to reduce
use of 'get_node'.
Change 'ipairs' to 'pairs'.
Use 'nodeupdate_single(pos)' instead of 'nodeupdate(pos)' to
avoid every node triggering recursion, the loop itself takes
the place of recursion and works upwards through horizontal
planes as required.
2016-10-10 03:16:41 +01:00
Auke Kok
54235f3276 Xpanes: Convert to connected nodeboxes
I've rewritten this to use connected nodeboxes, but with a caveat. In
order to make flat nodes look better, I'm keeping one non-connected
pane that is flat around to convert flat sections to the flat nodes
instead of connected, as these look better and are easier to work
with. Once more sides are needed we convert the panes on the fly to
connected nodes and recalculate the shape.

We don't paint any of the half-panes that the previous generation of
xpanes did. There's no need and it's harder to work with. Updating the
nodes also seems more natural and placement and removal works straight
forward.

The conversion of old panes relies on an LBM, and does a reasonable
conversion job, but it's not exact, since the panes behave slightly
different now.

The game API documentation was wrong to begin with. We discard param
nr. 2 of the API entirely, and correct the tile usage text.
2016-09-10 05:18:02 +01:00
Tim
20fa037313 Screwdriver: disallow rotation with on_rotate = false
Other screwdriver mods, or mods that cause rotation, might operate without the screwdriver mod loaded and have `screwdriver.disallow` unavailable.
This allows nodes to default to full-disallow rather than full-rotation in such a situation.
2016-08-05 20:41:24 +01:00
rubenwardy
3661cb61e3 Move nyancats into a separate mod
Nyancats are independent in the default mod. Nothing else uses them or
their code. Separating it into a separate mod makes it easier for
subgames to remove them. It also makes it easier for a mod to depend
on nyancats, as lots of subgames don't have them.

Default/mapgen.lua: Register biomes, ores and decorations in
singlenode mapgen. These were never disabled anyway because
singlenode was removed from the world creation menu.
2016-07-18 04:15:44 +01:00
tenplus1
98551edd94 Game_api.txt: Add position table reference 2016-07-05 18:18:45 +01:00
tenplus1
c5b0fe72ea Game_api.txt: Add API information for sethome functions
- Documentation for sethome.get, sethome.set and sethome.go
2016-07-05 18:17:22 +01:00