Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
d291b1b
Add some more `@nodiscard`
AFCMS Oct 1, 2022
690cd9a
Make `HTTPRequest` et `HTTPRequestResult` use the right class syntax
AFCMS Oct 1, 2022
80acd43
Some more `@nodiscard`
AFCMS Oct 1, 2022
dd0124f
`minetest.spawn_tree`
AFCMS Oct 1, 2022
3d4d06d
`minetest.clear_craft`
AFCMS Oct 1, 2022
6c6eb47
chat commands
AFCMS Oct 1, 2022
a76e9c5
Better node
AFCMS Oct 1, 2022
b4bc3ef
`@nodiscard` for auth functions
AFCMS Oct 1, 2022
16d8a7c
Fix deprecated `@vararg` in `minetest.debug`
AFCMS Oct 1, 2022
a4247d0
Fix missing `-`
AFCMS Oct 1, 2022
8ef0b89
`@nodiscard`some environment functions
AFCMS Oct 1, 2022
e75e4d4
`minetest.get_inventory` + detached inventories
AFCMS Oct 1, 2022
51815f6
Add temporary registered_[nodes,items,tools,craftitems] tables
AFCMS Oct 1, 2022
64aea48
Add VSCode settings
AFCMS Oct 2, 2022
8faf8a1
Document paramtype and paramtype2
AFCMS Oct 2, 2022
28d1f84
Privilege definition use right `@class` syntax
AFCMS Oct 2, 2022
c80f68f
player_informations use right `@class` syntax
AFCMS Oct 2, 2022
b59b6fb
engine_version use right `@class`syntax
AFCMS Oct 2, 2022
caa9de2
dynamic_add_media_options use right `@class`syntax
AFCMS Oct 2, 2022
baecdbb
Object Properties Documentation
AFCMS Oct 2, 2022
2a67abd
Remove invalid comment
AFCMS Oct 2, 2022
0cecf56
Fixes
AFCMS Oct 8, 2022
6c98e9a
Make HUD definition use the right class syntax
AFCMS Oct 10, 2022
d005ff9
Make tool capabilities use the right class definition
AFCMS Oct 10, 2022
27bca74
Make job use the right class syntax
AFCMS Oct 10, 2022
9bba344
Use the right class syntax for some ObjectRef param tables
AFCMS Oct 10, 2022
b1e4a28
Make pointed_thing use the right class syntax
AFCMS Oct 10, 2022
6d76b07
Fix `minetest.clear_objects` optional param
AFCMS Oct 10, 2022
d3e064f
Some helper functions
AFCMS Oct 10, 2022
655f6d3
Add `@nodiscard` to color utils
AFCMS Oct 10, 2022
6f55caa
Add `@nodiscard` to some ban functions
AFCMS Oct 10, 2022
7568ce5
Add some `@nodiscard` to `AreaStore`
AFCMS Oct 10, 2022
b063cfa
Add some `@nodiscard` to `ItemStack`
AFCMS Oct 10, 2022
1a040b3
Add some `@nodiscard` to `Vector`
AFCMS Oct 10, 2022
5e2d73a
Add some `@nodiscard` to `InvRef`
AFCMS Oct 10, 2022
a401558
Make inventory location use right class syntax
AFCMS Oct 10, 2022
fc1421f
Add some `@nodiscard` to metadata
AFCMS Oct 10, 2022
cc4af6d
Add some `@nodiscard` to `Settings`
AFCMS Oct 10, 2022
c7b3ba9
Add `@nodiscard` to `ModChannel`
AFCMS Oct 10, 2022
2ebe9cf
Add some `@nodiscard` to `NodeTimerRef`
AFCMS Oct 10, 2022
b3232b7
Add some `@nodiscard` to `ObjectRef`
AFCMS Oct 10, 2022
3dec3cb
Add some `@nodiscard` to `PcgRandom`
AFCMS Oct 10, 2022
8013b1a
Add some `@nodiscard` to `PseudoRandom`
AFCMS Oct 10, 2022
71ea662
Add some `@nodiscard` to `Raycast`
AFCMS Oct 10, 2022
9b4a8d0
Add some `@nodiscard` to `SecureRandom`
AFCMS Oct 10, 2022
f08d8d4
Add some `@nodiscard` to `VoxelArea`
AFCMS Oct 10, 2022
78a8a6f
Add some `@nodiscard` to `VoxelManip`
AFCMS Oct 10, 2022
3292871
State documentation is official for the minetest namespace
AFCMS Oct 11, 2022
70d13f2
Make noise_params use the right class syntax
AFCMS Oct 12, 2022
302243a
Make PlayerHPChangeReason use right class syntax
AFCMS Oct 12, 2022
a25e703
Fix typo
AFCMS Oct 12, 2022
e41f543
Make SimpleSoundSpecTable use the right class syntax
AFCMS Oct 12, 2022
d962dbe
Make sound parameter table use the right class syntax
AFCMS Oct 12, 2022
8af46fd
Make moon_parameters table use the right class syntax
AFCMS Oct 12, 2022
f445cbc
WIP Luaentity stuff
AFCMS Oct 12, 2022
7ffbc20
ABM
AFCMS Oct 12, 2022
ffa081e
LBM
AFCMS Oct 12, 2022
6d15f5d
Biome
AFCMS Oct 12, 2022
25ef86b
Fix `ItemStack:take_item()` optional param
AFCMS Oct 16, 2022
e2a58ae
`ModChannel:is_writable()` -> `ModChannel:is_writeable()`
AFCMS Oct 16, 2022
52bfbcb
Fix `ObjectRef:move_to()` optional param
AFCMS Oct 16, 2022
826be88
Fix `Raycast()` optional params
AFCMS Oct 16, 2022
893c1de
Make `VoxelManip:write_to_map()` parameter optional
AFCMS Oct 19, 2022
7b3edae
Add biomes related functions
AFCMS Oct 19, 2022
1a5544b
Decoration functions
AFCMS Oct 19, 2022
094623d
Move alias functions to environment functions
AFCMS Oct 19, 2022
5562d98
Fix settings.json
AFCMS Oct 19, 2022
0e05b3c
Move privs to gameplay
AFCMS Oct 19, 2022
d7ba82c
Particle definition
AFCMS Oct 19, 2022
55811fe
Switch target to 5.6
AFCMS Oct 19, 2022
8c63b6d
Add `minetest.callback_origins`
AFCMS Oct 24, 2022
9d23a7c
Add default items table
AFCMS Oct 24, 2022
6456983
Schematic
AFCMS Nov 3, 2022
b6aa06f
Document authentication handler
AFCMS Nov 3, 2022
a3a1ac9
Many things
AFCMS Nov 10, 2022
1e4f276
Add rollback functions
AFCMS Nov 10, 2022
37ac637
Add default item definition on_place and on_drop functions
AFCMS Nov 10, 2022
d3b9d4f
Add default node definition on_punch and on_dig functions
AFCMS Nov 10, 2022
e32fd0b
Bunch of small fixes
AFCMS Nov 11, 2022
4fd0a0b
Make return value of the `on_timer` node definition field optional
AFCMS Nov 11, 2022
1fb17d9
Make allow_player_inventory_action callback function accept returning…
AFCMS Nov 11, 2022
67dffab
Allow craft_predict callbacks to return an ItemStack
AFCMS Nov 11, 2022
d7265a3
Make `ItemStack:peek_item()` allow nil as parameter
AFCMS Nov 21, 2022
a737b0f
Allow `InvRef:add_item()` to use an itemstack in string form
AFCMS Nov 21, 2022
5784b88
Make some classes herit from userdata
AFCMS Nov 21, 2022
3086d26
Make `Raycast` herit from userdata
AFCMS Nov 21, 2022
3301e24
Make `PcgRandom` herit from userdata
AFCMS Nov 21, 2022
6d0e45e
Better `emerge_area` autocompletion
AFCMS Dec 8, 2022
5310e48
Add some default values to `ObjectRef:set_animation()` parameters
AFCMS Dec 8, 2022
0a3de18
Add missing return value to `on_use` callback in iten definition
AFCMS Dec 8, 2022
adf0c61
Add `minetest.object_refs` and `minetest.luaentities`
AFCMS Dec 8, 2022
cdd1974
Fix some parameters
AFCMS Dec 8, 2022
406a195
Allow mod-set fields in item definition
AFCMS Dec 8, 2022
9c3ec26
Make minetest global a table instead of a class
AFCMS Dec 8, 2022
eb4a53d
Add `minetest.LIGHT_MAX` as a possible value for `light_source` node …
AFCMS Dec 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"material-icon-theme.activeIconPack": "none",
"Lua.workspace.ignoreDir": [".vscode", "config.lua"]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Target

- Minetest 7ffc0268dfd78647187554d6248015329e9f5d2d
- Minetest 5.6.0
15 changes: 0 additions & 15 deletions aliases.lua

This file was deleted.

5 changes: 2 additions & 3 deletions api/after.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---@meta

---@class job
local job = {}

---Cancels the job function from being called.
function job:cancel() end
---@field cancel fun(self: job)


---Call the function `func` after `time` seconds, may be fractional
---@param time number
Expand Down
2 changes: 2 additions & 0 deletions api/bans.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

---Returns a list of all bans formatted as string.
---@return string
---@nodiscard
function minetest.get_ban_list() end

---Returns list of bans matching IP address or name formatted as string.
---@param ip_or_name string
---@return string
---@nodiscard
function minetest.get_ban_description(ip_or_name) end

---Ban the IP of a currently connected player
Expand Down
21 changes: 12 additions & 9 deletions api/callbacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ minetest.registered_on_newplayers = {}
---Note: This callback is invoked even if the punched player is dead.
---
---Callback should return `true` to prevent the default damage mechanism.
---@param func fun(player: ObjectRef, hitter: ObjectRef, time_from_last_punch: number, tool_capabilities: tool_capabilities, dir: Vector, damage: number): boolean
---@param func fun(player: ObjectRef, hitter: ObjectRef, time_from_last_punch: number, tool_capabilities: tool_capabilities, dir: Vector, damage: number): boolean?
function minetest.register_on_punchplayer(func) end

---Map of registered on_punchplayer.
Expand All @@ -107,7 +107,7 @@ minetest.registered_on_rightclickplayers = {}

---Register a function that will be called when a player is damaged or healed.
---@param func fun(player: ObjectRef, hp_change: integer, reason: PlayerHPChangeReason): integer?, boolean?
---@param modifier boolean When true, the function should return the actual `hp_change`.
---@param modifier? boolean When true, the function should return the actual `hp_change`.
---Note: modifiers only get a temporary `hp_change` that can be modified by later modifiers.
---
---Modifiers can return true as a second argument to stop the execution of further functions.
Expand All @@ -132,7 +132,7 @@ minetest.registered_on_dieplayers = {}
---Called **before** repositioning of player occurs.
---
---Return `true` in func to disable regular player placement.
---@param func fun(player: ObjectRef): boolean
---@param func fun(player: ObjectRef): boolean?
function minetest.register_on_respawnplayer(func) end

---Map of registered on_respawnplayer.
Expand Down Expand Up @@ -162,7 +162,7 @@ minetest.registered_on_joinplayers = {}
---Register a function that will be called when a player leaves the game.
---
---`timed_out`: True for timeout, false for other reasons.
---@param func fun(player: ObjectRef, timed_out: boolean)
---@param func fun(player: ObjectRef, timed_out?: boolean)
function minetest.register_on_leaveplayer(func) end

---Map of registered on_leaveplayer.
Expand Down Expand Up @@ -247,7 +247,7 @@ minetest.registered_on_chatcommands = {}
---Newest functions are called first.
---
---If function returns `true`, remaining functions are not called.
---@param func fun(player: ObjectRef, formname: string, fields: table<string, any>): boolean
---@param func fun(player: ObjectRef, formname: string, fields: table<string, any>): boolean?
function minetest.register_on_player_receive_fields(func) end

---Map of registered on_player_receive_fields.
Expand All @@ -269,11 +269,11 @@ minetest.registered_on_crafts = {}
---Register a function that will be called before a player craft something to make the crafting prediction.
---
---Similar to `minetest.register_on_craft`.
---@param func fun(itemstack: ItemStack, player: ObjectRef, old_craft_grid: table, craft_inv: InvRef)
---@param func fun(itemstack: ItemStack, player: ObjectRef, old_craft_grid: table, craft_inv: InvRef): ItemStack?
function minetest.register_craft_predict(func) end

---Map of registered craft_predicts.
---@type fun(itemstack: ItemStack, player: ObjectRef, old_craft_grid: table, craft_inv: InvRef)[]
---@type (fun(itemstack: ItemStack, player: ObjectRef, old_craft_grid: table, craft_inv: InvRef): ItemStack?)[]
minetest.registered_craft_predicts = {}

---Determines how much of a stack may be taken, put or moved to a player inventory.
Expand All @@ -288,11 +288,11 @@ minetest.registered_craft_predicts = {}
---Return a numeric value to limit the amount of items to be taken, put or moved.
---
---A value of `-1` for `take` will make the source stack infinite.
---@param func fun(player: ObjectRef, action: '"move"'|'"put"'|'"take"', inventory: InvRef, inventory_info: {from_list: string, to_list: string, from_index: integer, to_index: integer, count: integer}|{listname: string, index: integer, stack: ItemStack}): integer
---@param func fun(player: ObjectRef, action: '"move"'|'"put"'|'"take"', inventory: InvRef, inventory_info: {from_list: string, to_list: string, from_index: integer, to_index: integer, count: integer}|{listname: string, index: integer, stack: ItemStack}): integer?
function minetest.register_allow_player_inventory_action(func) end

---Map of registered allow_player_inventory_action.
---@type (fun(player: ObjectRef, action: '"move"'|'"put"'|'"take"', inventory: InvRef, inventory_info: {from_list: string, to_list: string, from_index: integer, to_index: integer, count: integer}|{listname: string, index: integer, stack: ItemStack}): integer)[]
---@type (fun(player: ObjectRef, action: '"move"'|'"put"'|'"take"', inventory: InvRef, inventory_info: {from_list: string, to_list: string, from_index: integer, to_index: integer, count: integer}|{listname: string, index: integer, stack: ItemStack}): integer?)[]
minetest.registered_allow_player_inventory_action = {}

---Called after a take, put or move event from/to/in a player inventory.
Expand Down Expand Up @@ -380,3 +380,6 @@ function minetest.register_on_liquid_transformed(func) end
---Map of registered on_liquid_transformed.
---@type fun(pos_list: Vector[], node_list: node[])[]
minetest.registered_on_liquid_transformed = {}

---@type table<function, {mod: string|'"??"', name: string|'"??"'}>
minetest.callback_origins = {}
51 changes: 51 additions & 0 deletions api/default_item_def.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---@meta

---Place item as a node.
---@param itemstack ItemStack
---@param placer ObjectRef
---@param pointed_thing pointed_thing
---@param param2? integer overrides `facedir` and wallmounted `param2`
---@param prevent_after_place? boolean if `true`, `after_place_node` is not called for the newly placed node to prevent a callback and placement loop
---@return ItemStack itemstack
---@return Vector? position the location the node was placed to. `nil` if nothing was placed.
function minetest.item_place_node(itemstack, placer, pointed_thing, param2, prevent_after_place) end

---Place item as-is.
---
---Returns the leftover itemstack
---
---**Note**: This function is deprecated and will never be called.
---@param itemstack ItemStack
---@param placer ObjectRef
---@param pointed_thing pointed_thing
---@deprecated
function minetest.item_place_object(itemstack, placer, pointed_thing) end

---Wrapper that calls `minetest.item_place_node` if appropriate.
---
---Calls `on_rightclick` of `pointed_thing.under` if defined instead.
---
---**Note**: is not called when wielded item overrides `on_place`
---@param itemstack ItemStack
---@param placer ObjectRef
---@param pointed_thing pointed_thing
---@param param2? integer overrides `facedir` and wallmounted `param2`
---@return ItemStack itemstack
---@return Vector? position the location the node was placed to. `nil` if nothing was placed.
function minetest.item_place(itemstack, placer, pointed_thing, param2) end

---Drop the item.
---
---Returns the leftover itemstack.
---@param itemstack ItemStack
---@param dropper ObjectRef
---@param pos Vector
---@return ItemStack
function minetest.item_drop(itemstack, dropper, pos) end

---Returns `function(itemstack, user, pointed_thing)` as a function wrapper for `minetest.do_item_eat`.
---@param hp_change integer
---@param replace_with_item? string the itemstring which is added to the inventory. if the player is eating a stack, then `replace_with_item` goes to a different spot.
---@return fun(itemstack: ItemStack, user: ObjectRef, pos: Vector)
---@nodiscard
function minetest.item_eat(hp_change, replace_with_item) end
16 changes: 16 additions & 0 deletions api/default_node_def.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---@meta

---Calls functions registered by `minetest.register_on_punchnode()`.
---@param pos Vector
---@param node node
---@param puncher ObjectRef
---@param pointed_thing pointed_thing
function minetest.node_punch(pos, node, puncher, pointed_thing) end

---Checks if node can be dug, puts item into inventory, removes node.
---
---Calls functions registered by `minetest.registered_on_dignodes()`.
---@param pos Vector
---@param node node
---@param digger ObjectRef
function minetest.node_dig(pos, node, digger) end
Loading