@@ -203,18 +203,18 @@ from the available ones of the following files:
203203Examples of sound parameter tables:
204204-- Play locationless on all clients
205205{
206- gain = 1.0, -- default
206+ gain = 1.0, -- default
207207}
208208-- Play locationless to a player
209209{
210- to_player = name,
211- gain = 1.0, -- default
210+ to_player = name,
211+ gain = 1.0, -- default
212212}
213213-- Play in a location
214214{
215- pos = {x=1,y=2,z=3},
216- gain = 1.0, -- default
217- max_hear_distance = 32, -- default
215+ pos = {x=1,y=2,z=3},
216+ gain = 1.0, -- default
217+ max_hear_distance = 32, -- default
218218}
219219-- Play connected to an object, looped
220220{
@@ -266,11 +266,11 @@ local drawtype = get_nodedef_field(nodename, "drawtype")
266266Example: minetest.get_item_group(name, group) has been implemented as:
267267
268268function minetest.get_item_group(name, group)
269- if not minetest.registered_items[name] or not
270- minetest.registered_items[name].groups[group] then
271- return 0
272- end
273- return minetest.registered_items[name].groups[group]
269+ if not minetest.registered_items[name] or not
270+ minetest.registered_items[name].groups[group] then
271+ return 0
272+ end
273+ return minetest.registered_items[name].groups[group]
274274end
275275
276276Nodes
@@ -491,7 +491,7 @@ An example: Make meat soup from any meat, any water and any bowl
491491}
492492An another example: Make red wool from white wool and red dye
493493{
494- type = 'shapeless',
494+ type = 'shapeless',
495495 output = 'wool:red',
496496 recipe = {'wool:white', 'group:dye,basecolor_red'},
497497}
@@ -502,7 +502,7 @@ Special groups
502502- level: Can be used to give an additional sense of progression in the game.
503503 - A larger level will cause eg. a weapon of a lower level make much less
504504 damage, and get weared out much faster, or not be able to get drops
505- from destroyed nodes.
505+ from destroyed nodes.
506506 - 0 is something that is directly accessible at the start of gameplay
507507 - There is no upper limit
508508- dig_immediate: (player can always pick up node without tool wear)
@@ -609,11 +609,11 @@ maximum level.
609609Example definition of the capabilities of a tool
610610-------------------------------------------------
611611tool_capabilities = {
612- full_punch_interval=1.5,
613- max_drop_level=1,
614- groupcaps={
615- crumbly={maxlevel=2, uses=20, times={[1]=1.60, [2]=1.20, [3]=0.80}}
616- }
612+ full_punch_interval=1.5,
613+ max_drop_level=1,
614+ groupcaps={
615+ crumbly={maxlevel=2, uses=20, times={[1]=1.60, [2]=1.20, [3]=0.80}}
616+ }
617617}
618618
619619This makes the tool be able to dig nodes that fullfill both of these:
@@ -773,7 +773,7 @@ field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]
773773^ default is the default value of the field
774774 ^ default may contain variable references such as '${text}' which
775775 will fill the value from the metadata value 'text'
776- ^ Note: no extra text or more than a single variable is supported ATM.
776+ ^ Note: no extra text or more than a single variable is supported ATM.
777777
778778field[<name>;<label>;<default>]
779779^ as above but without position/size units
@@ -1050,20 +1050,20 @@ minetest.unban_player_or_ip(name) -> unban player or IP address
10501050
10511051Particles:
10521052minetest.add_particle(pos, velocity, acceleration, expirationtime,
1053- size, collisiondetection, texture, playername)
1053+ size, collisiondetection, texture, playername)
10541054^ Spawn particle at pos with velocity and acceleration
10551055^ Disappears after expirationtime seconds
10561056^ collisiondetection: if true collides with physical objects
10571057^ Uses texture (string)
10581058^ Playername is optional, if specified spawns particle only on the player's client
10591059
10601060minetest.add_particlespawner(amount, time,
1061- minpos, maxpos,
1062- minvel, maxvel,
1063- minacc, maxacc,
1064- minexptime, maxexptime,
1065- minsize, maxsize,
1066- collisiondetection, texture, playername)
1061+ minpos, maxpos,
1062+ minvel, maxvel,
1063+ minacc, maxacc,
1064+ minexptime, maxexptime,
1065+ minsize, maxsize,
1066+ collisiondetection, texture, playername)
10671067^ Add a particlespawner, an object that spawns an amount of particles over time seconds
10681068^ The particle's properties are random values in between the boundings:
10691069^ minpos/maxpos, minvel/maxvel (velocity), minacc/maxacc (acceleration),
@@ -1323,10 +1323,10 @@ Player-only: (no-op for other objects)
13231323 ^ Should usually be called in on_joinplayer
13241324- get_inventory_formspec() -> formspec string
13251325- get_player_control(): returns table with player pressed keys
1326- {jump=bool,right=bool,left=bool,LMB=bool,RMB=bool,sneak=bool,aux1=bool,down=bool,up=bool}
1326+ {jump=bool,right=bool,left=bool,LMB=bool,RMB=bool,sneak=bool,aux1=bool,down=bool,up=bool}
13271327- get_player_control_bits(): returns integer with bit packed player pressed keys
1328- bit nr/meaning: 0/up ,1/down ,2/left ,3/right ,4/jump ,5/aux1 ,6/sneak ,7/LMB ,8/RMB
1329-
1328+ bit nr/meaning: 0/up ,1/down ,2/left ,3/right ,4/jump ,5/aux1 ,6/sneak ,7/LMB ,8/RMB
1329+
13301330InvRef: Reference to an inventory
13311331methods:
13321332- is_empty(listname): return true if list is empty
@@ -1411,8 +1411,8 @@ Registered entities
14111411 ^ puncher: ObjectRef (can be nil)
14121412 ^ time_from_last_punch: Meant for disallowing spamming of clicks (can be nil)
14131413 ^ tool_capabilities: capability table of used tool (can be nil)
1414- ^ dir: unit vector of direction of punch. Always defined. Points from
1415- the puncher to the punched.
1414+ ^ dir: unit vector of direction of punch. Always defined. Points from
1415+ the puncher to the punched.
14161416 - on_rightclick(self, clicker)
14171417 - get_staticdata(self)
14181418 ^ Should return a string that will be passed to on_activate when
@@ -1533,10 +1533,10 @@ Node definition (register_node)
15331533 drawtype = "normal", -- See "Node drawtypes"
15341534 visual_scale = 1.0,
15351535 tiles = {tile definition 1, def2, def3, def4, def5, def6},
1536- ^ Textures of node; +Y, -Y, +X, -X, +Z, -Z (old field name: tile_images)
1536+ ^ Textures of node; +Y, -Y, +X, -X, +Z, -Z (old field name: tile_images)
15371537 ^ List can be shortened to needed length
15381538 special_tiles = {tile definition 1, Tile definition 2},
1539- ^ Special textures of node; used rarely (old field name: special_materials)
1539+ ^ Special textures of node; used rarely (old field name: special_materials)
15401540 ^ List can be shortened to needed length
15411541 alpha = 255,
15421542 post_effect_color = {a=0, r=0, g=0, b=0}, -- If player is inside node
@@ -1592,7 +1592,7 @@ Node definition (register_node)
15921592 can_dig = function(pos,player)
15931593 ^ returns true if node can be dug, or false if not
15941594 ^ default: nil
1595-
1595+
15961596 on_punch = func(pos, node, puncher),
15971597 ^ default: minetest.node_punch
15981598 ^ By default: does nothing
@@ -1615,32 +1615,32 @@ Node definition (register_node)
16151615 ^ Called when an UI form (eg. sign text input) returns data
16161616 ^ default: nil
16171617
1618- allow_metadata_inventory_move = func(pos, from_list, from_index,
1619- to_list, to_index, count, player),
1620- ^ Called when a player wants to move items inside the inventory
1621- ^ Return value: number of items allowed to move
1622-
1623- allow_metadata_inventory_put = func(pos, listname, index, stack, player),
1624- ^ Called when a player wants to put something into the inventory
1625- ^ Return value: number of items allowed to put
1626- ^ Return value: -1: Allow and don't modify item count in inventory
1618+ allow_metadata_inventory_move = func(pos, from_list, from_index,
1619+ to_list, to_index, count, player),
1620+ ^ Called when a player wants to move items inside the inventory
1621+ ^ Return value: number of items allowed to move
1622+
1623+ allow_metadata_inventory_put = func(pos, listname, index, stack, player),
1624+ ^ Called when a player wants to put something into the inventory
1625+ ^ Return value: number of items allowed to put
1626+ ^ Return value: -1: Allow and don't modify item count in inventory
16271627
1628- allow_metadata_inventory_take = func(pos, listname, index, stack, player),
1629- ^ Called when a player wants to take something out of the inventory
1630- ^ Return value: number of items allowed to take
1631- ^ Return value: -1: Allow and don't modify item count in inventory
1632-
1633- on_metadata_inventory_move = func(pos, from_list, from_index,
1634- to_list, to_index, count, player),
1635- on_metadata_inventory_put = func(pos, listname, index, stack, player),
1636- on_metadata_inventory_take = func(pos, listname, index, stack, player),
1637- ^ Called after the actual action has happened, according to what was allowed.
1638- ^ No return value
1628+ allow_metadata_inventory_take = func(pos, listname, index, stack, player),
1629+ ^ Called when a player wants to take something out of the inventory
1630+ ^ Return value: number of items allowed to take
1631+ ^ Return value: -1: Allow and don't modify item count in inventory
1632+
1633+ on_metadata_inventory_move = func(pos, from_list, from_index,
1634+ to_list, to_index, count, player),
1635+ on_metadata_inventory_put = func(pos, listname, index, stack, player),
1636+ on_metadata_inventory_take = func(pos, listname, index, stack, player),
1637+ ^ Called after the actual action has happened, according to what was allowed.
1638+ ^ No return value
16391639
1640- on_blast = func(pos, intensity),
1641- ^ intensity: 1.0 = mid range of regular TNT
1642- ^ If defined, called when an explosion touches the node, instead of
1643- removing the node
1640+ on_blast = func(pos, intensity),
1641+ ^ intensity: 1.0 = mid range of regular TNT
1642+ ^ If defined, called when an explosion touches the node, instead of
1643+ removing the node
16441644}
16451645
16461646Recipe for register_craft: (shaped)
@@ -1695,19 +1695,19 @@ Ore definition (register_ore)
16951695 ore = "default:stone_with_coal",
16961696 wherein = "default:stone",
16971697 clust_scarcity = 8*8*8,
1698- ^ Ore has a 1 out of clust_scarcity chance of spawning in a node
1698+ ^ Ore has a 1 out of clust_scarcity chance of spawning in a node
16991699 ^ This value should be *MUCH* higher than your intuition might tell you!
17001700 clust_num_ores = 8,
1701- ^ Number of ores in a cluster
1701+ ^ Number of ores in a cluster
17021702 clust_size = 3,
1703- ^ Size of the bounding box of the cluster
1703+ ^ Size of the bounding box of the cluster
17041704 ^ In this example, there is a 3x3x3 cluster where 8 out of the 27 nodes are coal ore
17051705 height_min = -31000,
17061706 height_max = 64,
17071707 noise_threshhold = 0.5,
1708- ^ If noise is above this threshhold, ore is placed. Not needed for a uniform distribution
1708+ ^ If noise is above this threshhold, ore is placed. Not needed for a uniform distribution
17091709 noise_params = {offset=0, scale=1, spread={x=100, y=100, z=100}, seed=23, octaves=3, persist=0.70}
1710- ^ NoiseParams structure describing the perlin noise used for ore distribution.
1710+ ^ NoiseParams structure describing the perlin noise used for ore distribution.
17111711 ^ Needed for sheet ore_type. Omit from scatter ore_type for a uniform ore distribution
17121712}
17131713
@@ -1721,24 +1721,24 @@ Chatcommand definition (register_chatcommand)
17211721
17221722Detached inventory callbacks
17231723{
1724- allow_move = func(inv, from_list, from_index, to_list, to_index, count, player),
1724+ allow_move = func(inv, from_list, from_index, to_list, to_index, count, player),
17251725 ^ Called when a player wants to move items inside the inventory
1726- ^ Return value: number of items allowed to move
1727-
1726+ ^ Return value: number of items allowed to move
1727+
17281728 allow_put = func(inv, listname, index, stack, player),
17291729 ^ Called when a player wants to put something into the inventory
1730- ^ Return value: number of items allowed to put
1731- ^ Return value: -1: Allow and don't modify item count in inventory
1730+ ^ Return value: number of items allowed to put
1731+ ^ Return value: -1: Allow and don't modify item count in inventory
17321732
17331733 allow_take = func(inv, listname, index, stack, player),
17341734 ^ Called when a player wants to take something out of the inventory
1735- ^ Return value: number of items allowed to take
1736- ^ Return value: -1: Allow and don't modify item count in inventory
1737-
1738- on_move = func(inv, from_list, from_index, to_list, to_index, count, player),
1735+ ^ Return value: number of items allowed to take
1736+ ^ Return value: -1: Allow and don't modify item count in inventory
1737+
1738+ on_move = func(inv, from_list, from_index, to_list, to_index, count, player),
17391739 on_put = func(inv, listname, index, stack, player),
17401740 on_take = func(inv, listname, index, stack, player),
1741- ^ Called after the actual action has happened, according to what was allowed.
1742- ^ No return value
1741+ ^ Called after the actual action has happened, according to what was allowed.
1742+ ^ No return value
17431743}
17441744
0 commit comments