Compare commits

..

10 Commits

Author SHA1 Message Date
7711cddaf1 docs - update docs to the sfans mientest 0.4.18 release
* this branch is the respective game for the historical 0.4.18 archived
2022-02-28 23:59:44 -04:00
30f3d94688 improve README and api documentation 2022-02-28 23:49:09 -04:00
d7e1e44c24 * document, configure and improve the give_initial_stuff
* This mod provides some stuff per player at initial play when first join only
* set initial_stuff = default:wood 2,farming:bread 2,default:furnace 1,default:torch 5
* the initial_stuff is only configured per config files not at menu
* cherry-picked from 18aed0219b
2021-12-13 20:21:50 -06:00
d5cc8c46f6 set art and game default, use minenux name and logo venenux 2021-11-30 23:04:04 -04:00
mckaygerhard
61debd8c3b Merge pull request 'master use mostly almost possible of 5.1 on 4.0 (not 0.4)' (#1) from master into stable-4.0
Reviewed-on: https://codeberg.org/minenux/minetest-game-minetest/pulls/1
2021-11-24 05:12:59 +01:00
Montandalar
575ecc3125 Do not crash when a skeleton key is used on an unknown node (#2806) 2021-11-23 23:56:28 -04:00
sfan5
ac8ac98fe2 Use node particles for TNT explosions (#2695) 2021-11-23 23:56:00 -04:00
sfan5
fe915a3c7f Fix crash on TNT explosions if tnt is disabled 2021-11-23 23:55:32 -04:00
feec4659cb minetest 4 game with some backports from 5.2
* taking care .. thi is 5.1 with removed binocular
* updated README for our fork minenux
* minetest 4 game with some backports from 5.3
2021-11-23 23:53:56 -04:00
luk3yx
0e0ea932ef Fix for 0.4.18.5-dev.
• Remove the "binoculars" mod, as it is broken on 0.4.
2019-03-12 16:02:41 +13:00
1273 changed files with 5143 additions and 32943 deletions

View File

@ -3,7 +3,7 @@ allow_defined_top = true
read_globals = {
"DIR_DELIM",
"minetest",
"minetest", "core",
"dump",
"vector",
"VoxelManip", "VoxelArea",
@ -12,16 +12,11 @@ read_globals = {
"Settings",
"unpack",
-- Silence errors about custom table methods.
table = { fields = { "copy", "indexof" } },
-- Silence warnings about accessing undefined fields of global 'math'
math = { fields = { "sign" } }
table = { fields = { "copy", "indexof" } }
}
-- Overwrites minetest.handle_node_drops
files["mods/creative/init.lua"].globals = { "minetest" }
-- Overwrites minetest.calculate_knockback
files["mods/player_api/api.lua"].globals = { "minetest" }
-- Don't report on legacy definitions of globals.
files["mods/default/legacy.lua"].global = false

View File

@ -1,4 +1,5 @@
language: generic
sudo: false
addons:
apt:
packages:
@ -6,6 +7,6 @@ addons:
before_install:
- luarocks install --local luacheck
script:
- $HOME/.luarocks/bin/luacheck ./mods
- $HOME/.luarocks/bin/luacheck --no-color ./mods
notifications:
email: false

View File

@ -12,7 +12,6 @@ Copyright (C) 2015 paramat CC BY-SA 3.0
License of source code
----------------------
Copyright (C) 2010-2012 Blockmen
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
See README.txt in each mod directory for information about other authors.

View File

@ -1,7 +1,7 @@
Minetest5 Game
Minetest4 Game
==============
The default game for the Minetest5 engine.
The default game for the Minetest4 engine.
This is a fork from minetest default game, this
are made from minenux project https://codeberg.org/minenux
@ -10,54 +10,79 @@ for minetest v5 and minetest v4 or 0.4.
Introduction
------------
This is the branch `stable-5.2` of minetest game for minetest5 a version
that is focused in v5 of minetest but mainly in 5.2 release. There's
This is the branch `stable-4.1` of minetest game for minetest4 a version
that is focused in v4 of minetest but mainly in 0.4.18/4.0.18 release. There's
also a minetest4 game version too in `stable-4.0` branch.
This are focused to provide minimal default game featured for minetest5
This are focused to provide minimal default game featured for minetest4
to be playable, with an [api](game_api.md) for more aditions (in the form of mods)
For further information, check the [Minetest Wiki](https://wiki.minetest.org/index.php?title=Games/Minetest_Game)
For further information, check the [Minetest Wiki](https://wiki.minetest.net/Subgames/Minetest_Game)
## Download
Can be obtained from https://codeberg.org/minenux/minetest-game-minetest/tags
those like 5.2.X by example https://codeberg.org/minenux/minetest-game-minetest/releases/tag/5.2.1
those like 4.0.X by example https://codeberg.org/minenux/minetest-game-minetest/releases/tag/4.0.18
It will download a tar.gz file, uncompress the content and a directory will be created,
the name of the directory does not matter, the contents will be used later to install.
When stable releases are made, Minetest Game and the Minetest engine is packaged
and made available at https://codeberg.org/minenux/minetest-engine/archive/stable-5.2.tar.gz
or generally at https://codeberg.org/minenux/minetest-engine/releases/tag/5.2.1 by example.
This have a mirror at https://git.minetest.org/minenux/minetest-game-minetest/releases
and made available at https://codeberg.org/minenux/minetest-engine/archive/stable-4.0.tar.gz
or generally at https://codeberg.org/minenux/minetest-engine/releases/tag/4.0.18 by example.
## Installation
This game can be used in any version from 5.0 to 5.2, it may work with recents versions
This game can be used in any version from 0.4.18 to 4.0.18 and 5.2, it does nto work with 5.3 or up
After download, rename the directory decompressed to `minetest_game` and put to the "games" directory:
- GNU/Linux: If you use a system-wide installation place
it in ~/.minetest5/games/.
it in ~/.minetest4/games/.
- Others: `minetest/games/` or `games` directory from the path were the binary are.
For further information or help, see: https://wiki.minetest.net/Installing_Mods
## Content
This sub game or game will contain a set of mods, that provide a behaviour of the game,
For more information check [mods/README.md](mods/README.md)
* api
* beds
* bucket
* bones
* boats
* butterflies
* creative
* default
* player_api
* sethome
* doors
* farming
* fire
* fireflies
* give_initial_stuff
* stairs
* carts
* dye
* flowers
* screwdriver
* tnt
* xpanes
* sfinv
* vessels
* walls
* wool
The binoculars from v5 were removed due lackof features in engine api, and it
just separate privilegies for zoom, the spawn mod is just minimal spawn management
pooly provided and better managed by mods like rspawn and spawnrandom.
## Compatibility
This source code and files are focused in most newer minetest5 engine
from https://codeberg.org/minenux/minetest-engine/src/branch/stable-5.2
For minetest4 check https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.0
This source code and files are only compatible with matched minetest4 engine
from https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.1
Additionally, when the Minetest4 engine is tagged to be a certain version (e.g.
4.0.18), Minetest Game is tagged with the version 4.0.18 too.
## Licensing
See `LICENSE.txt` original autor fo first set of mods game was Blockmen
See `LICENSE.txt`

86
README.txt Normal file
View File

@ -0,0 +1,86 @@
Minetest4 Game
==============
The default game for the Minetest4 engine.
This is a fork from minetest default game, this
are made from minenux project https://codeberg.org/minenux
for minetest v5 and minetest v4 or 0.4.
Introduction
------------
This is the branch `stable-4.1` of minetest game for minetest4 a version
that is focused in v4 of minetest but mainly in 0.4.18/4.0.18 release. There's
also a minetest4 game version too in `stable-4.0` branch.
This are focused to provide minimal default game featured for minetest4
to be playable, with an [api](game_api.md) for more aditions (in the form of mods)
For further information, check the [Minetest Wiki](https://wiki.minetest.net/Subgames/Minetest_Game)
## Download
Can be obtained from https://codeberg.org/minenux/minetest-game-minetest/tags
those like 4.0.X by example https://codeberg.org/minenux/minetest-game-minetest/releases/tag/4.0.18
It will download a tar.gz file, uncompress the content and a directory will be created,
the name of the directory does not matter, the contents will be used later to install.
When stable releases are made, Minetest Game and the Minetest engine is packaged
and made available at https://codeberg.org/minenux/minetest-engine/archive/stable-4.0.tar.gz
or generally at https://codeberg.org/minenux/minetest-engine/releases/tag/4.0.18 by example.
## Installation
This game can be used in any version from 0.4.18 to 4.0.18 and 5.2, it does nto work with 5.3 or up
After download, rename the directory decompressed to `minetest_game` and put to the "games" directory:
- GNU/Linux: If you use a system-wide installation place
it in ~/.minetest4/games/.
- Others: `minetest/games/` or `games` directory from the path were the binary are.
For further information or help, see: https://wiki.minetest.net/Installing_Mods
## Content
* api
* beds
* bucket
* bones
* boats
* butterflies
* creative
* default
* doors
* farming
* fire
* fireflies
* give_initial_stuff
* stairs
* carts
* dye
* flowers
* screwdriver
* tnt
* xpanes
* sfinv
* vessels
* walls
* wool
The default mod provides sethome and player_api call ones, binoculars from v5 are
just separate privilegies for zoom, the spawn mod is just minimal spawn management
pooly provided and better managed by mods like rspawn and spawnrandom.
## Compatibility
This source code and files are only compatible with matched minetest4 engine
from https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.1
Additionally, when the Minetest4 engine is tagged to be a certain version (e.g.
4.0.18), Minetest Game is tagged with the version 4.0.18 too.
## Licensing
See `LICENSE.txt`

View File

@ -1,5 +1,3 @@
title = Minetest5
name = Minetest5
author = Minetest
description = GAME set for MinenuX Bundled by default with Minetest5
min_minetest_version = 5.0
name = Minetest4
author = minetest
description = MinenuX Bundled by default with Minetest4

View File

@ -1,4 +1,4 @@
Minetest5 Game API
Minetest Game API
=================
This is a fork of the original one at https://github.com/minetest/minetest_game
@ -7,11 +7,11 @@ For more information about fork check [Differences](#differences) section.
Introduction
------------
The Minetest5 Game game offers multiple new possibilities in addition to the Minetest engine's built-in API,
allowing you to add new plants to farming mod, buckets for new liquids, new stairs and custom panes.
For information on the Minetest5 API, visit https://codeberg.org/minenux/minetest-engine-minetest/src/branch/stable-5.2/doc/lua_api.txt
The Minetest4 Game game offers multiple new possibilities in addition to
the Minetest engine's built-in API, allowing you to add new plants to farming mod,
buckets for new liquids, new stairs and custom panes.
For information on the Minetest4 API, visit https://codeberg.org/minenux/minetest-engine-minetest/src/branch/stable-4.0/doc/lua_api.txt
Please note:
* [XYZ] refers to a section the Minetest API
@ -20,21 +20,15 @@ Please note:
## Table of Contents
- [Differences](#differences)
- [Bucket API](#bucket-api)
- [Beds API](#beds-api)
- [Bed definition](#bed-definition)
- [Bones API](#bones-api)
- [Creative API](#creative-api)
- [Chests API](#chests-api)
- [Chest Definition](#chest-definition)
- [Doors API](#doors-api)
- [door ObjectRef Methods](#door-objectref-methods)
- [Methods](#methods)
- [Door definition](#door-definition)
- [Trapdoor definition](#trapdoor-definition)
- [Fence gate definition](#fence-gate-definition)
- [Dungeon Loot API](#dungeon-loot-api)
- [Loot definition](#loot-definition)
- [Fence API](#fence-api)
- [fence definition](#fence-definition)
- [Walls API](#walls-api)
@ -43,8 +37,6 @@ Please note:
- [Plant definition](#plant-definition)
- [Fire API](#fire-api)
- [Give Initial Stuff API](#give-initial-stuff-api)
- [Players API](#players-api)
- [Model Definition](#model-definition)
- [TNT API](#tnt-api)
- [Screwdriver API](#screwdriver-api)
- [Sethome API](#sethome-api)
@ -61,30 +53,18 @@ Please note:
- [Raillike definitions](#raillike-definitions)
- [Default sounds](#default-sounds)
- [Default constants](#default-constants)
- [GUI and formspecs](#gui-and-formspecs)
- [Player API](#player-api)
- [Model Definition](#model-definition)
- [Leafdecay](#leafdecay)
- [Dyes](#dyes)
- [Color groups](#color-groups)
- [Color lists](#color-lists)
- [Trees](#trees)
- [Carts](#carts)
- [Key API](#key-api)
## Differences
This game api is the same.. just that format the document and progresivelly added new things,
this is cos this game sustitute some mods by improved versions:
* boats by the minetest-mod-boats forked from tenplus1
* creative by the minetest-mod-creative improved
* tnt by the minetest-mod-tnt forked and improved from tenplus1
* wool by the minetest-mod-wool forked and improved from tenplus1
* carts by the minetest-mod-carts forked and improved from tenplus1
* fire by the minetest-mod-fire forked and improved from templus1
* torch as sistution of `default:torch` by the minetest-mod-torchs
The original api from those remains but aditional (independient documented in each one)
are added.
## Bucket API
Bucket API
----------
The bucket API allows registering new types of buckets for non-default liquids.
@ -104,8 +84,7 @@ The bucket API allows registering new types of buckets for non-default liquids.
The filled bucket item is returned to the player that uses an empty bucket pointing to the given liquid source.
When punching with an empty bucket pointing to an entity or a non-liquid node, the on_punch of the entity or node will be triggered.
## Beds API
Beds API
--------
beds.register_bed(
@ -113,7 +92,6 @@ When punching with an empty bucket pointing to an entity or a non-liquid node, t
def -- See [#Bed definition]
)
* `beds.can_dig(bed_pos)` Returns a boolean whether the bed at `bed_pos` may be dug
* `beds.read_spawns() ` Returns a table containing players respawn positions
* `beds.kick_players()` Forces all players to leave bed
* `beds.skip_night()` Sets world time to morning and saves respawn position of all players currently sleeping
@ -139,18 +117,7 @@ When punching with an empty bucket pointing to an entity or a non-liquid node, t
}
}
## Bones API
---------
An ordered list of listnames (default: "main", "craft") of the player inventory,
that will be placed into bones or dropped on player death can be looked up or changed
in `bones.player_inventory_lists`.
e.g. `table.insert(bones.player_inventory_lists, "backpack")`
## Creative API
Creative API
------------
Use `creative.register_tab(name, title, items)` to add a tab with filtered items.
@ -171,69 +138,11 @@ The contents of `creative.formspec_add` is appended to every creative inventory
page. Mods can use it to add additional formspec elements onto the default
creative inventory formspec to be drawn after each update.
## Chests API
----------
The chests API allows the creation of chests, which have their own inventories for holding items.
`default.chest.get_chest_formspec(pos)`
* Returns a formspec for a specific chest.
* `pos` Location of the chest node, e.g `{x = 1, y = 1, z = 1}`
`default.chest.chest_lid_obstructed(pos)`
* Returns a boolean depending on whether or not a chest has its top obstructed by a solid node.
* `pos` Location of the chest node, e.g `{x = 1, y = 1, z = 1}`
`default.chest.chest_lid_close(pn)`
* Closes the chest that a player is currently looking in.
* `pn` The name of the player whose chest is going to be closed
`default.chest.open_chests`
* A table indexed by player name to keep track of who opened what chest.
* Key: The name of the player.
* Value: A table containing information about the chest the player is looking at.
e.g `{ pos = {1, 1, 1}, sound = null, swap = "chest" }`
`default.chest.register_chest(name, def)`
* Registers new chest
* `name` Name for chest
* `def` See [#Chest Definition]
### Chest Definition
description = "Chest",
tiles = {
"default_chest_top.png",
"default_chest_top.png",
"default_chest_side.png",
"default_chest_side.png",
"default_chest_front.png",
"default_chest_inside.png"
}, -- Textures which are applied to the chest model.
sounds = default.node_sound_wood_defaults(),
sound_open = "default_chest_open",
sound_close = "default_chest_close",
groups = {choppy = 2, oddly_breakable_by_hand = 2},
protected = false, -- If true, only placer can modify chest.
## Doors API
Doors API
---------
The doors mod allows modders to register custom doors and trapdoors.
`doors.registered_doors[name] = Door definition`
* Table of registered doors, indexed by door name
`doors.registered_trapdoors[name] = Trapdoor definition`
* Table of registered trap doors, indexed by trap door name
`doors.register_door(name, def)`
* Registers new door
@ -257,19 +166,12 @@ The doors mod allows modders to register custom doors and trapdoors.
* `pos` A position as a table, e.g `{x = 1, y = 1, z = 1}`
* Returns an ObjectRef to a door, or nil if the position does not contain a door
`doors.door_toggle(pos, node, clicker)`
### Methods
* Toggle door open or shut
* `pos` Position of the door
* `node` Node definition
* `clicker` Player definition for the player that clicked on the door
### door ObjectRef Methods
* `:open(player)` -- Open the door object, returns if door was opened
* `:close(player)` -- Close the door object, returns if door was closed
* `:toggle(player)` -- Toggle the door state, returns if state was toggled
* `:state()` -- returns the door state, true = open, false = closed
:open(player) -- Open the door object, returns if door was opened
:close(player) -- Close the door object, returns if door was closed
:toggle(player) -- Toggle the door state, returns if state was toggled
:state() -- returns the door state, true = open, false = closed
the "player" parameter can be omitted in all methods. If passed then
the usual permission checks will be performed to make sure the player
@ -282,15 +184,11 @@ permission checks are performed.
inventory_image = "mod_door_inv.png",
groups = {choppy = 2},
tiles = {"mod_door.png"}, -- UV map.
-- The front and back of the door must be identical in appearence as they swap on
-- open/close.
recipe = craftrecipe,
sounds = default.node_sound_wood_defaults(), -- optional
sound_open = sound play for open door, -- optional
sound_close = sound play for close door, -- optional
protected = false, -- If true, only placer can open the door (locked for others)
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-- optional function containing the on_rightclick callback, defaults to a doors.door_toggle-wrapper
### Trapdoor definition
@ -298,20 +196,11 @@ permission checks are performed.
inventory_image = "mod_trapdoor_inv.png",
groups = {choppy = 2},
tile_front = "doors_trapdoor.png", -- the texture for the front and back of the trapdoor
tile_side = "doors_trapdoor_side.png",
-- The texture for the four sides of the trapdoor.
-- The texture should have the trapdoor side drawn twice, in the lowest and highest
-- 1/8ths of the texture, both upright. The area between is not used.
-- The lower 1/8th will be used for the closed trapdoor, the higher 1/8th will be used
-- for the open trapdoor.
tile_side = "doors_trapdoor_side.png", -- the tiles of the four side parts of the trapdoor
sounds = default.node_sound_wood_defaults(), -- optional
sound_open = sound play for open door, -- optional
sound_close = sound play for close door, -- optional
protected = false, -- If true, only placer can open the door (locked for others)
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-- function containing the on_rightclick callback
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-- function containing the on_rightclick callback
### Fence gate definition
@ -321,45 +210,8 @@ permission checks are performed.
material = "default:wood",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults(), -- optional
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-- function containing the on_rightclick callback
## Dungeon Loot API
----------------
The mod that places chests with loot in dungeons provides an API to register additional loot.
`dungeon_loot.register(def)`
* Registers one or more loot items
* `def` Can be a single [#Loot definition] or a list of them
`dungeon_loot.registered_loot`
* Table of all registered loot, not to be modified manually
### Loot definition
name = "item:name",
chance = 0.5,
-- ^ chance value from 0.0 to 1.0 that the item will appear in the chest when chosen
-- Due to an extra step in the selection process, 0.5 does not(!) mean that
-- on average every second chest will have this item
count = {1, 4},
-- ^ table with minimum and maximum amounts of this item
-- optional, defaults to always single item
y = {-32768, -512},
-- ^ table with minimum and maximum heights this item can be found at
-- optional, defaults to no height restrictions
types = {"desert"},
-- ^ table with types of dungeons this item can be found in
-- supported types: "normal" (the cobble/mossycobble one), "sandstone"
-- "desert" and "ice"
-- optional, defaults to no type restrictions
## Fence API
Fence API
---------
Allows creation of new fences with "fencelike" drawtype.
@ -380,8 +232,7 @@ Allows creation of new fences with "fencelike" drawtype.
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults(),
## Walls API
Walls API
---------
The walls API allows easy addition of stone auto-connecting wall nodes.
@ -393,8 +244,7 @@ walls.register(name, desc, texture, mat, sounds)
^ mat = "default:stone". Used to auto-generate crafting recipe.
^ sounds = sounds: see [#Default sounds]
## Farming API
Farming API
-----------
The farming API allows you to easily register plants and hoes.
@ -427,8 +277,6 @@ The farming API allows you to easily register plants and hoes.
{
description = "", -- Description of seed item
harvest_description = "", -- Description of harvest item
-- (optional, derived automatically if not provided)
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
steps = 8, -- How many steps the plant has to grow, until it can be harvested
-- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
@ -436,12 +284,9 @@ The farming API allows you to easily register plants and hoes.
maxlight = default.LIGHT_MAX -- Maximum light to grow
}
## Fire API
Fire API
--------
Add group flammable when registering a node to make fire seek for it.
Add it to an item to make it burn up when dropped in lava or fire.
New node def property:
`on_burn(pos)`
@ -457,7 +302,7 @@ New node def property:
* `igniter` Player that used the tool, when available.
## Give Initial Stuff API
Give Initial Stuff API
----------------------
`give_initial_stuff.give(player)`
@ -489,68 +334,8 @@ New node def property:
^ Adds items to the list of items to be given
## Players API
-----------
The player API can register player models and update the player's appearance.
* `player_api.register_model(name, def)`
* Register a new model to be used by players
* name: model filename such as "character.x", "foo.b3d", etc.
* def: See [#Model definition]
* saved to player_api.registered_models
* `player_api.registered_player_models[name]`
* Get a model's definition
* see [#Model definition]
* `player_api.set_model(player, model_name)`
* Change a player's model
* `player`: PlayerRef
* `model_name`: model registered with player_api.register_model()
* `player_api.set_animation(player, anim_name [, speed])`
* Applies an animation to a player
* anim_name: name of the animation.
* speed: frames per second. If nil, default from the model is used
* `player_api.set_textures(player, textures)`
* Sets player textures
* `player`: PlayerRef
* `textures`: array of textures, If `textures` is nil the default
textures from the model def are used
* `player_api.get_animation(player)`
* Returns a table containing fields `model`, `textures` and `animation`.
* Any of the fields of the returned table may be nil.
* player: PlayerRef
* `player_api.player_attached`
* A table that maps a player name to a boolean.
* If the value for a given player is set to true, the default player
animations (walking, digging, ...) will no longer be updated.
Knockback from damage is also prevented for that player.
### Model Definition
{
animation_speed = 30, -- Default animation speed, in FPS.
textures = {"character.png", }, -- Default array of textures.
visual_size = {x = 1, y = 1}, -- Used to scale the model.
animations = {
-- <anim_name> = {x = <start_frame>, y = <end_frame>},
foo = {x = 0, y = 19},
bar = {x = 20, y = 39},
-- ...
},
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, -- In nodes from feet position
stepheight = 0.6, -- In nodes
eye_height = 1.47, -- In nodes above feet position
}
## TNT API
-------
TNT API
----------
`tnt.register_tnt(definition)`
@ -560,7 +345,6 @@ The player API can register player models and update the player's appearance.
* `description` A description for your TNT.
* `radius` The radius within which the TNT can destroy nodes. The default is 3.
* `damage_radius` The radius within which the TNT can damage players and mobs. By default it is twice the `radius`.
* `sound` The sound played when explosion occurs. By default it is `tnt_explode`.
* `disable_drops` Disable drops. By default it is set to false.
* `ignore_protection` Don't check `minetest.is_protected` before removing a node.
* `ignore_on_blast` Don't call `on_blast` even if a node has one.
@ -623,7 +407,7 @@ Both nodedefs and entitydefs can provide an `on_blast()` callback
* `drops` - a list of drops, e.g. {"wool:red"}
## Screwdriver API
Screwdriver API
---------------
The screwdriver API allows you to control a node's behaviour when a screwdriver is used on it.
@ -642,7 +426,7 @@ To use it, add the `on_screwdriver` function to the node definition.
* use `on_rotate = screwdriver.rotate_simple` to allow only face rotation
## Sethome API
Sethome API
-----------
The sethome API adds three global functions to allow mods to read a players home position,
@ -665,18 +449,14 @@ set a players home position and teleport a player to home position.
* return value: false if player cannot be sent home, otherwise true
## Sfinv API
Sfinv API
---------
It is recommended that you read this link for a good introduction to the
sfinv API by its author: https://rubenwardy.com/minetest_modding_book/en/chapters/sfinv.html
### sfinv Methods
**Pages**
* sfinv.set_page(player, pagename) - changes the page
* sfinv.get_page(player) - get the current page name. Will never return nil
* sfinv.get_homepage_name(player) - get the page name of the first page to show to a player
* sfinv.register_page(name, def) - register a page, see section below
* sfinv.override_page(name, def) - overrides fields of an page registered with register_page.
@ -773,68 +553,40 @@ And override this function to change the layout:
return table.concat(tmp, "")
end
## Stairs API
Stairs API
----------
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
delivered with Minetest Game, to keep them compatible with other mods.
`stairs.register_stair(subname, recipeitem, groups, images, description, sounds, worldaligntex)`
`stairs.register_stair(subname, recipeitem, groups, images, description, sounds)`
* Registers a stair
* Registers a stair.
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `groups`: see [Known damage and digging time defining groups]
* `images`: see [Tile definition]
* `description`: used for the description field in the stair's definition
* `sounds`: see [#Default sounds]
`stairs.register_slab(subname, recipeitem, groups, images, description, sounds, worldaligntex)`
`stairs.register_slab(subname, recipeitem, groups, images, description, sounds)`
* Registers a slab
* `subname`: Basically the material name (e.g. cobble) used for the slab name. Nodename pattern: "stairs:slab_subname"
* Registers a slabs
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble"
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the slab's definition
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `groups`: see [Known damage and digging time defining groups]
* `images`: see [Tile definition]
* `description`: used for the description field in the stair's definition
* `sounds`: see [#Default sounds]
`stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description)`
`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)`
* Registers an inner corner stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_inner_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition with "Inner" prepended
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional)
`stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description)`
* Registers an outer corner stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition with "Outer" prepended
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional)
`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, worldaligntex)`
* A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer
* A wrapper for stairs.register_stair and stairs.register_slab
* Uses almost the same arguments as stairs.register_stair
* `desc_stair`: Description for stair nodes. For corner stairs 'Inner' or 'Outer' will be prefixed
* `desc_stair`: Description for stair node
* `desc_slab`: Description for slab node
## Xpanes API
Xpanes API
----------
Creates panes that automatically connect to each other
@ -847,19 +599,13 @@ Creates panes that automatically connect to each other
### Pane definition
{
textures = {
"texture for front and back",
(unused),
"texture for the 4 edges"
}, -- More tiles aren't supported
textures = {"texture for sides", (unused), "texture for top and bottom"}, -- More tiles aren't supported
groups = {group = rating}, -- Uses the known node groups, see [Known damage and digging time defining groups]
sounds = SoundSpec, -- See [#Default sounds]
recipe = {{"","","","","","","","",""}}, -- Recipe field only
use_texture_alpha = true, -- Optional boolean (default: `false`) for colored glass panes
}
## Raillike definitions
Raillike definitions
--------------------
The following nodes use the group `connect_to_raillike` and will only connect to
@ -878,7 +624,7 @@ add `connect_to_raillike=minetest.raillike_group("rail")` into the `groups` tabl
of your node.
## Default sounds
Default sounds
--------------
Sounds inside the default table can be used within the sounds field of node definitions.
@ -892,50 +638,71 @@ Sounds inside the default table can be used within the sounds field of node defi
* `default.node_sound_glass_defaults()`
* `default.node_sound_metal_defaults()`
## Default constants
Default constants
-----------------
`default.LIGHT_MAX` The maximum light level (see [Node definition] light_source)
Player API
----------
## GUI and formspecs
-----------------
The player API can register player models and update the player's appearance.
`default.get_hotbar_bg(x, y)`
* `player_api.register_model(name, def)`
* Register a new model to be used by players
* name: model filename such as "character.x", "foo.b3d", etc.
* def: See [#Model definition]
* saved to player_api.registered_models
* Get the hotbar background as string, containing the formspec elements
* x: Horizontal position in the formspec
* y: Vertical position in the formspec
* `player_api.registered_player_models[name]`
* Get a model's definition
* see [#Model definition]
`default.gui_bg`
* `player_api.set_model(player, model_name)`
* Change a player's model
* `player`: PlayerRef
* `model_name`: model registered with player_api.register_model()
* Deprecated, remove from mods.
* `player_api.set_animation(player, anim_name [, speed])`
* Applies an animation to a player
* anim_name: name of the animation.
* speed: frames per second. If nil, default from the model is used
`default.gui_bg_img`
* `player_api.set_textures(player, textures)`
* Sets player textures
* `player`: PlayerRef
* `textures`: array of textures, If `textures` is nil the default
textures from the model def are used
* Deprecated, remove from mods.
* `player_api.get_animation(player)`
* Returns a table containing fields `model`, `textures` and `animation`.
* Any of the fields of the returned table may be nil.
* player: PlayerRef
`default.gui_slots`
* `player_api.player_attached`
* A table that maps a player name to a boolean.
* If the value for a given player is set to true, the default player
animations (walking, digging, ...) will no longer be updated.
Knockback from damage is also prevented for that player.
* Deprecated, remove from mods.
### Model Definition
`default.gui_survival_form`
{
animation_speed = 30, -- Default animation speed, in FPS.
textures = {"character.png", }, -- Default array of textures.
visual_size = {x = 1, y = 1}, -- Used to scale the model.
animations = {
-- <anim_name> = {x = <start_frame>, y = <end_frame>},
foo = {x = 0, y = 19},
bar = {x = 20, y = 39},
-- ...
},
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, -- In nodes from feet position
stepheight = 0.6, -- In nodes
eye_height = 1.47, -- In nodes above feet position
}
* Entire formspec for the survival inventory
`default.get_furnace_active_formspec(fuel_percent, item_percent)`
* Get the active furnace formspec using the defined GUI elements
* fuel_percent: Percent of how much the fuel is used
* item_percent: Percent of how much the item is cooked
`default.get_furnace_inactive_formspec()`
* Get the inactive furnace formspec using the defined GUI elements
## Leafdecay
Leafdecay
---------
To enable leaf decay for leaves when a tree is cut down by a player,
@ -969,44 +736,75 @@ callback overridden. All the nodes listed in `leaves` have their
`on_timer` callback overridden.
## Dyes
Dyes
----
Minetest Game dyes are registered with:
To make recipes that will work with any dye ever made by anybody, define
them based on groups. You can select any group of groups, based on your need for
amount of colors.
groups = {dye = 1, color_<color> = 1},
### Color groups
To make recipes that will work with dyes from many mods, define them using the
dye group and the color groups.
Base color groups:
Dye color groups:
* `basecolor_white`
* `basecolor_grey`
* `basecolor_black`
* `basecolor_red`
* `basecolor_yellow`
* `basecolor_green`
* `basecolor_cyan`
* `basecolor_blue`
* `basecolor_magenta`
* `color_white`
* `color_grey`
* `color_dark_grey`
* `color_black`
* `color_red`
* `color_pink`
* `color_orange`
* `color_brown`
* `color_yellow`
* `color_green`
* `color_dark_green`
* `color_blue`
* `color_cyan`
* `color_violet`
* `color_magenta`
Extended color groups ( * means also base color )
Example of one shapeless recipe using the dye group and a color group:
* `excolor_white` *
* `excolor_lightgrey`
* `excolor_grey` *
* `excolor_darkgrey`
* `excolor_black` *
* `excolor_red` *
* `excolor_orange`
* `excolor_yellow` *
* `excolor_lime`
* `excolor_green` *
* `excolor_aqua`
* `excolor_cyan` *
* `excolor_sky_blue`
* `excolor_blue` *
* `excolor_violet`
* `excolor_magenta` *
* `excolor_red_violet`
The whole unifieddyes palette as groups:
* `unicolor_<excolor>`
For the following, no white/grey/black is allowed:
* `unicolor_medium_<excolor>`
* `unicolor_dark_<excolor>`
* `unicolor_light_<excolor>`
* `unicolor_<excolor>_s50`
* `unicolor_medium_<excolor>_s50`
* `unicolor_dark_<excolor>_s50`
Example of one shapeless recipe using a color group:
minetest.register_craft({
type = "shapeless",
output = "<mod>:item_yellow",
recipe = {"<mod>:item_no_color", "group:dye,color_yellow"},
output = '<mod>:item_yellow',
recipe = {'<mod>:item_no_color', 'group:basecolor_yellow'},
})
### Color lists
## Trees
* `dye.basecolors` are an array containing the names of available base colors
* `dye.excolors` are an array containing the names of the available extended colors
Trees
-----
* `default.grow_tree(pos, is_apple_tree)`
@ -1042,14 +840,7 @@ Example of one shapeless recipe using the dye group and a color group:
* `default.grow_acacia_bush(pos)`
* Grows an acaia bush at pos
* `default.grow_pine_bush(pos)`
* Grows a pine bush at pos
* `default.grow_blueberry_bush(pos)`
* Grows a blueberry bush at pos
## Carts
Carts
-----
carts.register_rail(
@ -1071,8 +862,7 @@ Example of one shapeless recipe using the dye group and a color group:
likely be called many times per second, so the function needs
to make sure that the event is handled properly.
## Key API
Key API
-------
The key API allows mods to add key functionality to nodes that have
@ -1130,29 +920,17 @@ for the wielded skeleton key.
if `nil` is returned, it is assumed that the wielder did not have
permissions to create a key for this node, and no key is created.
`default.register_craft_metadata_copy(ingredient, result)`
This function registers a shapeless recipe that takes `ingredient`
and `result` as input and outputs `result`.
The metadata of the input `result` is copied to the output `result`.
## Table of Contents
- [Bucket API](#bucket-api)
- [Beds API](#beds-api)
- [Bed definition](#bed-definition)
- [Bones API](#bones-api)
- [Creative API](#creative-api)
- [Chests API](#chests-api)
- [Chest Definition](#chest-definition)
- [Doors API](#doors-api)
- [door ObjectRef Methods](#door-objectref-methods)
- [Methods](#methods)
- [Door definition](#door-definition)
- [Trapdoor definition](#trapdoor-definition)
- [Fence gate definition](#fence-gate-definition)
- [Dungeon Loot API](#dungeon-loot-api)
- [Loot definition](#loot-definition)
- [Fence API](#fence-api)
- [fence definition](#fence-definition)
- [Walls API](#walls-api)
@ -1161,8 +939,6 @@ The metadata of the input `result` is copied to the output `result`.
- [Plant definition](#plant-definition)
- [Fire API](#fire-api)
- [Give Initial Stuff API](#give-initial-stuff-api)
- [Players API](#players-api)
- [Model Definition](#model-definition)
- [TNT API](#tnt-api)
- [Screwdriver API](#screwdriver-api)
- [Sethome API](#sethome-api)
@ -1179,10 +955,12 @@ The metadata of the input `result` is copied to the output `result`.
- [Raillike definitions](#raillike-definitions)
- [Default sounds](#default-sounds)
- [Default constants](#default-constants)
- [GUI and formspecs](#gui-and-formspecs)
- [Player API](#player-api)
- [Model Definition](#model-definition)
- [Leafdecay](#leafdecay)
- [Dyes](#dyes)
- [Color groups](#color-groups)
- [Color lists](#color-lists)
- [Trees](#trees)
- [Carts](#carts)
- [Key API](#key-api)

View File

@ -1,4 +1,4 @@
Minetest5 Game API
Minetest Game API
=================
This is a fork of the original one at https://github.com/minetest/minetest_game
@ -7,11 +7,11 @@ For more information about fork check [Differences](#differences) section.
Introduction
------------
The Minetest5 Game game offers multiple new possibilities in addition to the Minetest engine's built-in API,
allowing you to add new plants to farming mod, buckets for new liquids, new stairs and custom panes.
For information on the Minetest5 API, visit https://codeberg.org/minenux/minetest-engine-minetest/src/branch/stable-5.2/doc/lua_api.txt
The Minetest4 Game game offers multiple new possibilities in addition to
the Minetest engine's built-in API, allowing you to add new plants to farming mod,
buckets for new liquids, new stairs and custom panes.
For information on the Minetest4 API, visit https://codeberg.org/minenux/minetest-engine-minetest/src/branch/stable-4.0/doc/lua_api.txt
Please note:
* [XYZ] refers to a section the Minetest API
@ -20,21 +20,15 @@ Please note:
## Table of Contents
- [Differences](#differences)
- [Bucket API](#bucket-api)
- [Beds API](#beds-api)
- [Bed definition](#bed-definition)
- [Bones API](#bones-api)
- [Creative API](#creative-api)
- [Chests API](#chests-api)
- [Chest Definition](#chest-definition)
- [Doors API](#doors-api)
- [door ObjectRef Methods](#door-objectref-methods)
- [Methods](#methods)
- [Door definition](#door-definition)
- [Trapdoor definition](#trapdoor-definition)
- [Fence gate definition](#fence-gate-definition)
- [Dungeon Loot API](#dungeon-loot-api)
- [Loot definition](#loot-definition)
- [Fence API](#fence-api)
- [fence definition](#fence-definition)
- [Walls API](#walls-api)
@ -43,8 +37,6 @@ Please note:
- [Plant definition](#plant-definition)
- [Fire API](#fire-api)
- [Give Initial Stuff API](#give-initial-stuff-api)
- [Players API](#players-api)
- [Model Definition](#model-definition)
- [TNT API](#tnt-api)
- [Screwdriver API](#screwdriver-api)
- [Sethome API](#sethome-api)
@ -61,30 +53,18 @@ Please note:
- [Raillike definitions](#raillike-definitions)
- [Default sounds](#default-sounds)
- [Default constants](#default-constants)
- [GUI and formspecs](#gui-and-formspecs)
- [Player API](#player-api)
- [Model Definition](#model-definition)
- [Leafdecay](#leafdecay)
- [Dyes](#dyes)
- [Color groups](#color-groups)
- [Color lists](#color-lists)
- [Trees](#trees)
- [Carts](#carts)
- [Key API](#key-api)
## Differences
This game api is the same.. just that format the document and progresivelly added new things,
this is cos this game sustitute some mods by improved versions:
* boats by the minetest-mod-boats forked from tenplus1
* creative by the minetest-mod-creative improved
* tnt by the minetest-mod-tnt forked and improved from tenplus1
* wool by the minetest-mod-wool forked and improved from tenplus1
* carts by the minetest-mod-carts forked and improved from tenplus1
* fire by the minetest-mod-fire forked and improved from templus1
* torch as sistution of `default:torch` by the minetest-mod-torchs
The original api from those remains but aditional (independient documented in each one)
are added.
## Bucket API
Bucket API
----------
The bucket API allows registering new types of buckets for non-default liquids.
@ -104,8 +84,7 @@ The bucket API allows registering new types of buckets for non-default liquids.
The filled bucket item is returned to the player that uses an empty bucket pointing to the given liquid source.
When punching with an empty bucket pointing to an entity or a non-liquid node, the on_punch of the entity or node will be triggered.
## Beds API
Beds API
--------
beds.register_bed(
@ -113,7 +92,6 @@ When punching with an empty bucket pointing to an entity or a non-liquid node, t
def -- See [#Bed definition]
)
* `beds.can_dig(bed_pos)` Returns a boolean whether the bed at `bed_pos` may be dug
* `beds.read_spawns() ` Returns a table containing players respawn positions
* `beds.kick_players()` Forces all players to leave bed
* `beds.skip_night()` Sets world time to morning and saves respawn position of all players currently sleeping
@ -139,18 +117,7 @@ When punching with an empty bucket pointing to an entity or a non-liquid node, t
}
}
## Bones API
---------
An ordered list of listnames (default: "main", "craft") of the player inventory,
that will be placed into bones or dropped on player death can be looked up or changed
in `bones.player_inventory_lists`.
e.g. `table.insert(bones.player_inventory_lists, "backpack")`
## Creative API
Creative API
------------
Use `creative.register_tab(name, title, items)` to add a tab with filtered items.
@ -171,69 +138,11 @@ The contents of `creative.formspec_add` is appended to every creative inventory
page. Mods can use it to add additional formspec elements onto the default
creative inventory formspec to be drawn after each update.
## Chests API
----------
The chests API allows the creation of chests, which have their own inventories for holding items.
`default.chest.get_chest_formspec(pos)`
* Returns a formspec for a specific chest.
* `pos` Location of the chest node, e.g `{x = 1, y = 1, z = 1}`
`default.chest.chest_lid_obstructed(pos)`
* Returns a boolean depending on whether or not a chest has its top obstructed by a solid node.
* `pos` Location of the chest node, e.g `{x = 1, y = 1, z = 1}`
`default.chest.chest_lid_close(pn)`
* Closes the chest that a player is currently looking in.
* `pn` The name of the player whose chest is going to be closed
`default.chest.open_chests`
* A table indexed by player name to keep track of who opened what chest.
* Key: The name of the player.
* Value: A table containing information about the chest the player is looking at.
e.g `{ pos = {1, 1, 1}, sound = null, swap = "chest" }`
`default.chest.register_chest(name, def)`
* Registers new chest
* `name` Name for chest
* `def` See [#Chest Definition]
### Chest Definition
description = "Chest",
tiles = {
"default_chest_top.png",
"default_chest_top.png",
"default_chest_side.png",
"default_chest_side.png",
"default_chest_front.png",
"default_chest_inside.png"
}, -- Textures which are applied to the chest model.
sounds = default.node_sound_wood_defaults(),
sound_open = "default_chest_open",
sound_close = "default_chest_close",
groups = {choppy = 2, oddly_breakable_by_hand = 2},
protected = false, -- If true, only placer can modify chest.
## Doors API
Doors API
---------
The doors mod allows modders to register custom doors and trapdoors.
`doors.registered_doors[name] = Door definition`
* Table of registered doors, indexed by door name
`doors.registered_trapdoors[name] = Trapdoor definition`
* Table of registered trap doors, indexed by trap door name
`doors.register_door(name, def)`
* Registers new door
@ -257,19 +166,12 @@ The doors mod allows modders to register custom doors and trapdoors.
* `pos` A position as a table, e.g `{x = 1, y = 1, z = 1}`
* Returns an ObjectRef to a door, or nil if the position does not contain a door
`doors.door_toggle(pos, node, clicker)`
### Methods
* Toggle door open or shut
* `pos` Position of the door
* `node` Node definition
* `clicker` Player definition for the player that clicked on the door
### door ObjectRef Methods
* `:open(player)` -- Open the door object, returns if door was opened
* `:close(player)` -- Close the door object, returns if door was closed
* `:toggle(player)` -- Toggle the door state, returns if state was toggled
* `:state()` -- returns the door state, true = open, false = closed
:open(player) -- Open the door object, returns if door was opened
:close(player) -- Close the door object, returns if door was closed
:toggle(player) -- Toggle the door state, returns if state was toggled
:state() -- returns the door state, true = open, false = closed
the "player" parameter can be omitted in all methods. If passed then
the usual permission checks will be performed to make sure the player
@ -282,15 +184,11 @@ permission checks are performed.
inventory_image = "mod_door_inv.png",
groups = {choppy = 2},
tiles = {"mod_door.png"}, -- UV map.
-- The front and back of the door must be identical in appearence as they swap on
-- open/close.
recipe = craftrecipe,
sounds = default.node_sound_wood_defaults(), -- optional
sound_open = sound play for open door, -- optional
sound_close = sound play for close door, -- optional
protected = false, -- If true, only placer can open the door (locked for others)
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-- optional function containing the on_rightclick callback, defaults to a doors.door_toggle-wrapper
### Trapdoor definition
@ -298,20 +196,11 @@ permission checks are performed.
inventory_image = "mod_trapdoor_inv.png",
groups = {choppy = 2},
tile_front = "doors_trapdoor.png", -- the texture for the front and back of the trapdoor
tile_side = "doors_trapdoor_side.png",
-- The texture for the four sides of the trapdoor.
-- The texture should have the trapdoor side drawn twice, in the lowest and highest
-- 1/8ths of the texture, both upright. The area between is not used.
-- The lower 1/8th will be used for the closed trapdoor, the higher 1/8th will be used
-- for the open trapdoor.
tile_side = "doors_trapdoor_side.png", -- the tiles of the four side parts of the trapdoor
sounds = default.node_sound_wood_defaults(), -- optional
sound_open = sound play for open door, -- optional
sound_close = sound play for close door, -- optional
protected = false, -- If true, only placer can open the door (locked for others)
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-- function containing the on_rightclick callback
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-- function containing the on_rightclick callback
### Fence gate definition
@ -321,45 +210,8 @@ permission checks are performed.
material = "default:wood",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults(), -- optional
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-- function containing the on_rightclick callback
## Dungeon Loot API
----------------
The mod that places chests with loot in dungeons provides an API to register additional loot.
`dungeon_loot.register(def)`
* Registers one or more loot items
* `def` Can be a single [#Loot definition] or a list of them
`dungeon_loot.registered_loot`
* Table of all registered loot, not to be modified manually
### Loot definition
name = "item:name",
chance = 0.5,
-- ^ chance value from 0.0 to 1.0 that the item will appear in the chest when chosen
-- Due to an extra step in the selection process, 0.5 does not(!) mean that
-- on average every second chest will have this item
count = {1, 4},
-- ^ table with minimum and maximum amounts of this item
-- optional, defaults to always single item
y = {-32768, -512},
-- ^ table with minimum and maximum heights this item can be found at
-- optional, defaults to no height restrictions
types = {"desert"},
-- ^ table with types of dungeons this item can be found in
-- supported types: "normal" (the cobble/mossycobble one), "sandstone"
-- "desert" and "ice"
-- optional, defaults to no type restrictions
## Fence API
Fence API
---------
Allows creation of new fences with "fencelike" drawtype.
@ -380,8 +232,7 @@ Allows creation of new fences with "fencelike" drawtype.
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = default.node_sound_wood_defaults(),
## Walls API
Walls API
---------
The walls API allows easy addition of stone auto-connecting wall nodes.
@ -393,8 +244,7 @@ walls.register(name, desc, texture, mat, sounds)
^ mat = "default:stone". Used to auto-generate crafting recipe.
^ sounds = sounds: see [#Default sounds]
## Farming API
Farming API
-----------
The farming API allows you to easily register plants and hoes.
@ -427,8 +277,6 @@ The farming API allows you to easily register plants and hoes.
{
description = "", -- Description of seed item
harvest_description = "", -- Description of harvest item
-- (optional, derived automatically if not provided)
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
steps = 8, -- How many steps the plant has to grow, until it can be harvested
-- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
@ -436,12 +284,9 @@ The farming API allows you to easily register plants and hoes.
maxlight = default.LIGHT_MAX -- Maximum light to grow
}
## Fire API
Fire API
--------
Add group flammable when registering a node to make fire seek for it.
Add it to an item to make it burn up when dropped in lava or fire.
New node def property:
`on_burn(pos)`
@ -457,7 +302,7 @@ New node def property:
* `igniter` Player that used the tool, when available.
## Give Initial Stuff API
Give Initial Stuff API
----------------------
`give_initial_stuff.give(player)`
@ -489,68 +334,8 @@ New node def property:
^ Adds items to the list of items to be given
## Players API
-----------
The player API can register player models and update the player's appearance.
* `player_api.register_model(name, def)`
* Register a new model to be used by players
* name: model filename such as "character.x", "foo.b3d", etc.
* def: See [#Model definition]
* saved to player_api.registered_models
* `player_api.registered_player_models[name]`
* Get a model's definition
* see [#Model definition]
* `player_api.set_model(player, model_name)`
* Change a player's model
* `player`: PlayerRef
* `model_name`: model registered with player_api.register_model()
* `player_api.set_animation(player, anim_name [, speed])`
* Applies an animation to a player
* anim_name: name of the animation.
* speed: frames per second. If nil, default from the model is used
* `player_api.set_textures(player, textures)`
* Sets player textures
* `player`: PlayerRef
* `textures`: array of textures, If `textures` is nil the default
textures from the model def are used
* `player_api.get_animation(player)`
* Returns a table containing fields `model`, `textures` and `animation`.
* Any of the fields of the returned table may be nil.
* player: PlayerRef
* `player_api.player_attached`
* A table that maps a player name to a boolean.
* If the value for a given player is set to true, the default player
animations (walking, digging, ...) will no longer be updated.
Knockback from damage is also prevented for that player.
### Model Definition
{
animation_speed = 30, -- Default animation speed, in FPS.
textures = {"character.png", }, -- Default array of textures.
visual_size = {x = 1, y = 1}, -- Used to scale the model.
animations = {
-- <anim_name> = {x = <start_frame>, y = <end_frame>},
foo = {x = 0, y = 19},
bar = {x = 20, y = 39},
-- ...
},
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, -- In nodes from feet position
stepheight = 0.6, -- In nodes
eye_height = 1.47, -- In nodes above feet position
}
## TNT API
-------
TNT API
----------
`tnt.register_tnt(definition)`
@ -560,7 +345,6 @@ The player API can register player models and update the player's appearance.
* `description` A description for your TNT.
* `radius` The radius within which the TNT can destroy nodes. The default is 3.
* `damage_radius` The radius within which the TNT can damage players and mobs. By default it is twice the `radius`.
* `sound` The sound played when explosion occurs. By default it is `tnt_explode`.
* `disable_drops` Disable drops. By default it is set to false.
* `ignore_protection` Don't check `minetest.is_protected` before removing a node.
* `ignore_on_blast` Don't call `on_blast` even if a node has one.
@ -623,7 +407,7 @@ Both nodedefs and entitydefs can provide an `on_blast()` callback
* `drops` - a list of drops, e.g. {"wool:red"}
## Screwdriver API
Screwdriver API
---------------
The screwdriver API allows you to control a node's behaviour when a screwdriver is used on it.
@ -642,7 +426,7 @@ To use it, add the `on_screwdriver` function to the node definition.
* use `on_rotate = screwdriver.rotate_simple` to allow only face rotation
## Sethome API
Sethome API
-----------
The sethome API adds three global functions to allow mods to read a players home position,
@ -665,18 +449,14 @@ set a players home position and teleport a player to home position.
* return value: false if player cannot be sent home, otherwise true
## Sfinv API
Sfinv API
---------
It is recommended that you read this link for a good introduction to the
sfinv API by its author: https://rubenwardy.com/minetest_modding_book/en/chapters/sfinv.html
### sfinv Methods
**Pages**
* sfinv.set_page(player, pagename) - changes the page
* sfinv.get_page(player) - get the current page name. Will never return nil
* sfinv.get_homepage_name(player) - get the page name of the first page to show to a player
* sfinv.register_page(name, def) - register a page, see section below
* sfinv.override_page(name, def) - overrides fields of an page registered with register_page.
@ -773,68 +553,40 @@ And override this function to change the layout:
return table.concat(tmp, "")
end
## Stairs API
Stairs API
----------
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
delivered with Minetest Game, to keep them compatible with other mods.
`stairs.register_stair(subname, recipeitem, groups, images, description, sounds, worldaligntex)`
`stairs.register_stair(subname, recipeitem, groups, images, description, sounds)`
* Registers a stair
* Registers a stair.
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `groups`: see [Known damage and digging time defining groups]
* `images`: see [Tile definition]
* `description`: used for the description field in the stair's definition
* `sounds`: see [#Default sounds]
`stairs.register_slab(subname, recipeitem, groups, images, description, sounds, worldaligntex)`
`stairs.register_slab(subname, recipeitem, groups, images, description, sounds)`
* Registers a slab
* `subname`: Basically the material name (e.g. cobble) used for the slab name. Nodename pattern: "stairs:slab_subname"
* Registers a slabs
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble"
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the slab's definition
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `groups`: see [Known damage and digging time defining groups]
* `images`: see [Tile definition]
* `description`: used for the description field in the stair's definition
* `sounds`: see [#Default sounds]
`stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description)`
`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)`
* Registers an inner corner stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_inner_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition with "Inner" prepended
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional)
`stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description)`
* Registers an outer corner stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition with "Outer" prepended
* `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional)
`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, worldaligntex)`
* A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer
* A wrapper for stairs.register_stair and stairs.register_slab
* Uses almost the same arguments as stairs.register_stair
* `desc_stair`: Description for stair nodes. For corner stairs 'Inner' or 'Outer' will be prefixed
* `desc_stair`: Description for stair node
* `desc_slab`: Description for slab node
## Xpanes API
Xpanes API
----------
Creates panes that automatically connect to each other
@ -847,19 +599,13 @@ Creates panes that automatically connect to each other
### Pane definition
{
textures = {
"texture for front and back",
(unused),
"texture for the 4 edges"
}, -- More tiles aren't supported
textures = {"texture for sides", (unused), "texture for top and bottom"}, -- More tiles aren't supported
groups = {group = rating}, -- Uses the known node groups, see [Known damage and digging time defining groups]
sounds = SoundSpec, -- See [#Default sounds]
recipe = {{"","","","","","","","",""}}, -- Recipe field only
use_texture_alpha = true, -- Optional boolean (default: `false`) for colored glass panes
}
## Raillike definitions
Raillike definitions
--------------------
The following nodes use the group `connect_to_raillike` and will only connect to
@ -878,7 +624,7 @@ add `connect_to_raillike=minetest.raillike_group("rail")` into the `groups` tabl
of your node.
## Default sounds
Default sounds
--------------
Sounds inside the default table can be used within the sounds field of node definitions.
@ -892,50 +638,71 @@ Sounds inside the default table can be used within the sounds field of node defi
* `default.node_sound_glass_defaults()`
* `default.node_sound_metal_defaults()`
## Default constants
Default constants
-----------------
`default.LIGHT_MAX` The maximum light level (see [Node definition] light_source)
Player API
----------
## GUI and formspecs
-----------------
The player API can register player models and update the player's appearance.
`default.get_hotbar_bg(x, y)`
* `player_api.register_model(name, def)`
* Register a new model to be used by players
* name: model filename such as "character.x", "foo.b3d", etc.
* def: See [#Model definition]
* saved to player_api.registered_models
* Get the hotbar background as string, containing the formspec elements
* x: Horizontal position in the formspec
* y: Vertical position in the formspec
* `player_api.registered_player_models[name]`
* Get a model's definition
* see [#Model definition]
`default.gui_bg`
* `player_api.set_model(player, model_name)`
* Change a player's model
* `player`: PlayerRef
* `model_name`: model registered with player_api.register_model()
* Deprecated, remove from mods.
* `player_api.set_animation(player, anim_name [, speed])`
* Applies an animation to a player
* anim_name: name of the animation.
* speed: frames per second. If nil, default from the model is used
`default.gui_bg_img`
* `player_api.set_textures(player, textures)`
* Sets player textures
* `player`: PlayerRef
* `textures`: array of textures, If `textures` is nil the default
textures from the model def are used
* Deprecated, remove from mods.
* `player_api.get_animation(player)`
* Returns a table containing fields `model`, `textures` and `animation`.
* Any of the fields of the returned table may be nil.
* player: PlayerRef
`default.gui_slots`
* `player_api.player_attached`
* A table that maps a player name to a boolean.
* If the value for a given player is set to true, the default player
animations (walking, digging, ...) will no longer be updated.
Knockback from damage is also prevented for that player.
* Deprecated, remove from mods.
### Model Definition
`default.gui_survival_form`
{
animation_speed = 30, -- Default animation speed, in FPS.
textures = {"character.png", }, -- Default array of textures.
visual_size = {x = 1, y = 1}, -- Used to scale the model.
animations = {
-- <anim_name> = {x = <start_frame>, y = <end_frame>},
foo = {x = 0, y = 19},
bar = {x = 20, y = 39},
-- ...
},
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, -- In nodes from feet position
stepheight = 0.6, -- In nodes
eye_height = 1.47, -- In nodes above feet position
}
* Entire formspec for the survival inventory
`default.get_furnace_active_formspec(fuel_percent, item_percent)`
* Get the active furnace formspec using the defined GUI elements
* fuel_percent: Percent of how much the fuel is used
* item_percent: Percent of how much the item is cooked
`default.get_furnace_inactive_formspec()`
* Get the inactive furnace formspec using the defined GUI elements
## Leafdecay
Leafdecay
---------
To enable leaf decay for leaves when a tree is cut down by a player,
@ -969,44 +736,75 @@ callback overridden. All the nodes listed in `leaves` have their
`on_timer` callback overridden.
## Dyes
Dyes
----
Minetest Game dyes are registered with:
To make recipes that will work with any dye ever made by anybody, define
them based on groups. You can select any group of groups, based on your need for
amount of colors.
groups = {dye = 1, color_<color> = 1},
### Color groups
To make recipes that will work with dyes from many mods, define them using the
dye group and the color groups.
Base color groups:
Dye color groups:
* `basecolor_white`
* `basecolor_grey`
* `basecolor_black`
* `basecolor_red`
* `basecolor_yellow`
* `basecolor_green`
* `basecolor_cyan`
* `basecolor_blue`
* `basecolor_magenta`
* `color_white`
* `color_grey`
* `color_dark_grey`
* `color_black`
* `color_red`
* `color_pink`
* `color_orange`
* `color_brown`
* `color_yellow`
* `color_green`
* `color_dark_green`
* `color_blue`
* `color_cyan`
* `color_violet`
* `color_magenta`
Extended color groups ( * means also base color )
Example of one shapeless recipe using the dye group and a color group:
* `excolor_white` *
* `excolor_lightgrey`
* `excolor_grey` *
* `excolor_darkgrey`
* `excolor_black` *
* `excolor_red` *
* `excolor_orange`
* `excolor_yellow` *
* `excolor_lime`
* `excolor_green` *
* `excolor_aqua`
* `excolor_cyan` *
* `excolor_sky_blue`
* `excolor_blue` *
* `excolor_violet`
* `excolor_magenta` *
* `excolor_red_violet`
The whole unifieddyes palette as groups:
* `unicolor_<excolor>`
For the following, no white/grey/black is allowed:
* `unicolor_medium_<excolor>`
* `unicolor_dark_<excolor>`
* `unicolor_light_<excolor>`
* `unicolor_<excolor>_s50`
* `unicolor_medium_<excolor>_s50`
* `unicolor_dark_<excolor>_s50`
Example of one shapeless recipe using a color group:
minetest.register_craft({
type = "shapeless",
output = "<mod>:item_yellow",
recipe = {"<mod>:item_no_color", "group:dye,color_yellow"},
output = '<mod>:item_yellow',
recipe = {'<mod>:item_no_color', 'group:basecolor_yellow'},
})
### Color lists
## Trees
* `dye.basecolors` are an array containing the names of available base colors
* `dye.excolors` are an array containing the names of the available extended colors
Trees
-----
* `default.grow_tree(pos, is_apple_tree)`
@ -1042,14 +840,7 @@ Example of one shapeless recipe using the dye group and a color group:
* `default.grow_acacia_bush(pos)`
* Grows an acaia bush at pos
* `default.grow_pine_bush(pos)`
* Grows a pine bush at pos
* `default.grow_blueberry_bush(pos)`
* Grows a blueberry bush at pos
## Carts
Carts
-----
carts.register_rail(
@ -1071,8 +862,7 @@ Example of one shapeless recipe using the dye group and a color group:
likely be called many times per second, so the function needs
to make sure that the event is handled properly.
## Key API
Key API
-------
The key API allows mods to add key functionality to nodes that have
@ -1130,29 +920,17 @@ for the wielded skeleton key.
if `nil` is returned, it is assumed that the wielder did not have
permissions to create a key for this node, and no key is created.
`default.register_craft_metadata_copy(ingredient, result)`
This function registers a shapeless recipe that takes `ingredient`
and `result` as input and outputs `result`.
The metadata of the input `result` is copied to the output `result`.
## Table of Contents
- [Bucket API](#bucket-api)
- [Beds API](#beds-api)
- [Bed definition](#bed-definition)
- [Bones API](#bones-api)
- [Creative API](#creative-api)
- [Chests API](#chests-api)
- [Chest Definition](#chest-definition)
- [Doors API](#doors-api)
- [door ObjectRef Methods](#door-objectref-methods)
- [Methods](#methods)
- [Door definition](#door-definition)
- [Trapdoor definition](#trapdoor-definition)
- [Fence gate definition](#fence-gate-definition)
- [Dungeon Loot API](#dungeon-loot-api)
- [Loot definition](#loot-definition)
- [Fence API](#fence-api)
- [fence definition](#fence-definition)
- [Walls API](#walls-api)
@ -1161,8 +939,6 @@ The metadata of the input `result` is copied to the output `result`.
- [Plant definition](#plant-definition)
- [Fire API](#fire-api)
- [Give Initial Stuff API](#give-initial-stuff-api)
- [Players API](#players-api)
- [Model Definition](#model-definition)
- [TNT API](#tnt-api)
- [Screwdriver API](#screwdriver-api)
- [Sethome API](#sethome-api)
@ -1179,10 +955,12 @@ The metadata of the input `result` is copied to the output `result`.
- [Raillike definitions](#raillike-definitions)
- [Default sounds](#default-sounds)
- [Default constants](#default-constants)
- [GUI and formspecs](#gui-and-formspecs)
- [Player API](#player-api)
- [Model Definition](#model-definition)
- [Leafdecay](#leafdecay)
- [Dyes](#dyes)
- [Color groups](#color-groups)
- [Color lists](#color-lists)
- [Trees](#trees)
- [Carts](#carts)
- [Key API](#key-api)

View File

@ -1,5 +1,5 @@
# This file contains settings of Minetest Game that can be changed in
# minetest.conf.
# This file contains settings of minetest4 Game that can be changed in
# minetest4.conf.
# By default, all the settings are commented and not functional.
# Uncomment settings by removing the preceding #.
@ -37,17 +37,17 @@
# Whether lavacooling should be enabled.
#enable_lavacooling = true
# Whether the stuff in initial_stuff should be given to new players.
# Whether the stuff in initial_stuff should be given to new players
# its depends of the configured at the initital_stuff_mod
#give_initial_stuff = true
# What initial stuff will be given to player if initial stuff are set to true
#initial_stuff = default:wood,farming:bread,default:furnace,default:torch
# Whether the TNT mod should be enabled.
# Whether the TNT mod should be enabled
#enable_tnt = <true in singleplayer, false in multiplayer>
# The radius of a TNT explosion.
# The radius of a TNT explosion
#tnt_radius = 3
# Enable the stairs mod ABM that replaces the old 'upside down'
@ -62,18 +62,7 @@
# Default value is true.
#enable_bed_night_skip = true
# If enabled, fences and walls cannot be jumped over.
#enable_fence_tall = false
# Whether the engine's spawn search, which does not check for a suitable
# starting biome, is used.
# Default value is false.
#engine_spawn = false
# Whether river water source nodes create flowing sounds.
# Helps rivers create more sound, especially on level sections.
#river_source_sounds = false
# Enable cloud variation by the 'weather' mod.
# Non-functional in V6 or Singlenode mapgens.
#enable_weather = true

View File

@ -5,56 +5,41 @@ For information check [../README.md](../README.md)
## Content
| mod name | origin or work | version | info |
| ------------------ | --------------------------------------------------- | -------- | --- |
| api | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | [api](../game_api.md) |
| beds | https://codeberg.org/minenux/minetest-mod-beds | https://codeberg.org/minenux/minetest-mod-beds/commit/a1aac5940c88106b901c00409d7dac942720dd5b | [beds/README.md](beds/README.md) |
| boats | https://codeberg.org/minenux/minetest-mod-boats | https://codeberg.org/minenux/minetest-mod-boats/commit/e412ae84db3c443618b117fb35ae69e3c9bbae10 | [boats/README.md](boats/README.md) |
| bucket | https://codeberg.org/minenux/minetest-mod-bucket.git | https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5 | [bucket/README.md](bucket/README.md) |
| butterflies | https://codeberg.org/minenux/minetest-mod-bucket.git | https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5 | [bucket/README.md](bucket/README.md) |
| bones | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| binoculars | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| carts | https://codeberg.org/minenux/minetest-mod-carts | https://codeberg.org/minenux/minetest-mod-carts/commit/dcbca916cffdcec281f0129ef350db2686bda933 | [carts/README.md](carts/README.md) |
| creative | https://codeberg.org/minenux/minetest-mod-creative | https://codeberg.org/minenux/minetest-mod-creative/commit/ca09e773701f834fec7de18bf13598b3323778db | [creative/README.md](creative/README.md) |
| default | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| player_api | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| env_sounds | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| game_commands | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| spawn | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| doors | https://codeberg.org/minenux/minetest-mod-doors | https://codeberg.org/minenux/minetest-mod-doors/commit/a89ab0454deb4933b6e4971c57055c40b7938e5b | [doors/README.md](doors/README.md) |
| dungeon_loot | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| dye | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| farming | https://codeberg.org/minenux/minetest-mod-farming | https://codeberg.org/minenux/minetest-mod-farming/commit/08c3a9b37bab5d8a0f5971b168aef412db5fc424 | [farming/README.md](farming/README.md) |
| fire | https://codeberg.org/minenux/minetest-mod-fire | https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2 | [fire/README.md](fire/README.md) |
| fireflies | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/fc4ab2538d432a20978ee3bbd1b69a42446e9132 | [fireflies/README.md](fireflies/README.md) |
| flowers | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| hudbars | https://codeberg.org/minenux/minetest-mod-hudbars | https://codeberg.org/minenux/minetest-mod-hudbars/commit/e3db263828cb96f06d848e6dc80d90f21c7f92a0 | [hudbars/README.md](hudbars/README.md) |
| give_initial_stuff | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/ee86fb1c41e7d8d2a1d94764dd64808bc8ff5999 | [give_initial_stuff/README.md](give_initial_stuff/README.md) |
| killme | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| sfinv | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| stairs | https://codeberg.org/minenux/minetest-mod-stairs | https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110 | [stairs/README.md](stairs/README.md) |
| screwdriver | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| sethome | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/8e59006dc81ebe6785380158e57ba126cb3a4163 | |
| tnt | https://codeberg.org/minenux/minetest-mod-tnt | https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027 | [tnt/README.md](tnt/README.md) |
| toolranks | https://codeberg.org/minenux/minetest-mod-toolranks | https://codeberg.org/minenux/minetest-mod-toolranks/commit/5c9553e5ac6cc7ae375033b76ef7771a6935c771 | [toolranks/README.md](toolranks/README.md) |
| vessels | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| walls | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| weather | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| wool | https://codeberg.org/minenux/minetest-mod-wool | https://codeberg.org/minenux/minetest-mod-wool/commit/de642a08e80bfd7a4a1e5629e50458a609dbda3a | [wool/README.md](wool/README.md) |
| xpanes | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | |
| xdecor | https://codeberg.org/minenux/minetest-game-xdecor | https://codeberg.org/minenux/minetest-game-xdecor/commit/cd0c35b8c58153f7c353b5dbfac35e524fa0ea18 | [xdecor/README.md](xdecor/README.md) |
* api
* beds
* bucket
* bones
* boats
* butterflies
* creative
* default
* doors
* farming
* fire
* fireflies
* give_initial_stuff
* stairs
* carts
* dye
* flowers
* screwdriver
* tnt
* xpanes
* sfinv
* vessels
* walls
* wool
The default mod was splitted now sethome and player_api are mods, binoculars from v5 are
just separate privilegies for zoom, butterflies and fireflies from v5 can be set
by dmobs or mobs_doomed mod, the spawn mod is just minimal spawn management
The default mod provides sethome and player_api call ones, binoculars from v5 are
just separate privilegies for zoom, the spawn mod is just minimal spawn management
pooly provided and better managed by mods like rspawn and spawnrandom.
## Compatibility
This source code and files are focused in most newer minetest5 engine
from https://codeberg.org/minenux/minetest-engine/src/branch/stable-5.2
For minetest4 check https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.0
This source code and files are only compatible with matched minetest4 engine
from https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.0
Additionally, when the Minetest4 engine is tagged to be a certain version (e.g.
4.0.17), Minetest Game is tagged with the version 4.0.17 too.
## Licensing

View File

@ -1,33 +0,0 @@
NEXT
----
- add more beds as fuel, add mini-game respawn flag.
- add new white simple bed, change red bed recipes to use red wool, add my own screenshot
- older engine detection and intlib
1.0.1 beta
----------
- Add backwards compatibility with PilzAdam's beds mod
- Fix placement
- Fix small bugs
- Prevent possible crash
1.1
---
- Add fancy bed model (based on jp's model)
- Add API to register beds
- Allow players always to detach from bed (by donat-b)
- If more than 50% of players want sleep they can skip the night
- Don't show sleep dialog in singleplayer
1.1.1
-----
- Prevent possbile crash by trying to reposition leaving players
1.2
---
- Updated to use default bed functions
- Texture check to fix beds using old api
- 'bed_sleep_divide' setting added [1 for all, 2 for half, 3 for third]
- Add POVA support
- Add pink fancy bed and blue simple bed

View File

@ -1,104 +0,0 @@
minetest mod Beds
=========================
This mod improves beds which allows sleep, featured to (auto) skip the night.
Information
-----------
This mod is named `beds` to sleep, by rightclick the bed. It featured
in singleplayer mode that the night gets skipped immediately. If playing
in multiplayer you get shown how many other players are in bed too,
if all players are sleeping the night gets skipped.
![screenshot.jpg](screenshot.jpg)
Tech information
----------------
This mod sustitute default one, you must disable the default of minetest
game if present or override it.
#### Features
* Night Skypping:
This mod auto featured night skip in singleplayer, in multiplayer it skipped
if more than a set percentage (default 50%) of the players are lying
in bed and use this option. Check configuration section for more info.
* Controlled respawning:
If you have slept in bed (not just lying in it) your respawn point
is set to the beds location and you will respawn there after
death. Check configuration section for more info.
* More beds:
It features more beds, so along with the Red simple bed we now have White and
Blue, and the fance beds has the original Red and now Pink.
#### Dependencies
* default
* player_api (for newer engines)
Optional dependences:
* intllib (only for older engines)
* pova (optional)
The pova mod are not xplicit set as optional depends, due the circular depends bug,
its detected and used.
#### Configuration
| Configuration | type | default | place file | Notes about |
| --------------------- | ----- | ------- | ------------ | ----------------------------------------- |
| enable_bed_respawn | bool | true | minetest.conf | Enable respawn point set to last sleep bed |
| enable_bed_night_skip | bool | false | minetest.conf | You can disable the night skip feature |
| bed_sleep_divide | int | 2 | minetest.conf | Division of players needed to skip night |
#### Nodes
Crafting are same as original default mod, but colored uses a white plus the other color.
| Node name | Description name |
| ----------------------- | --------------------- |
| beds:bed | Simple bed |
| beds:bed_blue | Simple bed blue |
| beds:fancy_bed | Fancy shaped bed |
| beds:fancy_bed_pink | Fancy shaped bed pink |
#### Nodes and Aliasing
| mod name : node name | new mod name : new node |
| --------------------------- | ----------------------- |
| beds:bed_top_red | beds:bed_top |
| beds:bed_bottom_red | beds:bed_bottom |
#### Mini-Game Support
If enable_bed_respawn is set to true and a player dies when playing a mini-game then this
can interrupt the game, so a special beds.respawn[player_name] flag has been added which
is set to 'true' by default to always respawn player at their bed, but can be set to
'false' during a mini-game to stop this behaviour.
License
------
### Authors of source code
Originally by BlockMen (MIT)
Various Minetest developers and contributors (MIT)
### Authors of media (textures)
BlockMen (CC BY-SA 3.0)
All textures unless otherwise noted
JP (WTFPL)
All models unless otherwise noted
Check [license.txt](license.txt)

30
mods/beds/README.txt Normal file
View File

@ -0,0 +1,30 @@
Minetest Game mod: beds
=======================
See license.txt for license information.
Authors of source code
----------------------
Originally by BlockMen (MIT)
Various Minetest developers and contributors (MIT)
Authors of media (textures)
---------------------------
BlockMen (CC BY-SA 3.0)
All textures unless otherwise noted
TumeniNodes (CC BY-SA 3.0)
beds_bed_under.png
This mod adds a bed to Minetest which allows to skip the night.
To sleep, rightclick the bed. If playing in singleplayer mode the night gets skipped
immediately. If playing multiplayer you get shown how many other players are in bed too,
if all players are sleeping the night gets skipped. The night skip can be forced if more
than 50% of the players are lying in bed and use this option.
Another feature is a controlled respawning. If you have slept in bed (not just lying in
it) your respawn point is set to the beds location and you will respawn there after
death.
You can disable the respawn at beds by setting "enable_bed_respawn = false" in
minetest.conf.
You can disable the night skip feature by setting "enable_bed_night_skip = false" in
minetest.conf or by using the /set command in-game.

View File

@ -1,62 +1,61 @@
local reverse = true
local function destruct_bed(pos, n)
local node = minetest.get_node(pos)
local other
if n == 2 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.subtract(pos, dir)
elseif n == 1 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.add(pos, dir)
end
if reverse then
reverse = not reverse
minetest.remove_node(other)
minetest.check_for_falling(other)
else
reverse = not reverse
end
end
function beds.register_bed(name, def)
local new_tiles
local new_mesh = "beds_simple_bed.obj"
-- old api texture check
if def.tiles and def.tiles.bottom then
new_tiles = "beds_simple_bed.png" -- default
-- check for fancy bed
if def.nodebox and def.nodebox.bottom and #def.nodebox.bottom > 3 then
new_tiles = "beds_fancy_bed.png"
new_mesh = "beds_fancy_bed.obj"
end
end
-- register bed node
minetest.register_node(name, {
minetest.register_node(name .. "_bottom", {
description = def.description,
inventory_image = def.inventory_image,
wield_image = def.wield_image,
drawtype = "mesh",
mesh = def.mesh or new_mesh,
tiles = new_tiles or def.tiles,
drawtype = "nodebox",
tiles = def.tiles.bottom,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
stack_max = 1,
groups = {
choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1,
fall_damage_add_percent = -40, bouncy = 85
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
sounds = def.sounds or default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = def.nodebox.bottom,
},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = def.selectionbox
},
collision_box = {
type = "fixed",
fixed = def.collisionbox
fixed = def.selectionbox,
},
on_place = function(itemstack, placer, pointed_thing)
local under = pointed_thing.under
local node = minetest.get_node(under)
local udef = minetest.registered_nodes[node.name]
if udef and udef.on_rightclick
and not (placer and placer:is_player()
and placer:get_player_control().sneak) then
if udef and udef.on_rightclick and
not (placer and placer:is_player() and
placer:get_player_control().sneak) then
return udef.on_rightclick(under, node, placer, itemstack,
pointed_thing) or itemstack
end
local pos
if udef and udef.buildable_to then
pos = under
else
@ -65,16 +64,13 @@ function beds.register_bed(name, def)
local player_name = placer and placer:get_player_name() or ""
if minetest.is_protected(pos, player_name)
and not minetest.check_player_privs(player_name, "protection_bypass") then
if minetest.is_protected(pos, player_name) and
not minetest.check_player_privs(player_name, "protection_bypass") then
minetest.record_protection_violation(pos, player_name)
return itemstack
end
local node_def = minetest.registered_nodes[minetest.get_node(pos).name]
if not node_def or not node_def.buildable_to then
return itemstack
end
@ -83,46 +79,100 @@ function beds.register_bed(name, def)
minetest.dir_to_facedir(placer:get_look_dir()) or 0
local botpos = vector.add(pos, minetest.facedir_to_dir(dir))
if minetest.is_protected(botpos, player_name)
and not minetest.check_player_privs(player_name, "protection_bypass") then
if minetest.is_protected(botpos, player_name) and
not minetest.check_player_privs(player_name, "protection_bypass") then
minetest.record_protection_violation(botpos, player_name)
return itemstack
end
local botdef = minetest.registered_nodes[minetest.get_node(botpos).name]
if not botdef or not botdef.buildable_to then
return itemstack
end
minetest.set_node(pos, {name = name, param2 = dir})
minetest.set_node(pos, {name = name .. "_bottom", param2 = dir})
minetest.set_node(botpos, {name = name .. "_top", param2 = dir})
if not beds.is_creative(player_name) then
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name)) then
itemstack:take_item()
end
return itemstack
end,
on_rightclick = function(pos, node, clicker)
beds.on_rightclick(pos, clicker)
end,
on_destruct = function(pos)
beds.remove_spawns_at(pos)
destruct_bed(pos, 1)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
beds.on_rightclick(pos, clicker)
return itemstack
end,
on_rotate = function(pos, node, user, _, new_param2)
local dir = minetest.facedir_to_dir(node.param2)
local p = vector.add(pos, dir)
local node2 = minetest.get_node_or_nil(p)
if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or
not node.param2 == node2.param2 then
return false
end
if minetest.is_protected(p, user:get_player_name()) then
minetest.record_protection_violation(p, user:get_player_name())
return false
end
if new_param2 % 32 > 3 then
return false
end
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
local node3 = minetest.get_node_or_nil(newp)
local node_def = node3 and minetest.registered_nodes[node3.name]
if not node_def or not node_def.buildable_to then
return false
end
if minetest.is_protected(newp, user:get_player_name()) then
minetest.record_protection_violation(newp, user:get_player_name())
return false
end
node.param2 = new_param2
-- do not remove_node here - it will trigger destroy_bed()
minetest.set_node(p, {name = "air"})
minetest.set_node(pos, node)
minetest.set_node(newp, {name = name .. "_top", param2 = new_param2})
return true
end,
can_dig = function(pos, player)
return beds.can_dig(pos)
end
end,
})
minetest.register_alias(name .. "_bottom", name)
minetest.register_alias(name .. "_top", "air")
minetest.register_node(name .. "_top", {
drawtype = "nodebox",
tiles = def.tiles.top,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
pointable = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
sounds = def.sounds or default.node_sound_wood_defaults(),
drop = name .. "_bottom",
node_box = {
type = "fixed",
fixed = def.nodebox.top,
},
on_destruct = function(pos)
destruct_bed(pos, 2)
end,
can_dig = function(pos, player)
local node = minetest.get_node(pos)
local dir = minetest.facedir_to_dir(node.param2)
local p = vector.add(pos, dir)
return beds.can_dig(p)
end,
})
minetest.register_alias(name, name .. "_bottom")
-- register recipe
minetest.register_craft({
output = name,
recipe = def.recipe

View File

@ -1,79 +1,87 @@
local S = beds.get_translator
-- Fancy shaped bed
beds.register_bed("beds:fancy_bed", {
description = S("Red Fancy Bed"),
description = "Fancy Bed",
inventory_image = "beds_bed_fancy.png",
wield_image = "beds_bed_fancy.png",
tiles = {"beds_fancy_bed.png", "default_wood.png"},
mesh = "beds_fancy_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5},
tiles = {
bottom = {
"beds_bed_top1.png",
"beds_bed_under.png",
"beds_bed_side1.png",
"beds_bed_side1.png^[transformFX",
"beds_bed_foot.png",
"beds_bed_foot.png",
},
top = {
"beds_bed_top2.png",
"beds_bed_under.png",
"beds_bed_side2.png",
"beds_bed_side2.png^[transformFX",
"beds_bed_head.png",
"beds_bed_head.png",
}
},
nodebox = {
bottom = {
{-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
{0.375, -0.5, -0.5, 0.5, -0.065, -0.4375},
{-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
},
top = {
{-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
{0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5},
{-0.5, 0, 0.4375, 0.5, 0.125, 0.5},
{-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5},
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
{-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
}
},
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"", "", "group:stick"},
{"wool:red", "wool:red", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
})
beds.register_bed("beds:fancy_bed_pink", {
description = S("Pink Fancy Bed"),
inventory_image = "beds_bed_fancy_pink.png",
wield_image = "beds_bed_fancy_pink.png",
tiles = {"beds_fancy_bed_pink.png", "default_wood.png"},
mesh = "beds_fancy_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5},
recipe = {
{"", "", "group:stick"},
{"wool:pink", "wool:pink", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
{"wool:white", "wool:white", "wool:white"},
{"group:wood", "group:wood", "group:wood"},
},
})
-- Simple shaped bed
beds.register_bed("beds:bed_white", {
description = S("White Simple Bed"),
inventory_image = "beds_bed_white.png",
wield_image = "beds_bed_white.png",
tiles = {"beds_simple_bed_white.png"},
mesh = "beds_simple_bed.obj",
beds.register_bed("beds:bed", {
description = "Simple Bed",
inventory_image = "beds_bed.png",
wield_image = "beds_bed.png",
tiles = {
bottom = {
"beds_bed_top_bottom.png^[transformR90",
"beds_bed_under.png",
"beds_bed_side_bottom_r.png",
"beds_bed_side_bottom_r.png^[transformfx",
"beds_transparent.png",
"beds_bed_side_bottom.png"
},
top = {
"beds_bed_top_top.png^[transformR90",
"beds_bed_under.png",
"beds_bed_side_top_r.png",
"beds_bed_side_top_r.png^[transformfx",
"beds_bed_side_top.png",
"beds_transparent.png",
}
},
nodebox = {
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
},
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"wool:white", "wool:white", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
})
beds.register_bed("beds:bed", {
description = S("Red Simple Bed"),
inventory_image = "beds_bed.png",
wield_image = "beds_bed.png",
tiles = {"beds_simple_bed.png"},
mesh = "beds_simple_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"wool:red", "wool:red", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
})
beds.register_bed("beds:bed_blue", {
description = S("Blue Simple Bed"),
inventory_image = "beds_bed_blue.png",
wield_image = "beds_bed_blue.png",
tiles = {"beds_simple_bed_blue.png"},
mesh = "beds_simple_bed.obj",
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"wool:blue", "wool:blue", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
}
},
})
-- Aliases for PilzAdam's beds mod
@ -85,30 +93,12 @@ minetest.register_alias("beds:bed_top_red", "beds:bed_top")
minetest.register_craft({
type = "fuel",
recipe = "beds:fancy_bed",
burntime = 13
recipe = "beds:fancy_bed_bottom",
burntime = 13,
})
minetest.register_craft({
type = "fuel",
recipe = "beds:fancy_bed_pink",
burntime = 13
})
minetest.register_craft({
type = "fuel",
recipe = "beds:bed",
burntime = 12
})
minetest.register_craft({
type = "fuel",
recipe = "beds:bed_blue",
burntime = 12
})
minetest.register_craft({
type = "fuel",
recipe = "beds:bed_white",
burntime = 12
recipe = "beds:bed_bottom",
burntime = 12,
})

View File

@ -1,4 +1,2 @@
default
wool
pova?
intllib?

View File

@ -1 +0,0 @@
beds which allows sleep, featured to (auto) skip the night.

View File

@ -1,11 +1,6 @@
local S = beds.get_translator
local is_50 = beds.is_50
local is_54 = beds.is_54
local is_pova = minetest.get_modpath("pova")
local pi = math.pi
local is_sp = minetest.is_singleplayer()
local enable_respawn = minetest.settings:get_bool("enable_bed_respawn")
if enable_respawn == nil then
enable_respawn = true
end
@ -13,13 +8,10 @@ end
-- Helper functions
local function get_look_yaw(pos)
local rotation = minetest.get_node(pos).param2
if rotation > 3 then
rotation = rotation % 4 -- Mask colorfacedir values
end
if rotation == 1 then
return pi / 2, rotation
elseif rotation == 3 then
@ -31,31 +23,22 @@ local function get_look_yaw(pos)
end
end
local function is_night_skip_enabled()
local enable_night_skip = minetest.settings:get_bool("enable_bed_night_skip")
if enable_night_skip == nil then
enable_night_skip = true
end
return enable_night_skip
end
local function check_in_beds(players)
local in_bed = beds.player
if not players then
players = minetest.get_connected_players()
end
for n, player in ipairs(players) do
local name = player:get_player_name()
if not in_bed[name] then
return false
end
@ -64,9 +47,7 @@ local function check_in_beds(players)
return #players > 0
end
local function lay_down(player, pos, bed_pos, state, skip)
local name = player:get_player_name()
local hud_flags = player:hud_get_flags()
@ -76,156 +57,67 @@ local function lay_down(player, pos, bed_pos, state, skip)
-- stand up
if state ~= nil and not state then
if not beds.player[name] then
return false -- player not in bed, do nothing
end
beds.bed_position[name] = nil
local p = beds.pos[name] or nil
beds.player[name] = nil
-- skip here to prevent sending player specific changes (used for leaving players)
if skip then
return
end
player:set_pos(beds.pos[name])
if p then
player:set_pos(p)
end
-- physics, eye_offset, etc
local physics_override = beds.player[name].physics_override
beds.player[name] = nil
if is_pova then
pova.del_override(name, "force")
pova.do_override(player)
else
player:set_physics_override({
speed = physics_override.speed,
jump = physics_override.jump,
gravity = physics_override.gravity
})
end
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
player:set_look_horizontal(math.random(1, 180) / 100)
if beds.is_50 then
player_api.player_attached[name] = false
player_api.set_animation(player, "stand" , 30)
else
default.player_attached[name] = false
default.player_set_animation(player, "stand" , 30)
end
player:set_physics_override(1, 1, 1)
hud_flags.wielditem = true
default.player_set_animation(player, "stand" , 30)
else -- lay down
-- Check if bed is occupied
for _, other_pos in pairs(beds.bed_position) do
if vector.distance(bed_pos, other_pos) < 0.1 then
minetest.chat_send_player(name, S("This bed is already occupied!"))
return false
end
end
if beds.is_54 then
-- Check if player is moving
if vector.length(player:get_velocity()) > 0.001 then
minetest.chat_send_player(name,
S("You have to stop moving before going to bed!"))
return false
end
end
-- Check if player is attached to an object
if player:get_attach() then
return false
end
if beds.player[name] then
-- player already in bed, do nothing
return false
end
-- lay down
else
beds.pos[name] = pos
beds.bed_position[name] = bed_pos
beds.player[name] = {physics_override = player:get_physics_override()}
beds.player[name] = 1
-- physics, eye_offset, etc
player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
local yaw, param2 = get_look_yaw(bed_pos)
player:set_look_horizontal(yaw)
local dir = minetest.facedir_to_dir(param2)
-- p.y is just above the nodebox height of the 'Simple Bed' (the highest bed),
-- to avoid sinking down through the bed.
local p = {
x = bed_pos.x + dir.x / 2,
y = bed_pos.y + 0.07,
z = bed_pos.z + dir.z / 2
}
if is_pova then
pova.add_override(name, "force", {speed = 0, jump = 0, gravity = 0})
pova.do_override(player)
else
player:set_physics_override({speed = 0, jump = 0, gravity = 0})
end
local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2}
player:set_physics_override(0, 0, 0)
player:set_pos(p)
if beds.is_50 then
player_api.player_attached[name] = true
player_api.set_animation(player, "lay" , 0)
else
default.player_attached[name] = true
default.player_set_animation(player, "lay" , 0)
end
hud_flags.wielditem = false
default.player_set_animation(player, "lay" , 0)
end
player:hud_set_flags(hud_flags)
end
local function get_player_in_bed_count()
local c = 0
for _, _ in pairs(beds.player) do
c = c + 1
end
return c
end
local function update_formspecs(finished)
local ges = #minetest.get_connected_players()
local form_n
local player_in_bed = get_player_in_bed_count()
local is_majority = (ges / 2) < player_in_bed
local form_n
local esc = minetest.formspec_escape
if finished then
form_n = beds.formspec .. "label[2.7,9;" .. esc(S("Good morning.")) .. "]"
form_n = beds.formspec .. "label[2.7,9; Good morning.]"
else
form_n = beds.formspec .. "label[2.2,9;" ..
esc(S("@1 of @2 players are in bed", player_in_bed, ges)) .. "]"
form_n = beds.formspec .. "label[2.2,9;" .. tostring(player_in_bed) ..
" of " .. tostring(ges) .. " players are in bed]"
if is_majority and is_night_skip_enabled() then
form_n = form_n .. "button_exit[2,6;4,0.75;force;" ..
esc(S("Force night skip")) .. "]"
form_n = form_n .. "button_exit[2,6;4,0.75;force;Force night skip]"
end
end
@ -234,46 +126,36 @@ local function update_formspecs(finished)
end
end
-- Public functions
function beds.kick_players()
for name, _ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
lay_down(player, nil, nil, false)
end
end
function beds.skip_night()
minetest.set_timeofday(0.23)
end
function beds.on_rightclick(pos, player)
local name = player:get_player_name()
local ppos = player:get_pos()
local tod = minetest.get_timeofday()
if tod > beds.day_interval.start and tod < beds.day_interval.finish then
if tod > 0.2 and tod < 0.805 then
if beds.player[name] then
lay_down(player, nil, nil, false)
end
minetest.chat_send_player(name, S("You can only sleep at night."))
minetest.chat_send_player(name, "You can only sleep at night.")
return
end
-- move to bed
if not beds.player[name] then
lay_down(player, ppos, pos)
beds.set_spawns() -- save respawn positions when entering bed
else
lay_down(player, nil, nil, false)
@ -285,13 +167,10 @@ function beds.on_rightclick(pos, player)
-- skip the night and let all players stand up
if check_in_beds() then
minetest.after(2, function()
if not is_sp then
update_formspecs(is_night_skip_enabled())
end
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
@ -300,67 +179,37 @@ function beds.on_rightclick(pos, player)
end
end
function beds.can_dig(bed_pos)
-- Check all players in bed which one is at the expected position
for _, player_bed_pos in pairs(beds.bed_position) do
if vector.equals(bed_pos, player_bed_pos) then
return false
end
end
return true
end
-- Callbacks
-- Only register respawn callback if respawn enabled
if enable_respawn then
-- set respawn flag to true by default
minetest.register_on_joinplayer(function(player)
if not player then return end
local name = player:get_player_name()
beds.respawn[name] = true
end)
-- respawn player at bed if enabled and valid position is found
minetest.register_on_respawnplayer(function(player)
if not player then return end
local name = player:get_player_name()
local pos = beds.spawn[name]
-- check if respawn flag is true (for mini-game support, can be set to false)
if pos and beds.respawn[name] then
if pos then
player:set_pos(pos)
return true
end
end)
end
minetest.register_on_leaveplayer(function(player)
if not player then return end
local name = player:get_player_name()
lay_down(player, nil, nil, false, true)
beds.player[name] = nil
if check_in_beds() then
minetest.after(2, function()
update_formspecs(is_night_skip_enabled())
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
@ -369,28 +218,7 @@ minetest.register_on_leaveplayer(function(player)
end
end)
minetest.register_on_dieplayer(function(player)
if not player then return end
local name = player:get_player_name()
local in_bed = beds.player
local pos = player:get_pos()
local yaw = get_look_yaw(pos)
if in_bed[name] then
lay_down(player, nil, pos, false)
player:set_look_horizontal(yaw)
player:set_pos(pos)
end
end)
local div = tonumber(minetest.settings:get("bed_sleep_divide")) or 2
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "beds_form" then
return
end
@ -406,11 +234,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
if fields.force then
-- check if enough players are sleeping to skip night (was half)
local is_majority = (
#minetest.get_connected_players() / div) < last_player_in_bed
local is_majority = (#minetest.get_connected_players() / 2) < last_player_in_bed
if is_majority and is_night_skip_enabled() then
update_formspecs(true)
beds.skip_night()

View File

@ -1,69 +1,19 @@
local is_50 = nil
local is_53 = minetest.has_feature("object_step_has_moveresult")
local is_54 = minetest.has_feature("direct_velocity_on_players")
beds = {}
beds.player = {}
beds.bed_position = {}
beds.pos = {}
beds.spawn = {}
-- Load support for MT game translation.
local S
if minetest.get_translator ~= nil then
S = minetest.get_translator("beds") -- 5.x translation function
is_50 = true
else
if minetest.get_modpath("intllib") then
dofile(minetest.get_modpath("intllib") .. "/init.lua")
if intllib.make_gettext_pair then
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
else
gettext = intllib.Getter() -- old text file method
end
S = gettext
else -- boilerplate function for 0.4
S = function(str, ...)
local args = {...}
return str:gsub("@%d+", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
end
beds = {
mod = "redo",
player = {},
bed_position = {},
pos = {},
spawn = {},
respawn = {},
get_translator = S,
formspec = "size[8,11;true]"
.. "no_prepend[]"
.. "bgcolor[#080808BB;true]"
.. "button_exit[2,10;4,0.75;leave;" .. minetest.formspec_escape(S("Leave Bed")) .. "]"
}
beds.is_50 = is_50
beds.is_53 = is_53
beds.is_54 = is_54
beds.day_interval = {
start = 0.2,
finish = 0.805,
}
beds.formspec = "size[8,11;true]" ..
"no_prepend[]" ..
"bgcolor[#080808BB;true]" ..
"button_exit[2,10;4,0.75;leave;Leave Bed]"
local modpath = minetest.get_modpath("beds")
-- check for minetest 5.x/0.4 compatibility
function beds.is_creative(name)
if is_53 then
return minetest.is_creative_enabled(name)
else
return creative.is_enabled_for(name) or minetest.settings:get_bool("creative_mode")
end
end
-- Load files
dofile(modpath .. "/functions.lua")
dofile(modpath .. "/api.lua")
dofile(modpath .. "/beds.lua")
dofile(modpath .. "/spawns.lua")
print("[MOD] Beds loaded")

View File

@ -59,7 +59,3 @@ rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/
WTFPL license applies to bed .obj files by jp from mesh beds mod:
https://forum.minetest.net/viewtopic.php?t=11817

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Schickes Bett
Simple Bed=Schlichtes Bett
This bed is already occupied!=Dieses Bett ist bereits belegt!
You have to stop moving before going to bed!=Sie müssen stehen bleiben, bevor Sie zu Bett gehen können!
Good morning.=Guten Morgen.
@1 of @2 players are in bed=@1 von @2 Spielern sind im Bett
Force night skip=Überspringen der Nacht erzwingen
You can only sleep at night.=Sie können nur nachts schlafen.
Leave Bed=Bett verlassen

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Cama de lujo
Simple Bed=Cama sencilla
This bed is already occupied!=Esta cama esta ocupada
You have to stop moving before going to bed!=Deja de moverte o no podras acostarte
Good morning.=Buenos días.
@1 of @2 players are in bed=@1 de @2 jugadores están durmiendo
Force night skip=Forzar hacer de dia
You can only sleep at night.=Sólo puedes dormir por la noche.
Leave Bed=Levantarse

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Lit chic
Simple Bed=Lit simple
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Bonjour.
@1 of @2 players are in bed=@1 joueur(s) sur @2 sont au lit
Force night skip=Forcer le passage de la nuit
You can only sleep at night.=Vous ne pouvez dormir que la nuit.
Leave Bed=Se lever du lit

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Ranjang Mewah
Simple Bed=Ranjang Sederhana
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Selamat pagi.
@1 of @2 players are in bed=@1 dari @2 pemain sedang tidur
Force night skip=Paksa lewati malam
You can only sleep at night.=Anda hanya dapat tidur pada waktu malam.
Leave Bed=Tinggalkan Ranjang

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Letto decorato
Simple Bed=Letto semplice
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=
@1 of @2 players are in bed=
Force night skip=
You can only sleep at night.=
Leave Bed=Alzati dal letto

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=lo selja'i ckana
Simple Bed=lo sampu ckana
This bed is already occupied!=.i lo ti ckana cu canlu
You have to stop moving before going to bed!=lo nu do cando cu sarcu lo nu do sipna
Good morning.=.i .uise'inai cerni
@1 of @2 players are in bed=.i @1 cmima be lu'i @2 le pilno cu vreta lo ckana
Force night skip=bapli le nu co'u nicte
You can only sleep at night.=.i steci le ka nicte kei fa le ka do kakne le ka sipna ca pa ckaji be ce'u
Leave Bed=cliva lo ckana

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Katil Beragam
Simple Bed=Katil Biasa
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Selamat pagi.
@1 of @2 players are in bed=@1 daripada @2 pemain sedang tidur
Force night skip=Paksa langkau malam
You can only sleep at night.=Anda hanya boleh tidur pada waktu malam.
Leave Bed=Bangun

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Cama Bonita
Simple Bed=Cama Simples
This bed is already occupied!=Esta cama já está ocupada!
You have to stop moving before going to bed!=Você precisa parar de se mover antes de ir para cama!
Good morning.=Bom dia.
@1 of @2 players are in bed=@1 de @2 jogadores estão na cama
Force night skip=Forçar o amanhecer
You can only sleep at night.=Você só pode dormir à noite
Leave Bed=Sair da Cama

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Детализированная Кровать
Simple Bed=Обычная Кровать
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Доброе утро.
@1 of @2 players are in bed=@1 из @2 игроков в кровати
Force night skip=Пропустить ночь
You can only sleep at night.=Вы можете спать только ночью.
Leave Bed=Встать с кровати

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Fin säng
Simple Bed=Enkel Säng
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.= God morgon.
@1 of @2 players are in bed=@1 av @2 spelar försöker sover.
Force night skip=Tvinga över natten
You can only sleep at night.=Du kan bara sova på natten.
Leave Bed=Lämna Säng

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=Pekná posteľ
Simple Bed=Jednoduchá posteľ
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=Dobré ráno.
@1 of @2 players are in bed=@1 z @2 hráčov sú v posteli
Force night skip=Nútene preskočiť noc
You can only sleep at night.=Môžeš spať len v noci.
Leave Bed=Opusti posteľ

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=花式床
Simple Bed=简易床
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=早安!
@1 of @2 players are in bed=@2位玩家中的@1位在床上
Force night skip=强制跳过夜晚
You can only sleep at night.=你只能在晚上睡觉。
Leave Bed=离开床

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=花式床
Simple Bed=簡易床
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=早安!
@1 of @2 players are in bed=@2位玩家中的@1位在床上
Force night skip=強制跳過夜晚
You can only sleep at night.=你只能在晚上睡覺。
Leave Bed=離開床

View File

@ -1,10 +0,0 @@
# textdomain: beds
Fancy Bed=
Simple Bed=
This bed is already occupied!=
You have to stop moving before going to bed!=
Good morning.=
@1 of @2 players are in bed=
Force night skip=
You can only sleep at night.=
Leave Bed=

View File

@ -1,4 +0,0 @@
name = beds
description = beds which allows sleep, featured to (auto) skip the night.
depends = default, wool
optional_depends = player_api, pova, intllib

View File

@ -1,160 +0,0 @@
# Blender v2.69 (sub 0) OBJ File: ''
# www.blender.org
mtllib fancy_bed.mtl
o mattress_Mattress_nodebox-6_none.001_fancy_bed.png.001
v 0.437500 -0.312500 -0.437501
v 0.437500 -0.062500 -0.437501
v 0.437500 -0.062500 1.437499
v 0.437500 -0.312500 1.437499
v -0.437500 -0.312500 -0.437501
v -0.437500 -0.312500 1.437499
v -0.437500 -0.062500 1.437499
v -0.437500 -0.062500 -0.437501
v 0.437500 -0.176793 -0.437501
v -0.437500 -0.176793 -0.437501
vt 0.000171 0.499972
vt 0.000161 0.000182
vt 0.999791 0.000253
vt 0.999873 0.500022
vt 0.749576 0.000208
vt 0.749876 0.499854
vt 0.999848 0.999750
vt 0.000152 0.999750
vt 0.749276 0.130648
vt 0.000112 0.130648
g mattress_Mattress_nodebox-6_none.001_fancy_bed.png.001_none.001_fancy_bed.png.001
usemtl none.001_fancy_bed.png.001
s off
f 1/1 2/2 3/3 4/4
f 5/2 6/3 7/4 8/1
f 4/5 3/2 7/1 6/6
f 1/1 4/4 6/7 5/8
f 2/1 8/2 7/3 3/4
f 8/2 2/5 9/9 10/10
o wood_structure_Wood_structure_nodebox-4.001_none.002
v 0.374999 -0.375000 1.437499
v 0.374999 -0.125000 1.437499
v 0.374999 -0.125000 1.499999
v 0.374999 -0.375000 1.499999
v -0.374999 -0.375000 1.437499
v -0.374999 -0.375000 1.499999
v -0.374999 -0.125000 1.499999
v -0.374999 -0.125000 1.437499
v -0.375000 -0.500000 1.437499
v -0.375000 0.187500 1.437499
v -0.375000 0.187500 1.499999
v -0.375000 -0.500000 1.499999
v -0.500000 -0.500000 1.437499
v -0.500000 -0.500000 1.499999
v -0.500000 0.187500 1.499999
v -0.500000 0.187500 1.437499
v -0.437500 -0.375000 -0.437501
v -0.437500 -0.125000 -0.437501
v -0.437500 -0.125000 1.437498
v -0.437500 -0.375000 1.437498
v -0.500000 -0.375000 -0.437501
v -0.500000 -0.375000 1.437498
v -0.500000 -0.125000 1.437498
v -0.500000 -0.125000 -0.437501
v 0.375001 -0.000000 1.437499
v 0.375001 0.125000 1.437499
v 0.375001 0.125000 1.499999
v 0.375001 -0.000000 1.499999
v -0.375001 -0.000000 1.437499
v -0.375001 -0.000000 1.499999
v -0.375001 0.125000 1.499999
v -0.375001 0.125000 1.437499
v 0.500000 -0.500000 1.437499
v 0.500000 0.187500 1.437499
v 0.500000 0.187500 1.499999
v 0.500000 -0.500000 1.499999
v 0.375000 -0.500000 1.437499
v 0.375000 -0.500000 1.499999
v 0.375000 0.187500 1.499999
v 0.375000 0.187500 1.437499
v 0.500000 -0.375000 -0.437501
v 0.500000 -0.125000 -0.437501
v 0.500000 -0.125000 1.437499
v 0.500000 -0.375000 1.437499
v 0.437500 -0.375000 -0.437501
v 0.437500 -0.375000 1.437499
v 0.437500 -0.125000 1.437499
v 0.437500 -0.125000 -0.437501
v -0.375000 -0.500000 -0.500000
v -0.375000 -0.065000 -0.500000
v -0.375000 -0.065000 -0.437500
v -0.375000 -0.500000 -0.437500
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 -0.437500
v -0.500000 -0.065000 -0.437500
v -0.500000 -0.065000 -0.500000
v 0.375006 -0.375000 -0.500000
v 0.375006 -0.125000 -0.500000
v 0.375006 -0.125000 -0.437500
v 0.375006 -0.375000 -0.437500
v -0.375006 -0.375000 -0.500000
v -0.375006 -0.375000 -0.437500
v -0.375006 -0.125000 -0.437500
v -0.375006 -0.125000 -0.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.065000 -0.500000
v 0.500000 -0.065000 -0.437500
v 0.500000 -0.500000 -0.437500
v 0.375000 -0.500000 -0.500000
v 0.375000 -0.500000 -0.437500
v 0.375000 -0.065000 -0.437500
v 0.375000 -0.065000 -0.500000
vt 0.377610 0.378205
vt 0.622484 0.378175
vt 0.622515 0.623120
vt 0.377671 0.623151
g wood_structure_Wood_structure_nodebox-4.001_none.002_none.002
usemtl none.002
s off
f 59/11 60/12 61/13 62/14
f 63/14 64/11 65/12 66/13
f 59/11 63/14 66/13 60/12
f 62/14 61/13 65/12 64/11
f 59/11 62/14 64/13 63/12
f 60/12 66/11 65/14 61/13
f 67/11 71/12 74/13 68/14
f 70/14 69/11 73/12 72/13
f 67/11 70/12 72/13 71/14
f 68/11 74/12 73/13 69/14
f 75/11 76/12 77/13 78/14
f 79/14 80/11 81/12 82/13
f 75/14 79/11 82/12 76/13
f 78/11 77/12 81/13 80/14
f 75/11 78/12 80/13 79/14
f 76/11 82/12 81/13 77/14
g wood_structure_Wood_structure_nodebox-4.001_none.002_none.003
usemtl none.003
f 15/11 16/12 17/13 18/14
f 11/13 15/14 18/11 12/12
f 14/14 13/11 17/12 16/13
f 11/14 14/11 16/12 15/13
f 12/11 18/12 17/13 13/14
f 19/11 20/12 21/13 22/14
f 23/14 24/11 25/12 26/13
f 19/14 23/11 26/12 20/13
f 22/11 21/12 25/13 24/14
f 19/11 22/12 24/13 23/14
f 20/11 26/12 25/13 21/14
f 27/14 28/11 29/12 30/13
f 31/11 32/12 33/13 34/14
f 27/11 30/12 32/13 31/14
f 28/14 34/11 33/12 29/13
f 35/11 39/12 42/13 36/14
f 38/14 37/11 41/12 40/13
f 35/14 38/11 40/12 39/13
f 36/11 42/12 41/13 37/14
f 43/11 44/12 45/13 46/14
f 47/14 48/11 49/12 50/13
f 43/14 47/11 50/12 44/13
f 46/11 45/12 49/13 48/14
f 43/11 46/12 48/13 47/14
f 44/11 50/12 49/13 45/14
f 51/14 52/11 53/12 54/13
f 55/13 56/14 57/11 58/12
f 51/11 54/12 56/13 55/14
f 52/14 58/11 57/12 53/13

View File

@ -1,32 +0,0 @@
# Blender v2.69 (sub 0) OBJ File: ''
# www.blender.org
mtllib simple_bed.mtl
o Simple_Bed
v 0.500000 -0.500000 -0.500000
v 0.500000 0.060000 -0.500000
v 0.500000 0.060000 1.500000
v 0.500000 -0.500000 1.500000
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 1.500000
v -0.500000 0.060000 1.500000
v -0.500000 0.060000 -0.500000
vt 0.000112 0.780442
vt 0.000110 0.999969
vt 0.780324 0.999889
vt 0.780377 0.780471
vt 0.780636 0.390284
vt 0.999906 0.780382
vt 0.999906 0.390284
vt 0.780636 0.000047
vt 0.999906 0.000094
vt 0.390235 0.780320
vt 0.390235 0.000071
vt 0.000142 0.000142
usemtl none.002
s off
f 1/1 2/2 3/3 4/4
f 5/1 6/4 7/3 8/2
f 1/5 5/4 8/6 2/7
f 4/8 3/9 7/7 6/5
f 1/8 4/4 6/10 5/11
f 2/11 8/12 7/1 3/10

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

View File

@ -1,5 +0,0 @@
enable_bed_respawn (Enable bed respawn) bool true
enable_bed_night_skip (Enable night skip) bool true
bed_sleep_divide (Division of players needed to skip night) float 2

View File

@ -3,44 +3,30 @@ local org_file = world_path .. "/beds_spawns"
local file = world_path .. "/beds_spawns"
local bkwd = false
-- check for PA's beds mod spawns
local cf = io.open(world_path .. "/beds_player_spawns", "r")
if cf ~= nil then
io.close(cf)
file = world_path .. "/beds_player_spawns"
bkwd = true
end
function beds.read_spawns()
local spawns = beds.spawn
local input = io.open(file, "r")
if input and not bkwd then
repeat
local x = input:read("*n")
if x == nil then
break
end
local y = input:read("*n")
local z = input:read("*n")
local name = input:read("*l")
spawns[name:sub(2)] = {x = x, y = y, z = z}
until input:read(0) == nil
io.close(input)
elseif input and bkwd then
beds.spawn = minetest.deserialize(input:read("*all"))
input:close()
beds.save_spawns()
@ -49,54 +35,29 @@ function beds.read_spawns()
end
end
-- load player spawn positions
beds.read_spawns()
function beds.save_spawns()
if not beds.spawn then
return
end
local data = {}
local output = io.open(org_file, "w")
for k, v in pairs(beds.spawn) do
table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, k))
end
output:write(table.concat(data))
io.close(output)
end
function beds.set_spawns()
for name,_ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
local p = player:get_pos()
-- but don't change spawn location if borrowing a bed
if not minetest.is_protected(p, name) then
beds.spawn[name] = p
end
end
beds.save_spawns()
end
function beds.remove_spawns_at(pos)
for name, p in pairs(beds.spawn) do
if vector.equals(vector.round(p), pos) then
beds.spawn[name] = nil
end
end
beds.save_spawns()
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

View File

@ -1,37 +0,0 @@
Minetest Game mod: binoculars
=============================
See license.txt for license information.
Authors of source code
----------------------
paramat (MIT)
Authors of media (textures)
---------------------------
paramat (CC BY-SA 3.0):
binoculars_binoculars.png
Crafting
--------
binoculars:binoculars
default:obsidian_glass O
default:bronze_ingot B
O_O
BBB
O_O
Usage
-----
In survival mode, use of zoom requires the binoculars item in your inventory,
they will allow a 10 degree field of view.
It can take up to 5 seconds for adding to or removal from inventory to have an
effect, however to instantly allow the use of this zoom 'use' (leftclick) the
item.
Zoom with a field of view of 15 degrees is automatically allowed in creative
mode and for any player with the 'creative' privilege.
The 'binoculars.update_player_property()' function is global so can be
redefined by a mod for alternative behaviour.

View File

@ -1,81 +0,0 @@
-- binoculars/init.lua
-- Mod global namespace
binoculars = {}
-- Load support for MT game translation.
local S = minetest.get_translator("binoculars")
-- Detect creative mod
local creative_mod = minetest.get_modpath("creative")
-- Cache creative mode setting as fallback if creative mod not present
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
-- Update player property
-- Global to allow overriding
function binoculars.update_player_property(player)
local creative_enabled =
(creative_mod and creative.is_enabled_for(player:get_player_name())) or
creative_mode_cache
local new_zoom_fov = 0
if player:get_inventory():contains_item(
"main", "binoculars:binoculars") then
new_zoom_fov = 10
elseif creative_enabled then
new_zoom_fov = 15
end
-- Only set property if necessary to avoid player mesh reload
if player:get_properties().zoom_fov ~= new_zoom_fov then
player:set_properties({zoom_fov = new_zoom_fov})
end
end
-- Set player property 'on joinplayer'
minetest.register_on_joinplayer(function(player)
binoculars.update_player_property(player)
end)
-- Cyclic update of player property
local function cyclic_update()
for _, player in ipairs(minetest.get_connected_players()) do
binoculars.update_player_property(player)
end
minetest.after(4.7, cyclic_update)
end
minetest.after(4.7, cyclic_update)
-- Binoculars item
minetest.register_craftitem("binoculars:binoculars", {
description = S("Binoculars") .. "\n" .. S("Use with 'Zoom' key"),
inventory_image = "binoculars_binoculars.png",
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
binoculars.update_player_property(user)
end,
})
-- Crafting
minetest.register_craft({
output = "binoculars:binoculars",
recipe = {
{"default:obsidian_glass", "", "default:obsidian_glass"},
{"default:bronze_ingot", "default:bronze_ingot", "default:bronze_ingot"},
{"default:obsidian_glass", "", "default:obsidian_glass"},
}
})

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=Fernglas
Use with 'Zoom' key=Mit „Zoom“-Taste benutzen

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=Prismáticos
Use with 'Zoom' key=Usar con la tecla 'Zoom'

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=Jumelles
Use with 'Zoom' key=Utiliser avec le bouton « Zoom »

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=Binocolo
Use with 'Zoom' key=Usalo col tasto 'Ingrandimento'

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=Binokular
Use with 'Zoom' key=Guna dengan kekunci 'Zum'

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=Бинокль
Use with 'Zoom' key=Используется с привилегией 'Zoom'

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=Kikare
Use with 'Zoom' key=Används med 'Zoom' knappen

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=望远镜
Use with 'Zoom' key=与“缩放”键一起使用

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=望遠鏡
Use with 'Zoom' key=與“縮放”鍵一起使用

View File

@ -1,3 +0,0 @@
# textdomain: binoculars
Binoculars=
Use with 'Zoom' key=

View File

@ -1,4 +0,0 @@
name = binoculars
description = Minetest Game mod: binoculars
depends = default
optional_depends = creative

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

View File

@ -1,77 +0,0 @@
minetest mod boats
==========================
Boats improved for better performance and more realistic..
Information
-----------
This mod is named `boats`, it features work from original mod,
code changed to make it turn **quicker, better performance agains lag**,
and if you hit the shore too hard the boat is destroyed and drops 3 wood
![screenshot.png](screenshot.png)
#### Additions by TenPlus1
changed by TenPlus1 to add some new features
- boat is destroyed when crashing at speed (drops 3 wood)
- boats drop after 10 seconds if no driver
- boats can be damaged by mobs attacking player
- Improve physics of boat by implementing drag force (thanks gnag65)
- nil player check functions by misterskullz
Technical informaton
--------------------
When crafted you can use by putting and right click on,
then control with your directional keys:
#### Dependencies
* default
* mesecons (optional)
#### Crafting
W = any thing from wood group
```
W W
WWW
```
#### nodes
| Name | node | notes |
| ------------ | --------------- | ----- |
| Boat | boats:boat | it destroyed when crash at speed |
#### Controls (by default if not changed)
| Default key assigned | Action |
| -------------------- | -------------------------------------- |
| Right mouse button | Enter or exit boat when pointing at boat. |
| Forward | Speed up. Slow down when moving backwards. |
| Forward + backward | Enable cruise mode: accelerate to maximum speed without needing to hold. |
| Backward | Slow down. Speed up when moving backwards. Disable cruise mode. |
| Left | Turn to the left. Turn to the right when moving backwards. |
| Right | Turn to the right. Turn to the left when moving backwards. |
Licence
------
**Source code**
Modifications by TenPlus1
Originally by PilzAdam (MIT)
Various Minetest developers and contributors (MIT)
**Media (textures and model)**
Textures: Zeg9 (CC BY-SA 3.0)
original Model thetoon and Zeg9 (CC BY-SA 3.0),
modified by PavelS(SokolovPavel) (CC BY-SA 3.0),
modified by sofar (CC BY-SA 3.0)
Check [lisence.txt](lisence.txt)

31
mods/boats/README.txt Normal file
View File

@ -0,0 +1,31 @@
Minetest Game mod: boats
========================
See license.txt for license information.
Authors of source code
----------------------
Originally by PilzAdam (MIT)
Various Minetest developers and contributors (MIT)
Authors of media (textures and model)
-------------------------------------
Textures: Zeg9 (CC BY-SA 3.0)
Model: thetoon and Zeg9 (CC BY-SA 3.0),
modified by PavelS(SokolovPavel) (CC BY-SA 3.0),
modified by sofar (CC BY-SA 3.0)
Controls
--------
Right mouse button = Enter or exit boat when pointing at boat.
Forward = Speed up.
Slow down when moving backwards.
Forward + backward = Enable cruise mode: Boat will accelerate to maximum forward
speed and remain at that speed without needing to hold the
forward key.
Backward = Slow down.
Speed up when moving backwards.
Disable cruise mode.
Left = Turn to the left.
Turn to the right when moving backwards.
Right = Turn to the right.
Turn to the left when moving backwards.

View File

@ -1,3 +1,2 @@
default
player_api?
creative?
player_api

View File

@ -1,33 +1,3 @@
-- boats/init.lua
local is_pa = minetest.get_modpath("player_api")
-- translation support and 5.x version check
local S, is_50, is_53
if minetest.get_translator ~= nil then
S = minetest.get_translator("boats") -- 5.x translation function
else
if minetest.get_modpath("intllib") then
dofile(minetest.get_modpath("intllib") .. "/init.lua")
if intllib.make_gettext_pair then
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
else
gettext = intllib.Getter() -- old text file method
end
S = gettext
else -- boilerplate function
S = function(str, ...)
local args = {...}
return str:gsub("@%d+", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
end
-- check for minetest 5.x compatibility
is_50 = minetest.has_feature("httpfetch_binary_data")
is_53 = minetest.has_feature("direct_velocity_on_players") or minetest.has_feature("is_creative_enabled") or false
--
-- Helper functions
--
@ -38,6 +8,15 @@ local function is_water(pos)
end
local function get_sign(i)
if i == 0 then
return 0
else
return i / math.abs(i)
end
end
local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v
@ -49,21 +28,6 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2)
end
local creative = minetest.settings:get_bool("creative_mode")
function is_creative_enabled(name)
if creative or minetest.check_player_privs(name, {creative = true}) then
if is_53 then
return minetest.is_creative_enabled(name)
else
return true
end
end
return false
end
--
-- Boat entity
--
@ -76,7 +40,7 @@ local boat = {
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "boats_boat.obj",
textures = {"default_wood.png"}
textures = {"default_wood.png"},
},
driver = nil,
@ -93,35 +57,31 @@ function boat.on_rightclick(self, clicker)
end
local name = clicker:get_player_name()
if self.driver and name == self.driver then
-- Cleanup happens in boat.on_detach_child
self.driver = nil
self.auto = false
clicker:set_detach()
if is_pa then
player_api.player_attached[name] = false
player_api.set_animation(clicker, "stand" , 30)
else
default.player_set_animation(clicker, "stand", 30)
end
local pos = clicker:get_pos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
minetest.after(0.1, function()
clicker:set_pos(pos)
end)
elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach()
end
self.driver = name
clicker:set_attach(self.object, "",
{x = 0.5, y = 1, z = -3}, {x = 0, y = 0, z = 0})
self.driver = name
if is_pa then
player_api.player_attached[name] = true
else
default.player_attached[name] = true
end
minetest.after(0.2, function()
if is_pa then
player_api.set_animation(clicker, "sit" , 30)
else
default.player_set_animation(clicker, "sit", 30)
end
end)
clicker:set_look_horizontal(self.object:get_yaw())
end
@ -130,20 +90,13 @@ end
-- If driver leaves server while driving boat
function boat.on_detach_child(self, child)
if child and child:get_player_name() == self.driver then
if is_pa then
player_api.player_attached[child:get_player_name()] = false
else
default.player_attached[child:get_player_name()] = false
end
self.driver = nil
self.auto = false
end
end
function boat.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({fleshy = 100})
self.object:set_armor_groups({immortal = 1})
if staticdata then
self.v = tonumber(staticdata)
end
@ -165,16 +118,13 @@ function boat.on_punch(self, puncher)
if self.driver and name == self.driver then
self.driver = nil
puncher:set_detach()
if is_pa then
player_api.player_attached[name] = false
else
default.player_attached[name] = false
end
end
if not self.driver then
self.removed = true
local inv = puncher:get_inventory()
if not is_creative_enabled(name)
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(name))
or not inv:contains_item("main", "boats:boat") then
local leftover = inv:add_item("main", "boats:boat")
-- if no room in inventory add a replacement boat to the world
@ -191,35 +141,24 @@ end
function boat.on_step(self, dtime)
-- after 10 seconds remove boat and drop as item if not boarded
self.count = (self.count or 0) + dtime
if self.count > 10 then
minetest.add_item(self.object:get_pos(), "boats:boat")
self.object:remove()
return
end
self.v = get_v(self.object:get_velocity()) * math.sign(self.v)
self.v = get_v(self.object:get_velocity()) * get_sign(self.v)
if self.driver then
self.count = 0 -- reset 10 second drop counter
local driver_objref = minetest.get_player_by_name(self.driver)
if driver_objref then
local ctrl = driver_objref:get_player_control()
if ctrl.up and ctrl.down then
if not self.auto then
self.auto = true
minetest.chat_send_player(self.driver, S("Boat cruise mode on"))
minetest.chat_send_player(self.driver, "[boats] Cruise on")
end
elseif ctrl.down then
self.v = self.v - dtime * 2.0
self.v = self.v - dtime * 1.8
if self.auto then
self.auto = false
minetest.chat_send_player(self.driver, S("Boat cruise mode off"))
minetest.chat_send_player(self.driver, "[boats] Cruise off")
end
elseif ctrl.up or self.auto then
self.v = self.v + dtime * 2.0
self.v = self.v + dtime * 1.8
end
if ctrl.left then
if self.v < -0.001 then
@ -234,27 +173,22 @@ function boat.on_step(self, dtime)
self.object:set_yaw(self.object:get_yaw() - dtime * 0.9)
end
end
else
-- If driver leaves server while driving 'driver' is present
-- but driver objectref is nil. Reset boat properties.
self.driver = nil
self.auto = false
end
end
local velo = self.object:get_velocity()
if not self.driver and
self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:set_pos(self.object:get_pos())
return
end
-- We need to preserve velocity sign to properly apply drag force
-- while moving backward
local drag = dtime * math.sign(self.v) * (0.01 + 0.0796 * self.v * self.v)
-- If drag is larger than velocity, then stop horizontal movement
if math.abs(self.v) <= math.abs(drag) then
local s = get_sign(self.v)
self.v = self.v - dtime * 0.6 * s
if s ~= get_sign(self.v) then
self.object:set_velocity({x = 0, y = 0, z = 0})
self.v = 0
else
self.v = self.v - drag
return
end
if math.abs(self.v) > 5 then
self.v = 5 * get_sign(self.v)
end
local p = self.object:get_pos()
@ -301,30 +235,6 @@ function boat.on_step(self, dtime)
end
self.object:set_velocity(new_velo)
self.object:set_acceleration(new_acce)
-- if boat comes to sudden stop then destroy boat and drop 3x wood
if (self.v2 or 0) - self.v >= 3 then
if self.driver then
--print ("Crash! with driver", self.v2 - self.v)
local driver_objref = minetest.get_player_by_name(self.driver)
default.player_attached[self.driver] = false
driver_objref:set_detach()
if is_pa then
player_api.set_animation(driver_objref, "stand" , 30)
else
default.player_set_animation(driver_objref, "stand" , 30)
end
else
--print ("Crash! no driver")
end
minetest.add_item(self.object:get_pos(), "default:wood 3")
self.object:remove()
return
end
self.v2 = self.v
end
@ -332,7 +242,7 @@ minetest.register_entity("boats:boat", boat)
minetest.register_craftitem("boats:boat", {
description = S("Boat"),
description = "Boat",
inventory_image = "boats_inventory.png",
wield_image = "boats_wield.png",
wield_scale = {x = 2, y = 2, z = 1},
@ -363,7 +273,8 @@ minetest.register_craftitem("boats:boat", {
boat:set_yaw(placer:get_look_horizontal())
end
local player_name = placer and placer:get_player_name() or ""
if not is_creative_enabled(player_name) then
if not (creative and creative.is_enabled_for and
creative.is_enabled_for(player_name)) then
itemstack:take_item()
end
end
@ -386,6 +297,3 @@ minetest.register_craft({
recipe = "boats:boat",
burntime = 20,
})
print ("[MOD] Boats loaded")

View File

@ -33,7 +33,6 @@ Copyright (C) 2012-2016 Zeg9
Copyright (C) 2012-2016 thetoon
Copyright (C) 2012-2016 PavelS(SokolovPavel)
Copyright (C) 2016 sofar (sofar@foo-projects.org)
Copyright (C) 2019 Bartosz (gang65@poczta.onet.pl)
You are free to:
Share — copy and redistribute the material in any medium or format.

View File

@ -1,2 +0,0 @@
name = boats
depends = default, player_api, creative

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

1
mods/bones/depends.txt Normal file
View File

@ -0,0 +1 @@
default

View File

@ -1,11 +1,6 @@
-- bones/init.lua
-- Minetest 0.4 mod: bones
-- See README.txt for licensing and other information.
-- Load support for MT game translation.
local S = minetest.get_translator("bones")
bones = {}
local function is_owner(pos, name)
@ -29,7 +24,7 @@ local share_bones_time = tonumber(minetest.settings:get("share_bones_time")) or
local share_bones_time_early = tonumber(minetest.settings:get("share_bones_time_early")) or share_bones_time / 4
minetest.register_node("bones:bones", {
description = S("Bones"),
description = "Bones",
tiles = {
"bones_top.png^[transform2",
"bones_bottom.png",
@ -121,7 +116,7 @@ minetest.register_node("bones:bones", {
local meta = minetest.get_meta(pos)
local time = meta:get_int("time") + elapsed
if time >= share_bones_time then
meta:set_string("infotext", S("@1's old bones", meta:get_string("owner")))
meta:set_string("infotext", meta:get_string("owner") .. "'s old bones")
meta:set_string("owner", "")
else
meta:set_int("time", time)
@ -199,7 +194,7 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", player_name .. " dies at " .. pos_string ..
". No bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, S("@1 died at @2.", player_name, pos_string))
minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string .. ".")
end
return
end
@ -209,7 +204,7 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", player_name .. " dies at " .. pos_string ..
". No bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, S("@1 died at @2.", player_name, pos_string))
minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string .. ".")
end
return
end
@ -235,7 +230,8 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", player_name .. " dies at " .. pos_string ..
". Inventory dropped")
if bones_position_message then
minetest.chat_send_player(player_name, S("@1 died at @2, and dropped their inventory.", player_name, pos_string))
minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string ..
", and dropped their inventory.")
end
return
end
@ -246,7 +242,8 @@ minetest.register_on_dieplayer(function(player)
minetest.log("action", player_name .. " dies at " .. pos_string ..
". Bones placed")
if bones_position_message then
minetest.chat_send_player(player_name, S("@1 died at @2, and bones were placed.", player_name, pos_string))
minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string ..
", and bones were placed.")
end
local meta = minetest.get_meta(pos)
@ -269,7 +266,7 @@ minetest.register_on_dieplayer(function(player)
meta:set_string("owner", player_name)
if share_bones_time ~= 0 then
meta:set_string("infotext", S("@1's fresh bones", player_name))
meta:set_string("infotext", player_name .. "'s fresh bones")
if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then
meta:set_int("time", 0)
@ -279,6 +276,6 @@ minetest.register_on_dieplayer(function(player)
minetest.get_node_timer(pos):start(10)
else
meta:set_string("infotext", S("@1's bones", player_name))
meta:set_string("infotext", player_name.."'s bones")
end
end)

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=Knochen
@1's old bones=Alte Knochen von @1
@1 died at @2.=@1 starb bei @2.
@1 died at @2, and dropped their inventory.=@1 starb bei @2 und ließ das Inventar fallen.
@1 died at @2, and bones were placed.=@1 starb bei @2 und Knochen wurden platziert.
@1's fresh bones=Frische Knochen von @1
@1's bones=Knochen von @1

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=Huesos
@1's old bones=Huesos antiguos de @1
@1 died at @2.=@1 murió en @2.
@1 died at @2, and dropped their inventory.=@1 murió en @2, y su inventario se desprendió.
@1 died at @2, and bones were placed.=@1 murió en @2, y sus huesos fueron depositados.
@1's fresh bones=Huesos recientes de @1
@1's bones=Huesos de @1

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=Os
@1's old bones=Vieux os de @1
@1 died at @2.=@1 est mort à @2.
@1 died at @2, and dropped their inventory.=@1 est mort à @2 et a laissé tomber son inventaire.
@1 died at @2, and bones were placed.=@1 est mort à @2 et ses os ont été placés.
@1's fresh bones=Os frais de @1
@1's bones=Os de @1

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=Ossa
@1's old bones=Ossa vecchie di @1
@1 died at @2.=@1 è morto alla posizione @2.
@1 died at @2, and dropped their inventory.=@1 è morto alla posizione @2, e ha lasciato a terra il contenuto del suo inventario.
@1 died at @2, and bones were placed.=@1 è morto alla posizione @2, e vi sono state posizionate delle ossa.
@1's fresh bones=Ossa fresche di @1
@1's bones=Ossa di @1

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=Tulang
@1's old bones=Tulang lama @1
@1 died at @2.=@1 mati di @2.
@1 died at @2, and dropped their inventory.=@1 mati di @2, dan menjatuhkan inventorinya.
@1 died at @2, and bones were placed.=@1 mati di @2, dan tulang diletakkan.
@1's fresh bones=Tulang segar @1
@1's bones=Tulang @1

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=Кости
@1's old bones=Старые кости @1
@1 died at @2.=@1 умер в @2.
@1 died at @2, and dropped their inventory.=@1 умер в @2 и потерял содержимое своего инвентаря.
@1 died at @2, and bones were placed.=@1 умер в @2, помещены кости.
@1's fresh bones=новые кости @1
@1's bones=кости @1

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=Ben
@1's old bones=@1s Gamla ben
@1 died at @2.=@1 dog på @a.
@1 died at @2, and dropped their inventory.=@1 dog på @a, och tappade deras saker.
@1 died at @2, and bones were placed.=@1 dog på @2, och deras ben var placerade.
@1's fresh bones=@1s färska ben
@1's bones=@1s ben

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=骨骸
@1's old bones=@1的旧骨骸
@1 died at @2.=@1在@2死亡。
@1 died at @2, and dropped their inventory.=@1在@2死亡丢掉了物品栏。
@1 died at @2, and bones were placed.=@1在@2死亡骨骸被放置。
@1's fresh bones=@1的新鲜骨骸
@1's bones=@1的骨骸

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=骨骸
@1's old bones=@1的舊骨骸
@1 died at @2.=@1在@2死亡。
@1 died at @2, and dropped their inventory.=@1在@2死亡丟掉了物品欄。
@1 died at @2, and bones were placed.=@1在@2死亡骨骸被放置。
@1's fresh bones=@1的新鮮骨骸
@1's bones=@1的骨骸

View File

@ -1,8 +0,0 @@
# textdomain: bones
Bones=
@1's old bones=
@1 died at @2.=
@1 died at @2, and dropped their inventory.=
@1 died at @2, and bones were placed.=
@1's fresh bones=
@1's bones=

View File

@ -1,3 +0,0 @@
name = bones
description = Minetest Game mod: bones
depends = default

View File

@ -1,56 +0,0 @@
minetest mod Bucket
=========================
This mod is just bucket, but compatible with any engine
Information
-----------
This mod must be named `bucket` it permits to handle liquids
in a tool named bucket.
![screenshot.png](screenshot.png)
Tech information
----------------
This mod sustitute default one, you must disable the default of minetest
game if present or override it.
#### Dependencies
* default
Optional dependences:
* intllib
* dungeon_loot
#### Nodes
It does not provide any new node.
#### Items tools
| Node name | Description name |
| ----------------------- | --------------------- |
| bucket:bucket_empty | Empty Bucket |
| bucket:bucket_water | Water Bucket |
| bucket:bucket_river_water | River Water Bucket |
| bucket:bucket_lava | Lava Bucket |
License
-------
#### Authors of source code
Kahrl <kahrl@gmx.net> (LGPLv2.1+)
celeron55, Perttu Ahola <celeron55@gmail.com> (LGPLv2.1+)
Various Minetest developers and contributors (LGPLv2.1+)
#### Authors of media (textures)
ElementW (CC BY-SA 3.0)
Check [license.txt](license.txt)

View File

@ -1,56 +1,13 @@
minetest mod Bucket
Minetest Game mod: bucket
=========================
See license.txt for license information.
This mod is just bucket, but compatible with any engine
Information
-----------
This mod must be named `bucket` it permits to handle liquids
in a tool named bucket.
![screenshot.png](screenshot.png)
Tech information
----------------
This mod sustitute default one, you must disable the default of minetest
game if present or override it.
#### Dependencies
* default
Optional dependences:
* intllib
* dungeon_loot
#### Nodes
It does not provide any new node.
#### Items tools
| Node name | Description name |
| ----------------------- | --------------------- |
| bucket:bucket_empty | Empty Bucket |
| bucket:bucket_water | Water Bucket |
| bucket:bucket_river_water | River Water Bucket |
| bucket:bucket_lava | Lava Bucket |
License
-------
#### Authors of source code
Authors of source code
----------------------
Kahrl <kahrl@gmx.net> (LGPLv2.1+)
celeron55, Perttu Ahola <celeron55@gmail.com> (LGPLv2.1+)
Various Minetest developers and contributors (LGPLv2.1+)
#### Authors of media (textures)
Authors of media (textures)
---------------------------
ElementW (CC BY-SA 3.0)
Check [license.txt](license.txt)

Some files were not shown because too many files have changed in this diff Show More