MinetestForFun Game : Update all (but doors)
- Everything is updated, except doors - Some textures are moved to other mods (removed from default, but still used by those mods)
2
minetestforfun_game/.gitignore
vendored
|
@ -1,7 +1,7 @@
|
|||
## Generic ignorable patterns and files
|
||||
*~
|
||||
.*.swp
|
||||
*.bak*
|
||||
*bak*
|
||||
tags
|
||||
*.vim
|
||||
|
||||
|
|
|
@ -4,18 +4,21 @@ GitHub Repo: https://github.com/minetest/minetest_game
|
|||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The Minetest Game subgame 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 Minetest API, visit https://github.com/minetest/minetest/blob/master/doc/lua_api.txt
|
||||
Please note:
|
||||
[XYZ] refers to a section the Minetest API
|
||||
[#ABC] refers to a section in this document
|
||||
^ Explanation for line above
|
||||
|
||||
* [XYZ] refers to a section the Minetest API
|
||||
* [#ABC] refers to a section in this document
|
||||
|
||||
Bucket API
|
||||
----------
|
||||
|
||||
The bucket API allows registering new types of buckets for non-default liquids.
|
||||
|
||||
|
||||
bucket.register_liquid(
|
||||
"default:lava_source", -- name of the source node
|
||||
"default:lava_flowing", -- name of the flowing node
|
||||
|
@ -27,197 +30,264 @@ The bucket API allows registering new types of buckets for non-default liquids.
|
|||
|
||||
Beds API
|
||||
--------
|
||||
|
||||
beds.register_bed(
|
||||
"beds:bed", -- Bed name
|
||||
def: See [#Bed definition] -- Bed definition
|
||||
"beds:bed", -- Bed name
|
||||
def -- See [#Bed definition]
|
||||
)
|
||||
|
||||
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
|
||||
* `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
|
||||
|
||||
###Bed definition
|
||||
|
||||
#Bed definition
|
||||
---------------
|
||||
{
|
||||
description = "Simple Bed",
|
||||
inventory_image = "beds_bed.png",
|
||||
wield_image = "beds_bed.png",
|
||||
tiles = {
|
||||
bottom = {[Tile definition],
|
||||
^ the tiles of the bottom part of the bed
|
||||
},
|
||||
top = {[Tile definition],
|
||||
^ the tiles of the bottom part of the bed
|
||||
}
|
||||
},
|
||||
nodebox = {
|
||||
bottom = regular nodebox, see [Node boxes], -- bottm part of bed
|
||||
top = regular nodebox, see [Node boxes], -- top part of bed
|
||||
},
|
||||
selectionbox = regular nodebox, see [Node boxes], -- for both nodeboxes
|
||||
recipe = { -- Craft recipe
|
||||
{"group:wool", "group:wool", "group:wool"},
|
||||
{"group:wood", "group:wood", "group:wood"}
|
||||
{
|
||||
description = "Simple Bed",
|
||||
inventory_image = "beds_bed.png",
|
||||
wield_image = "beds_bed.png",
|
||||
tiles = {
|
||||
bottom = {'Tile definition'}, -- the tiles of the bottom part of the bed.
|
||||
top = {Tile definition} -- the tiles of the bottom part of the bed.
|
||||
},
|
||||
nodebox = {
|
||||
bottom = 'regular nodebox', -- bottom part of bed (see [Node boxes])
|
||||
top = 'regular nodebox', -- top part of bed (see [Node boxes])
|
||||
},
|
||||
selectionbox = 'regular nodebox', -- for both nodeboxes (see [Node boxes])
|
||||
recipe = { -- Craft recipe
|
||||
{"group:wool", "group:wool", "group:wool"},
|
||||
{"group:wood", "group:wood", "group:wood"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Doors API
|
||||
---------
|
||||
|
||||
The doors mod allows modders to register custom doors and trapdoors.
|
||||
|
||||
doors.register_door(name, def)
|
||||
^ name: "Door name"
|
||||
^ def: See [#Door definition]
|
||||
-> Registers new door
|
||||
`doors.register_door(name, def)`
|
||||
|
||||
doors.register_trapdoor(name, def)
|
||||
^ name: "Trapdoor name"
|
||||
^ def: See [#Trapdoor definition]
|
||||
-> Registers new trapdoor
|
||||
* Registers new door
|
||||
* `name` Name for door
|
||||
* `def` See [#Door definition]
|
||||
|
||||
`doors.register_trapdoor(name, def)`
|
||||
|
||||
* Registers new trapdoor
|
||||
* `name` Name for trapdoor
|
||||
* `def` See [#Trapdoor definition]
|
||||
|
||||
`doors.register_fencegate(name, def)`
|
||||
|
||||
* Registers new fence gate
|
||||
* `name` Name for fence gate
|
||||
* `def` See [#Fence gate definition]
|
||||
|
||||
`doors.get(pos)`
|
||||
|
||||
* `pos` A position as a table, e.g `{x = 1, y = 1, z = 1}`
|
||||
* Returns an ObjecRef to a door, or nil if the position does not contain a door
|
||||
|
||||
###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
|
||||
|
||||
the "player" parameter can be omitted in all methods. If passed then
|
||||
the usual permission checks will be performed to make sure the player
|
||||
has the permissions needed to open this door. If omitted then no
|
||||
permission checks are performed.
|
||||
|
||||
###Door definition
|
||||
|
||||
#Door definition
|
||||
----------------
|
||||
{
|
||||
description = "Door description",
|
||||
inventory_image = "mod_door_inv.png",
|
||||
groups = {group = 1},
|
||||
tiles_bottom: [Tile definition],
|
||||
^ the tiles of the bottom part of the door {front, side}
|
||||
tiles_top: [Tile definition],
|
||||
^ the tiles of the bottom part of the door {front, side}
|
||||
node_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
|
||||
node_box_top = regular nodebox, see [Node boxes], OPTIONAL,
|
||||
selection_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
|
||||
selection_box_top = regular nodebox, see [Node boxes], OPTIONAL,
|
||||
sound_open_door = sound play for open door, OPTIONAL,
|
||||
sound_close_door = sound play for close door, OPTIONAL,
|
||||
only_placer_can_open = true/false,
|
||||
^ If true, only placer can open the door (locked for others)
|
||||
}
|
||||
groups = {choppy = 2},
|
||||
tiles = {"mod_door.png"}, -- UV map.
|
||||
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)
|
||||
|
||||
#Trapdoor definition
|
||||
----------------
|
||||
{
|
||||
tile_front = "doors_trapdoor.png",
|
||||
^ the texture for the front and back of the trapdoor
|
||||
tile_side: "doors_trapdoor_side.png",
|
||||
^ the tiles of the four side parts of the trapdoor
|
||||
sound_open = sound to play when opening the trapdoor, OPTIONAL,
|
||||
sound_close = sound to play when closing the trapdoor, OPTIONAL,
|
||||
-> You can add any other node definition properties for minetest.register_node,
|
||||
such as wield_image, inventory_image, sounds, groups, description, ...
|
||||
Only node_box, selection_box, tiles, drop, drawtype, paramtype, paramtype2, on_rightclick
|
||||
will be overwritten by the trapdoor registration function
|
||||
}
|
||||
###Trapdoor definition
|
||||
|
||||
description = "Trapdoor description",
|
||||
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 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)
|
||||
|
||||
###Fence gate definition
|
||||
|
||||
description = "Wooden Fence Gate",
|
||||
texture = "default_wood.png",
|
||||
material = "default:wood",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(), -- optional
|
||||
|
||||
Fence API
|
||||
---------
|
||||
Allows creation of new fences with "fencelike" drawtype.
|
||||
|
||||
`default.register_fence(name, item definition)`
|
||||
|
||||
Registers a new fence. Custom fields texture and material are required, as
|
||||
are name and description. The rest is optional. You can pass most normal
|
||||
nodedef fields here except drawtype. The fence group will always be added
|
||||
for this node.
|
||||
|
||||
###fence definition
|
||||
|
||||
name = "default:fence_wood",
|
||||
description = "Wooden Fence",
|
||||
texture = "default_wood.png",
|
||||
material = "default:wood",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
#Walls API
|
||||
---------
|
||||
The walls API allows easy addition of stone auto-connecting wall nodes.
|
||||
|
||||
walls.register(name, desc, texture, mat, sounds)
|
||||
^ name = "walls:stone_wall". Node name.
|
||||
^ desc = "A Stone wall"
|
||||
^ texture = "default_stone.png"
|
||||
^ mat = "default:stone". Used to auto-generate crafting recipe.
|
||||
^ sounds = sounds: see [#Default sounds]
|
||||
|
||||
Farming API
|
||||
-----------
|
||||
|
||||
The farming API allows you to easily register plants and hoes.
|
||||
|
||||
farming.register_hoe(name, hoe definition)
|
||||
-> Register a new hoe, see [#hoe definition]
|
||||
`farming.register_hoe(name, hoe definition)`
|
||||
* Register a new hoe, see [#hoe definition]
|
||||
|
||||
farming.register_plant(name, Plant definition)
|
||||
-> Register a new growing plant, see [#Plant definition]
|
||||
`farming.register_plant(name, Plant definition)`
|
||||
* Register a new growing plant, see [#Plant definition]
|
||||
|
||||
#Hoe Definition
|
||||
---------------
|
||||
{
|
||||
description = "", -- Description for tooltip
|
||||
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
|
||||
max_uses = 30, -- Uses until destroyed
|
||||
material = "", -- Material for recipes
|
||||
recipe = { -- Craft recipe, if material isn't used
|
||||
{"air", "air", "air"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
###Hoe Definition
|
||||
|
||||
|
||||
{
|
||||
description = "", -- Description for tooltip
|
||||
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
|
||||
max_uses = 30, -- Uses until destroyed
|
||||
material = "", -- Material for recipes
|
||||
recipe = { -- Craft recipe, if material isn't used
|
||||
{"air", "air", "air"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Plant definition
|
||||
-----------------
|
||||
{
|
||||
description = "", -- Description of seed item
|
||||
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)
|
||||
minlight = 13, -- Minimum light to grow
|
||||
maxlight = default.LIGHT_MAX -- Maximum light to grow
|
||||
}
|
||||
###Plant definition
|
||||
|
||||
{
|
||||
description = "", -- Description of seed item
|
||||
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)
|
||||
minlight = 13, -- Minimum light to grow
|
||||
maxlight = default.LIGHT_MAX -- Maximum light to grow
|
||||
}
|
||||
|
||||
Fire API
|
||||
--------
|
||||
|
||||
`on_burn(pos)`
|
||||
|
||||
* Called when fire attempts to remove a burning node.
|
||||
* `pos` Position of the burning node.
|
||||
|
||||
Screwdriver API
|
||||
---------------
|
||||
|
||||
The screwdriver API allows you to control a node's behaviour when a screwdriver is used on it.
|
||||
To use it, add the on_screwdriver function to the node definition.
|
||||
on_rotate(pos, node, user, mode, new_param2)
|
||||
^ pos: position of the node that the screwdriver is being used on
|
||||
^ node: that node
|
||||
^ user: the player who used the screwdriver
|
||||
^ mode: screwdriver.ROTATE_FACE or screwdriver.ROTATE_AXIS
|
||||
^ new_param2: the new value of param2 that would have been set if on_rotate wasn't there
|
||||
^ return value: false to disallow rotation, nil to keep default behaviour, true to allow
|
||||
To use it, add the `on_screwdriver` function to the node definition.
|
||||
|
||||
`on_rotate(pos, node, user, mode, new_param2)`
|
||||
|
||||
* `pos` Position of the node that the screwdriver is being used on
|
||||
* `node` that node
|
||||
* `user` The player who used the screwdriver
|
||||
* `mode` screwdriver.ROTATE_FACE or screwdriver.ROTATE_AXIS
|
||||
* `new_param2` the new value of param2 that would have been set if on_rotate wasn't there
|
||||
* return value: false to disallow rotation, nil to keep default behaviour, true to allow
|
||||
it but to indicate that changed have already been made (so the screwdriver will wear out)
|
||||
^ use on_rotate = screwdriver.disallow to always disallow rotation
|
||||
^ use on_rotate = screwdriver.rotate_simple to allow only face rotation
|
||||
* use `on_rotate = screwdriver.disallow` to always disallow rotation
|
||||
* use `on_rotate = screwdriver.rotate_simple` to allow only face rotation
|
||||
|
||||
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)
|
||||
-> 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"
|
||||
-> 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(subname, recipeitem, groups, images, description, sounds)`
|
||||
|
||||
stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
|
||||
-> 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 stair's definition
|
||||
-> sounds: see [#Default sounds]
|
||||
* 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"
|
||||
* `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_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
|
||||
-> A wrapper for stairs.register_stair and stairs.register_slab
|
||||
-> Uses almost the same arguments as stairs.register_stair
|
||||
-> desc_stair: Description for stair node
|
||||
-> desc_slab: Description for slab node
|
||||
`stairs.register_slab(subname, recipeitem, groups, images, description, sounds)`
|
||||
|
||||
* 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 stair's definition
|
||||
* `sounds`: see [#Default sounds]
|
||||
|
||||
`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)`
|
||||
|
||||
* A wrapper for stairs.register_stair and stairs.register_slab
|
||||
* Uses almost the same arguments as stairs.register_stair
|
||||
* `desc_stair`: Description for stair node
|
||||
* `desc_slab`: Description for slab node
|
||||
|
||||
Xpanes API
|
||||
----------
|
||||
|
||||
Creates panes that automatically connect to each other
|
||||
|
||||
xpanes.register_pane(subname, def)
|
||||
-> subname: used for nodename. Result: "xpanes:subname" and "xpanes:subname_{2..15}"
|
||||
-> def: See [#Pane definition]
|
||||
`xpanes.register_pane(subname, def)`
|
||||
|
||||
#Pane definition
|
||||
----------------
|
||||
{
|
||||
textures = {"texture_Bottom_top", "texture_left_right", "texture_front_back"},
|
||||
^ 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
|
||||
}
|
||||
* `subname`: used for nodename. Result: "xpanes:subname" and "xpanes:subname_{2..15}"
|
||||
* `def`: See [#Pane definition]
|
||||
|
||||
###Pane definition
|
||||
|
||||
{
|
||||
textures = {"texture_Bottom_top", "texture_left_right", "texture_front_back"}, -- 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
|
||||
}
|
||||
|
||||
Raillike definitions
|
||||
--------------------
|
||||
|
||||
The following nodes use the group `connect_to_raillike` and will only connect to
|
||||
raillike nodes within this group and the same group value.
|
||||
Use `minetest.raillike_group(<Name>)` to get the group value.
|
||||
|
||||
| Node type | Raillike group name
|
||||
+-----------------------+--------------------
|
||||
|-----------------------|---------------------
|
||||
| default:rail | "rail"
|
||||
| tnt:gunpowder | "gunpowder"
|
||||
| tnt:gunpowder_burning | "gunpowder"
|
||||
|
@ -230,168 +300,188 @@ of your node.
|
|||
|
||||
Default sounds
|
||||
--------------
|
||||
|
||||
Sounds inside the default table can be used within the sounds field of node definitions.
|
||||
|
||||
default.node_sound_defaults()
|
||||
default.node_sound_stone_defaults()
|
||||
default.node_sound_dirt_defaults()
|
||||
default.node_sound_sand_defaults()
|
||||
default.node_sound_wood_defaults()
|
||||
default.node_sound_leaves_defaults()
|
||||
default.node_sound_glass_defaults()
|
||||
* `default.node_sound_defaults()`
|
||||
* `default.node_sound_stone_defaults()`
|
||||
* `default.node_sound_dirt_defaults()`
|
||||
* `default.node_sound_sand_defaults()`
|
||||
* `default.node_sound_wood_defaults()`
|
||||
* `default.node_sound_leaves_defaults()`
|
||||
* `default.node_sound_glass_defaults()`
|
||||
|
||||
Default constants
|
||||
-----------------
|
||||
default.LIGHT_MAX
|
||||
^ The maximum light level (see [Node definition] light_source)
|
||||
|
||||
`default.LIGHT_MAX` The maximum light level (see [Node definition] light_source)
|
||||
|
||||
Player API
|
||||
----------
|
||||
|
||||
The player API can register player models and update the player's appearence
|
||||
|
||||
default.player_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]
|
||||
`default.player_register_model(name, def)`
|
||||
|
||||
default.registered_player_models[name]
|
||||
^ Get a model's definition
|
||||
-> see [#Model definition]
|
||||
* Register a new model to be used by players.
|
||||
* name: model filename such as "character.x", "foo.b3d", etc.
|
||||
* def: See [#Model definition]
|
||||
|
||||
default.player_set_model(player, model_name)
|
||||
^ Change a player's model
|
||||
-> player: PlayerRef
|
||||
-> model_name: model registered with player_register_model()
|
||||
`default.registered_player_models[name]`
|
||||
|
||||
default.player_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
|
||||
* Get a model's definition
|
||||
* see [#Model definition]
|
||||
|
||||
default.player_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
|
||||
`default.player_set_model(player, model_name)`
|
||||
|
||||
* Change a player's model
|
||||
* `player`: PlayerRef
|
||||
* `model_name`: model registered with player_register_model()
|
||||
|
||||
`default.player_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.player_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
|
||||
|
||||
default.player_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
|
||||
|
||||
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},
|
||||
* Returns a table containing fields `model`, `textures` and `animation`.
|
||||
* Any of the fields of the returned table may be nil.
|
||||
* player: PlayerRef
|
||||
|
||||
###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},
|
||||
-- ...
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Leafdecay
|
||||
---------
|
||||
To enable leaf decay for a node, add it to the "leafdecay" group.
|
||||
|
||||
The rating of the group determines how far from a node in the group "tree"
|
||||
To enable leaf decay for a node, add it to the `leafdecay` group.
|
||||
|
||||
The rating of the group determines how far from a node in the group `tree`
|
||||
the node can be without decaying.
|
||||
|
||||
If param2 of the node is ~= 0, the node will always be preserved. Thus, if
|
||||
the player places a node of that kind, you will want to set param2=1 or so.
|
||||
If `param2` of the node is ~= 0, the node will always be preserved. Thus, if
|
||||
the player places a node of that kind, you will want to set `param2 = 1` or so.
|
||||
|
||||
The function default.after_place_leaves can be set as after_place_node of a node
|
||||
The function `default.after_place_leaves` can be set as `after_place_node of a node`
|
||||
to set param2 to 1 if the player places the node (should not be used for nodes
|
||||
that use param2 otherwise (e.g. facedir)).
|
||||
|
||||
If the node is in the leafdecay_drop group then it will always be dropped as an
|
||||
If the node is in the `leafdecay_drop` group then it will always be dropped as an
|
||||
item.
|
||||
|
||||
Dyes
|
||||
----
|
||||
|
||||
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.
|
||||
|
||||
#Color groups
|
||||
-------------
|
||||
Base color groups:
|
||||
- basecolor_white
|
||||
- basecolor_grey
|
||||
- basecolor_black
|
||||
- basecolor_red
|
||||
- basecolor_yellow
|
||||
- basecolor_green
|
||||
- basecolor_cyan
|
||||
- basecolor_blue
|
||||
- basecolor_magenta
|
||||
###Color groups
|
||||
|
||||
Extended color groups (* = equal to a base color):
|
||||
* 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
|
||||
Base color groups:
|
||||
|
||||
* `basecolor_white`
|
||||
* `basecolor_grey`
|
||||
* `basecolor_black`
|
||||
* `basecolor_red`
|
||||
* `basecolor_yellow`
|
||||
* `basecolor_green`
|
||||
* `basecolor_cyan`
|
||||
* `basecolor_blue`
|
||||
* `basecolor_magenta`
|
||||
|
||||
Extended color groups ( * means also base color )
|
||||
|
||||
* `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>
|
||||
|
||||
* `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
|
||||
|
||||
* `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:basecolor_yellow'},
|
||||
})
|
||||
|
||||
#Color lists
|
||||
------------
|
||||
dye.basecolors
|
||||
^ Array containing the names of available base colors
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = '<mod>:item_yellow',
|
||||
recipe = {'<mod>:item_no_color', 'group:basecolor_yellow'},
|
||||
})
|
||||
|
||||
dye.excolors
|
||||
^ Array containing the names of the available extended colors
|
||||
###Color lists
|
||||
|
||||
* `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)
|
||||
^ Grows a mgv6 tree or apple tree at pos
|
||||
|
||||
default.grow_jungle_tree(pos)
|
||||
^ Grows a mgv6 jungletree at pos
|
||||
* `default.grow_tree(pos, is_apple_tree)`
|
||||
* Grows a mgv6 tree or apple tree at pos
|
||||
|
||||
default.grow_pine_tree(pos)
|
||||
^ Grows a mgv6 pinetree at pos
|
||||
* `default.grow_jungle_tree(pos)`
|
||||
* Grows a mgv6 jungletree at pos
|
||||
|
||||
default.grow_new_apple_tree(pos)
|
||||
^ Grows a new design apple tree at pos
|
||||
* `default.grow_pine_tree(pos)`
|
||||
* Grows a mgv6 pinetree at pos
|
||||
|
||||
default.grow_new_jungle_tree(pos)
|
||||
^ Grows a new design jungle tree at pos
|
||||
* `default.grow_new_apple_tree(pos)`
|
||||
* Grows a new design apple tree at pos
|
||||
|
||||
default.grow_new_pine_tree(pos)
|
||||
^ Grows a new design pine tree at pos
|
||||
* `default.grow_new_jungle_tree(pos)`
|
||||
* Grows a new design jungle tree at pos
|
||||
|
||||
default.grow_new_acacia_tree(pos)
|
||||
^ Grows a new design acacia tree at pos
|
||||
* `default.grow_new_pine_tree(pos)`
|
||||
* Grows a new design pine tree at pos
|
||||
|
||||
* `default.grow_new_acacia_tree(pos)`
|
||||
* Grows a new design acacia tree at pos
|
||||
|
||||
* `default.grow_new_aspen_tree(pos)`
|
||||
* Grows a new design aspen tree at pos
|
||||
|
||||
* `default.grow_new_snowy_pine_tree(pos)`
|
||||
* Grows a new design snowy pine tree at pos
|
||||
|
|
|
@ -9,7 +9,13 @@
|
|||
# 0 to disable
|
||||
#share_bones_time = 1200
|
||||
|
||||
# Whether fire should be disabled (all fire nodes will instantly disappear)
|
||||
# How much earlier the bones of a dead player can be looted by
|
||||
# everyone if the player dies in a protected area they don't own.
|
||||
# 0 to disable. By default it is "share_bones_time" divide by four.
|
||||
#share_bones_time_early = 300
|
||||
|
||||
# Whether standard fire should be disabled ('basic flame' nodes will disappear)
|
||||
# 'permanent flame' nodes will remain with either setting
|
||||
#disable_fire = false
|
||||
|
||||
# Whether steel tools, torches and cobblestone should be given to new players
|
||||
|
|
|
@ -13,6 +13,7 @@ are added to the creative inventory.
|
|||
License of source code and media files:
|
||||
---------------------------------------
|
||||
Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com>
|
||||
Copyright (C) 2016 Jean-Patrick G. (kilbith) <jeanpatrick.guerrero@gmail.com>
|
||||
|
||||
This program is free software. It comes without any warranty, to
|
||||
the extent permitted by applicable law. You can redistribute it
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
-- minetest/creative/init.lua
|
||||
|
||||
creative_inventory = {}
|
||||
creative = {}
|
||||
local player_inventory = {}
|
||||
|
||||
-- Create detached creative inventory after loading all mods
|
||||
creative_inventory.init_creative_inventory = function(player)
|
||||
creative.init_creative_inventory = function(player)
|
||||
local player_name = player:get_player_name()
|
||||
creative_inventory[player_name] = {}
|
||||
creative_inventory[player_name].size = 0
|
||||
creative_inventory[player_name].filter = nil
|
||||
creative_inventory[player_name].start_i = 1
|
||||
player_inventory[player_name] = {}
|
||||
player_inventory[player_name].size = 0
|
||||
player_inventory[player_name].filter = ""
|
||||
player_inventory[player_name].start_i = 1
|
||||
player_inventory[player_name].tab_id = 2
|
||||
|
||||
local inv = minetest.create_detached_inventory("creative_" .. player_name, {
|
||||
minetest.create_detached_inventory("creative_" .. player_name, {
|
||||
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
if minetest.setting_getbool("creative_mode") and not to_list == "main" then
|
||||
return count
|
||||
else
|
||||
return 0
|
||||
|
@ -33,16 +35,17 @@ creative_inventory.init_creative_inventory = function(player)
|
|||
on_put = function(inv, listname, index, stack, player)
|
||||
end,
|
||||
on_take = function(inv, listname, index, stack, player)
|
||||
--print(player:get_player_name().." takes item from creative inventory; listname="..dump(listname)..", index="..dump(index)..", stack="..dump(stack))
|
||||
local player_name, stack_name = player:get_player_name(), stack:get_name()
|
||||
--print(player_name .. " takes item from creative inventory; listname = " .. listname .. ", index = " .. index .. ", stack = " .. dump(stack:to_table()))
|
||||
if stack then
|
||||
minetest.log("action", player:get_player_name().." takes "..dump(stack:get_name()).." from creative inventory")
|
||||
--print("stack:get_name()="..dump(stack:get_name())..", stack:get_count()="..dump(stack:get_count()))
|
||||
minetest.log("action", player_name .. " takes " .. stack_name .. " from creative inventory")
|
||||
--print("Stack name: " .. stack_name .. ", Stack count: " .. stack:get_count())
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
creative_inventory.update(player_name, nil, 2)
|
||||
--print("creative inventory size: "..dump(creative_inventory[player_name].size))
|
||||
creative.update_creative_inventory(player_name)
|
||||
--print("creative inventory size: " .. player_inventory[player_name].size)
|
||||
end
|
||||
|
||||
local function tab_category(tab_id)
|
||||
|
@ -58,22 +61,24 @@ local function tab_category(tab_id)
|
|||
return id_category[tab_id] or id_category[2]
|
||||
end
|
||||
|
||||
function creative_inventory.update(player_name, filter, tab_id)
|
||||
function creative.update_creative_inventory(player_name)
|
||||
local creative_list = {}
|
||||
local inv = minetest.get_inventory({type = "detached", name = "creative_" .. player_name})
|
||||
local player_inv = minetest.get_inventory({type = "detached", name = "creative_" .. player_name})
|
||||
local inv = player_inventory[player_name]
|
||||
|
||||
for name, def in pairs(tab_category(tab_id)) do
|
||||
for name, def in pairs(tab_category(inv.tab_id)) do
|
||||
if not (def.groups.not_in_creative_inventory == 1) and
|
||||
def.description and def.description ~= "" and
|
||||
(not filter or def.name:find(filter, 1, true)) then
|
||||
(def.name:find(inv.filter, 1, true) or
|
||||
def.description:lower():find(inv.filter, 1, true)) then
|
||||
creative_list[#creative_list+1] = name
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(creative_list)
|
||||
inv:set_size("main", #creative_list)
|
||||
inv:set_list("main", creative_list)
|
||||
creative_inventory[player_name].size = #creative_list
|
||||
player_inv:set_size("main", #creative_list)
|
||||
player_inv:set_list("main", creative_list)
|
||||
inv.size = #creative_list
|
||||
end
|
||||
|
||||
-- Create the trash field
|
||||
|
@ -87,46 +92,46 @@ local trash = minetest.create_detached_inventory("creative_trash", {
|
|||
return 0
|
||||
end
|
||||
end,
|
||||
on_put = function(inv, listname, index, stack, player)
|
||||
inv:set_stack(listname, index, "")
|
||||
on_put = function(inv, listname)
|
||||
inv:set_list(listname, {})
|
||||
end,
|
||||
})
|
||||
trash:set_size("main", 1)
|
||||
|
||||
creative_inventory.set_creative_formspec = function(player, start_i, pagenum, tab_id)
|
||||
creative.set_creative_formspec = function(player, start_i)
|
||||
local player_name = player:get_player_name()
|
||||
local filter = creative_inventory[player_name].filter or ""
|
||||
pagenum = math.floor(pagenum)
|
||||
local pagemax = math.floor((creative_inventory[player_name].size - 1) / (3*8) + 1)
|
||||
tab_id = tab_id or 2
|
||||
local inv = player_inventory[player_name]
|
||||
local pagenum = math.floor(start_i / (3*8) + 1)
|
||||
local pagemax = math.ceil(inv.size / (3*8))
|
||||
|
||||
player:set_inventory_formspec([[
|
||||
size[8,8.6]
|
||||
image[4.06,3.4;0.8,0.8;trash_icon.png]
|
||||
image[4.06,3.4;0.8,0.8;creative_trash_icon.png]
|
||||
list[current_player;main;0,4.7;8,1;]
|
||||
list[current_player;main;0,5.85;8,3;8]
|
||||
list[detached:creative_trash;main;4,3.3;1,1;]
|
||||
listring[]
|
||||
tablecolumns[color;text;color;text]
|
||||
tableoptions[background=#00000000;highlight=#00000000;border=false]
|
||||
button[5.4,3.2;0.8,0.9;creative_prev;<]
|
||||
button[7.25,3.2;0.8,0.9;creative_next;>]
|
||||
button[2.1,3.4;0.8,0.5;search;?]
|
||||
button[2.75,3.4;0.8,0.5;clear;X]
|
||||
tooltip[search;Search]
|
||||
tooltip[clear;Reset]
|
||||
button[2.1,3.4;0.8,0.5;creative_search;?]
|
||||
button[2.75,3.4;0.8,0.5;creative_clear;X]
|
||||
tooltip[creative_search;Search]
|
||||
tooltip[creative_clear;Reset]
|
||||
listring[current_player;main]
|
||||
]] ..
|
||||
"field[0.3,3.5;2.2,1;filter;;".. filter .."]"..
|
||||
"listring[detached:creative_".. player_name ..";main]"..
|
||||
"tabheader[0,0;tabs;Crafting,All,Nodes,Tools,Items;".. tostring(tab_id) ..";true;false]"..
|
||||
"list[detached:creative_".. player_name ..";main;0,0;8,3;".. tostring(start_i) .."]"..
|
||||
"table[6.05,3.35;1.15,0.5;pagenum;#FFFF00,".. tostring(pagenum) ..",#FFFFFF,/ ".. tostring(pagemax) .."]"..
|
||||
default.get_hotbar_bg(0,4.7)..
|
||||
"field[0.3,3.5;2.2,1;creative_filter;;" .. inv.filter .. "]" ..
|
||||
"listring[detached:creative_" .. player_name .. ";main]" ..
|
||||
"tabheader[0,0;creative_tabs;Crafting,All,Nodes,Tools,Items;" .. tostring(inv.tab_id) .. ";true;false]" ..
|
||||
"list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" ..
|
||||
"table[6.05,3.35;1.15,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]" ..
|
||||
default.get_hotbar_bg(0,4.7) ..
|
||||
default.gui_bg .. default.gui_bg_img .. default.gui_slots
|
||||
)
|
||||
end
|
||||
|
||||
creative_inventory.set_crafting_formspec = function(player)
|
||||
creative.set_crafting_formspec = function(player)
|
||||
player:set_inventory_formspec([[
|
||||
size[8,8.6]
|
||||
list[current_player;craft;2,0.75;3,3;]
|
||||
|
@ -134,13 +139,13 @@ creative_inventory.set_crafting_formspec = function(player)
|
|||
list[current_player;main;0,4.7;8,1;]
|
||||
list[current_player;main;0,5.85;8,3;8]
|
||||
list[detached:creative_trash;main;0,2.75;1,1;]
|
||||
image[0.06,2.85;0.8,0.8;trash_icon.png]
|
||||
image[0.06,2.85;0.8,0.8;creative_trash_icon.png]
|
||||
image[5,1.75;1,1;gui_furnace_arrow_bg.png^[transformR270]
|
||||
tabheader[0,0;tabs;Crafting,All,Nodes,Tools,Items;1;true;false]
|
||||
tabheader[0,0;creative_tabs;Crafting,All,Nodes,Tools,Items;1;true;false]
|
||||
listring[current_player;main]
|
||||
listring[current_player;craft]
|
||||
]] ..
|
||||
default.get_hotbar_bg(0,4.7)..
|
||||
default.get_hotbar_bg(0,4.7) ..
|
||||
default.gui_bg .. default.gui_bg_img .. default.gui_slots
|
||||
)
|
||||
end
|
||||
|
@ -150,78 +155,82 @@ minetest.register_on_joinplayer(function(player)
|
|||
if not minetest.setting_getbool("creative_mode") then
|
||||
return
|
||||
end
|
||||
creative_inventory.init_creative_inventory(player)
|
||||
creative_inventory.set_creative_formspec(player, 0, 1, 2)
|
||||
creative.init_creative_inventory(player)
|
||||
creative.set_creative_formspec(player, 0)
|
||||
end)
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if formname ~= "" or not minetest.setting_getbool("creative_mode") then
|
||||
return
|
||||
end
|
||||
-- Figure out current page from formspec
|
||||
|
||||
local player_name = player:get_player_name()
|
||||
local formspec = player:get_inventory_formspec()
|
||||
local filter = formspec:match("filter;;([%w_:]+)") or ""
|
||||
local start_i = formspec:match("list%[detached:creative_".. player_name ..";.*;(%d+)%]")
|
||||
local tab_id = tonumber(formspec:match("tabheader%[.*;(%d+)%;.*%]"))
|
||||
local inv_size = creative_inventory[player_name].size
|
||||
start_i = tonumber(start_i) or 0
|
||||
local inv = player_inventory[player_name]
|
||||
|
||||
if fields.quit then
|
||||
if tab_id == 1 then
|
||||
creative_inventory.set_crafting_formspec(player)
|
||||
if inv.tab_id == 1 then
|
||||
creative.set_crafting_formspec(player)
|
||||
end
|
||||
elseif fields.tabs then
|
||||
if tonumber(fields.tabs) == 1 then
|
||||
creative_inventory.set_crafting_formspec(player)
|
||||
elseif fields.creative_tabs then
|
||||
local tab = tonumber(fields.creative_tabs)
|
||||
inv.tab_id = tab
|
||||
|
||||
if tab == 1 then
|
||||
creative.set_crafting_formspec(player)
|
||||
else
|
||||
creative_inventory.update(player_name, filter, tonumber(fields.tabs))
|
||||
creative_inventory.set_creative_formspec(player, 0, 1, tonumber(fields.tabs))
|
||||
creative.update_creative_inventory(player_name)
|
||||
creative.set_creative_formspec(player, 0)
|
||||
end
|
||||
elseif fields.clear then
|
||||
creative_inventory[player_name].filter = ""
|
||||
creative_inventory.update(player_name, nil, tab_id)
|
||||
creative_inventory.set_creative_formspec(player, 0, 1, tab_id)
|
||||
elseif fields.search then
|
||||
creative_inventory[player_name].filter = fields.filter:lower()
|
||||
creative_inventory.update(player_name, fields.filter:lower(), tab_id)
|
||||
creative_inventory.set_creative_formspec(player, 0, 1, tab_id)
|
||||
elseif fields.creative_clear then
|
||||
inv.filter = ""
|
||||
creative.update_creative_inventory(player_name)
|
||||
creative.set_creative_formspec(player, 0)
|
||||
elseif fields.creative_search then
|
||||
inv.filter = fields.creative_filter:lower()
|
||||
creative.update_creative_inventory(player_name)
|
||||
creative.set_creative_formspec(player, 0)
|
||||
else
|
||||
local formspec = player:get_inventory_formspec()
|
||||
local start_i = formspec:match("list%[.-" .. player_name .. ";.-;(%d+)%]")
|
||||
start_i = tonumber(start_i) or 0
|
||||
|
||||
if fields.creative_prev then
|
||||
start_i = start_i - 3*8
|
||||
if start_i < 0 then
|
||||
start_i = inv_size - (inv_size % (3*8))
|
||||
if inv_size == start_i then
|
||||
start_i = math.max(0, inv_size - (3*8))
|
||||
start_i = inv.size - (inv.size % (3*8))
|
||||
if inv.size == start_i then
|
||||
start_i = math.max(0, inv.size - (3*8))
|
||||
end
|
||||
end
|
||||
elseif fields.creative_next then
|
||||
start_i = start_i + 3*8
|
||||
if start_i >= inv_size then
|
||||
if start_i >= inv.size then
|
||||
start_i = 0
|
||||
end
|
||||
end
|
||||
|
||||
creative_inventory.set_creative_formspec(player, start_i, start_i / (3*8) + 1, tab_id)
|
||||
creative.set_creative_formspec(player, start_i)
|
||||
end
|
||||
end)
|
||||
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
local digtime = 0.5
|
||||
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 3}
|
||||
|
||||
minetest.register_item(":", {
|
||||
type = "none",
|
||||
wield_image = "wieldhand.png",
|
||||
wield_scale = {x=1, y=1, z=2.5},
|
||||
wield_scale = {x = 1, y = 1, z = 2.5},
|
||||
range = 10,
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.5,
|
||||
max_drop_level = 3,
|
||||
groupcaps = {
|
||||
crumbly = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3},
|
||||
cracky = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3},
|
||||
snappy = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3},
|
||||
choppy = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3},
|
||||
oddly_breakable_by_hand = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3},
|
||||
crumbly = caps,
|
||||
cracky = caps,
|
||||
snappy = caps,
|
||||
choppy = caps,
|
||||
oddly_breakable_by_hand = caps,
|
||||
},
|
||||
damage_groups = {fleshy = 10},
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ Cisoun's WTFPL texture pack:
|
|||
default_lava.png
|
||||
default_leaves.png
|
||||
default_sapling.png
|
||||
default_sign_wall.png
|
||||
default_stone.png
|
||||
default_tree.png
|
||||
default_tree_top.png
|
||||
|
@ -59,7 +58,6 @@ VanessaE (WTFPL):
|
|||
default_desert_sand.png
|
||||
default_desert_stone.png
|
||||
default_sand.png
|
||||
default_jungletree_top.png
|
||||
|
||||
Calinou (CC BY-SA):
|
||||
default_brick.png
|
||||
|
@ -100,28 +98,29 @@ Zeg9 (CC BY-SA 3.0):
|
|||
default_gold_block.png
|
||||
|
||||
paramat (CC BY-SA 3.0):
|
||||
wieldhand.png, derived from character.png by Jordach (CC BY-SA 3.0)
|
||||
wieldhand.png copied from character.png by Jordach (CC BY-SA 3.0)
|
||||
default_pinetree.png
|
||||
default_pinetree_top.png
|
||||
default_pinewood.png
|
||||
default_sandstone_brick.png
|
||||
default_obsidian_brick.png
|
||||
default_river_water.png
|
||||
default_river_water_source_animated.png
|
||||
default_river_water_flowing_animated.png
|
||||
default_acacia_leaves.png
|
||||
default_acacia_sapling.png
|
||||
default_acacia_tree.png
|
||||
default_acacia_tree_top.png
|
||||
default_acacia_wood.png
|
||||
default_junglewood.png
|
||||
default_jungletree_top.png
|
||||
default_sandstone_brick.png
|
||||
default_obsidian_brick.png
|
||||
default_stone_brick.png
|
||||
default_desert_stone_brick.png
|
||||
default_river_water.png
|
||||
default_river_water_source_animated.png
|
||||
default_river_water_flowing_animated.png
|
||||
default_dry_grass.png
|
||||
default_dry_grass_side.png
|
||||
default_dry_grass_*.png
|
||||
default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0)
|
||||
default_grass.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
|
||||
default_grass_side.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
|
||||
default_stone_brick.png, derived from a texture by Cisoun (WTFPL)
|
||||
default_desert_stone_brick.png, derived from a texture by VanessaE (WTFPL)
|
||||
default_grass.png
|
||||
default_grass_side.png
|
||||
|
||||
brunob.santos (CC BY-SA 4.0):
|
||||
default_desert_cobble.png
|
||||
|
@ -156,6 +155,9 @@ sofar (CC BY-SA 3.0):
|
|||
default_aspen_tree_top, derived from default_pine_tree_top (by paramat)
|
||||
default_aspen_wood, derived from default_pine_wood (by paramat)
|
||||
|
||||
sofar (WTFPL):
|
||||
default_gravel.png -- Derived from Gambit's PixelBOX texture pack light gravel
|
||||
|
||||
Neuromancer (CC BY-SA 2.0):
|
||||
default_cobble.png, based on texture by Brane praefect
|
||||
default_mossycobble.png, based on texture by Brane praefect
|
||||
|
@ -174,6 +176,9 @@ Gambit (WTFPL):
|
|||
default_grass_*.png
|
||||
default_paper.png
|
||||
default_diamond_block.png
|
||||
default_ladder_steel.png
|
||||
default_sign_wall_wood.png
|
||||
default_flint.png
|
||||
|
||||
asl97 (WTFPL):
|
||||
default_ice.png
|
||||
|
|
|
@ -23,7 +23,7 @@ minetest.register_alias("bookshelf", "default:bookshelf")
|
|||
minetest.register_alias("glass", "default:glass")
|
||||
minetest.register_alias("wooden_fence", "default:fence_wood")
|
||||
minetest.register_alias("rail", "default:rail")
|
||||
minetest.register_alias("ladder", "default:ladder")
|
||||
minetest.register_alias("ladder", "default:ladder_wood")
|
||||
minetest.register_alias("wood", "default:wood")
|
||||
minetest.register_alias("mese", "default:mese")
|
||||
minetest.register_alias("cloud", "default:cloud")
|
||||
|
@ -32,7 +32,7 @@ minetest.register_alias("water_source", "default:water_source")
|
|||
minetest.register_alias("lava_flowing", "default:lava_flowing")
|
||||
minetest.register_alias("lava_source", "default:lava_source")
|
||||
minetest.register_alias("torch", "default:torch")
|
||||
minetest.register_alias("sign_wall", "default:sign_wall")
|
||||
minetest.register_alias("sign_wall", "default:sign_wall_wood")
|
||||
minetest.register_alias("furnace", "default:furnace")
|
||||
minetest.register_alias("chest", "default:chest")
|
||||
minetest.register_alias("locked_chest", "default:chest_locked")
|
||||
|
@ -68,9 +68,13 @@ minetest.register_alias("steel_ingot", "default:steel_ingot")
|
|||
minetest.register_alias("clay_brick", "default:clay_brick")
|
||||
minetest.register_alias("snow", "default:snow")
|
||||
|
||||
-- 'mese_block' was used for a while for the block form of mese
|
||||
minetest.register_alias("default:mese_block", "default:mese")
|
||||
|
||||
-- Aliases for corrected pine node names
|
||||
minetest.register_alias("default:pinetree", "default:pine_tree")
|
||||
minetest.register_alias("default:pinewood", "default:pine_wood")
|
||||
|
||||
-- Mese now comes in the form of blocks, ore, crystal and fragments
|
||||
minetest.register_alias("default:mese", "default:mese_block")
|
||||
minetest.register_alias("default:ladder", "default:ladder_wood")
|
||||
minetest.register_alias("default:sign_wall", "default:sign_wall_wood")
|
||||
|
||||
|
|
|
@ -50,48 +50,16 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:fence_wood 2',
|
||||
output = 'default:sign_wall_steel 3',
|
||||
recipe = {
|
||||
{'default:stick', 'default:stick', 'default:stick'},
|
||||
{'default:stick', 'default:stick', 'default:stick'},
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:fence_cobble 16",
|
||||
recipe = {
|
||||
{"default:cobble", "default:cobble", "default:cobble"},
|
||||
{"default:cobble", "default:cobble", "default:cobble"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:fence_desert_cobble 16",
|
||||
recipe = {
|
||||
{"default:desert_cobble", "default:desert_cobble", "default:desert_cobble"},
|
||||
{"default:desert_cobble", "default:desert_cobble", "default:desert_cobble"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:fence_steelblock 16",
|
||||
recipe = {
|
||||
{"default:steelblock", "default:steelblock", "default:steelblock"},
|
||||
{"default:steelblock", "default:steelblock", "default:steelblock"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:fence_brick 16",
|
||||
recipe = {
|
||||
{"default:brick", "default:brick", "default:brick"},
|
||||
{"default:brick", "default:brick", "default:brick"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sign_wall',
|
||||
output = 'default:sign_wall_wood 3',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
|
@ -100,7 +68,7 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:torch 5',
|
||||
output = 'default:torch 4',
|
||||
recipe = {
|
||||
{'default:coal_lump'},
|
||||
{'group:stick'},
|
||||
|
@ -468,20 +436,11 @@ minetest.register_craft({ -- Ultimate Warrior weapon
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:sword_nyan",
|
||||
recipe = {
|
||||
{"default:nyancat"},
|
||||
{"default:nyancat"},
|
||||
{"group:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:rail 16',
|
||||
output = 'default:rail 24',
|
||||
recipe = {
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -498,7 +457,7 @@ minetest.register_craft({
|
|||
output = 'default:chest_locked',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'group:ingot', 'group:wood'},
|
||||
{'group:wood', 'default:steel_ingot', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
}
|
||||
})
|
||||
|
@ -644,44 +603,9 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sand',
|
||||
output = 'default:sand 4',
|
||||
recipe = {
|
||||
{'default:desert_sand'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:desert_sand",
|
||||
recipe = {
|
||||
{"default:sand"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:desert_stone 2",
|
||||
recipe = {
|
||||
{"default:desert_sand", "default:desert_sand"},
|
||||
{"default:desert_sand", "default:desert_sand"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:sand",
|
||||
recipe = {
|
||||
{"default:gravel"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:dirt 4",
|
||||
type = "shapeless",
|
||||
recipe = {"default:gravel", "default:gravel", "default:gravel", "default:gravel"}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:gravel",
|
||||
recipe = {
|
||||
{"default:cobble"},
|
||||
{'default:sandstone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -693,56 +617,71 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:clay",
|
||||
output = "default:desert_sand",
|
||||
recipe = {
|
||||
{"default:clay_lump", "default:clay_lump", "default:clay_lump"},
|
||||
{"default:clay_lump", "default:clay_lump", "default:clay_lump"},
|
||||
{"default:clay_lump", "default:clay_lump", "default:clay_lump"},
|
||||
{"default:sand"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:clay',
|
||||
recipe = {
|
||||
{'default:clay_lump', 'default:clay_lump'},
|
||||
{'default:clay_lump', 'default:clay_lump'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:clay_lump 4',
|
||||
recipe = {
|
||||
{'default:clay'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:brick',
|
||||
recipe = {
|
||||
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
|
||||
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
|
||||
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
|
||||
{'default:clay_brick', 'default:clay_brick'},
|
||||
{'default:clay_brick', 'default:clay_brick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:clay_brick 9',
|
||||
output = 'default:clay_brick 4',
|
||||
recipe = {
|
||||
{'default:brick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:clay_lump 9",
|
||||
recipe = {{"default:clay"},}
|
||||
output = 'default:paper',
|
||||
recipe = {
|
||||
{'default:papyrus', 'default:papyrus', 'default:papyrus'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'default:paper 4',
|
||||
recipe = {'default:papyrus', 'default:papyrus', 'default:papyrus'},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'default:book',
|
||||
recipe = {'default:paper', 'default:paper', 'default:paper'}
|
||||
recipe = {
|
||||
{'default:paper'},
|
||||
{'default:paper'},
|
||||
{'default:paper'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'default:bookshelf',
|
||||
recipe = {'group:wood', 'group:wood', 'group:wood', 'default:book', 'default:book', 'default:book', 'group:wood', 'group:wood', 'group:wood'}
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'default:book', 'default:book', 'default:book'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:ladder 3',
|
||||
output = 'default:ladder_wood 3',
|
||||
recipe = {
|
||||
{'group:stick', '', 'group:stick'},
|
||||
{'group:stick', 'group:stick', 'group:stick'},
|
||||
|
@ -750,6 +689,15 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:ladder_steel 15',
|
||||
recipe = {
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:mese',
|
||||
recipe = {
|
||||
|
@ -773,6 +721,35 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:sand",
|
||||
recipe = {
|
||||
{"default:gravel"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:dirt 4",
|
||||
type = "shapeless",
|
||||
recipe = {"default:gravel", "default:gravel", "default:gravel", "default:gravel"}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:gravel",
|
||||
recipe = {
|
||||
{"default:cobble"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:desert_stone 2",
|
||||
recipe = {
|
||||
{"default:desert_sand", "default:desert_sand"},
|
||||
{"default:desert_sand", "default:desert_sand"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:meselamp 1',
|
||||
recipe = {
|
||||
|
@ -798,7 +775,7 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:obsidianbrick 2',
|
||||
output = 'default:obsidianbrick 4',
|
||||
recipe = {
|
||||
{'default:obsidian', 'default:obsidian'},
|
||||
{'default:obsidian', 'default:obsidian'}
|
||||
|
@ -833,13 +810,14 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
output = 'default:snowblock',
|
||||
recipe = {
|
||||
{'default:snow', 'default:snow'},
|
||||
{'default:snow', 'default:snow'},
|
||||
{'default:snow', 'default:snow', 'default:snow'},
|
||||
{'default:snow', 'default:snow', 'default:snow'},
|
||||
{'default:snow', 'default:snow', 'default:snow'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:snow 4',
|
||||
output = 'default:snow 9',
|
||||
recipe = {
|
||||
{'default:snowblock'},
|
||||
}
|
||||
|
@ -856,7 +834,7 @@ minetest.register_craft({
|
|||
--
|
||||
minetest.register_craft({
|
||||
type = "toolrepair",
|
||||
additional_wear = -0.15,
|
||||
additional_wear = -0.02,
|
||||
})
|
||||
|
||||
--
|
||||
|
@ -878,13 +856,13 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "default:stone",
|
||||
recipe = "default:mossycobble",
|
||||
recipe = "default:cobble",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "default:stone",
|
||||
recipe = "default:cobble",
|
||||
recipe = "default:mossycobble",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -978,7 +956,31 @@ minetest.register_craft({
|
|||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:ladder",
|
||||
recipe = "default:fence_acacia_wood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:fence_junglewood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:fence_pine_wood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:fence_aspen_wood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:ladder_wood",
|
||||
burntime = 3,
|
||||
})
|
||||
|
||||
|
@ -1002,7 +1004,7 @@ minetest.register_craft({
|
|||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:sign_wall",
|
||||
recipe = "default:sign_wall_wood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
|
|
|
@ -4,89 +4,132 @@ minetest.register_craftitem("default:stick", {
|
|||
description = "Stick",
|
||||
stack_max = 1000,
|
||||
inventory_image = "default_stick.png",
|
||||
wield_image = "default_stick.png^[transformR90",
|
||||
groups = {stick=1},
|
||||
groups = {stick = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:paper", {
|
||||
description = "Paper",
|
||||
wield_scale = {x = 1, y = 1, z = 0.25},
|
||||
inventory_image = "default_paper.png",
|
||||
})
|
||||
|
||||
local function book_on_use(itemstack, user, pointed_thing)
|
||||
local function book_on_use(itemstack, user)
|
||||
local player_name = user:get_player_name()
|
||||
local data = minetest.deserialize(itemstack:get_metadata())
|
||||
local title, text, owner = "", "", player_name
|
||||
local formspec, title, text, owner = "", "", "", player_name
|
||||
local page, page_max, cpp = 1, 1, 650
|
||||
|
||||
if data then
|
||||
title, text, owner = data.title, data.text, data.owner
|
||||
title = data.title
|
||||
text = data.text
|
||||
owner = data.owner
|
||||
|
||||
if data.page then
|
||||
page = data.page
|
||||
page_max = data.page_max
|
||||
cpp = data.chars_per_page
|
||||
end
|
||||
end
|
||||
local formspec
|
||||
|
||||
if owner == player_name then
|
||||
formspec = "size[8,8]"..default.gui_bg..
|
||||
"field[0.5,1;7.5,0;title;Title:;"..
|
||||
minetest.formspec_escape(title).."]"..
|
||||
"textarea[0.5,1.5;7.5,7;text;Contents:;"..
|
||||
minetest.formspec_escape(text).."]"..
|
||||
formspec = "size[8,8]" .. default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
"field[0.5,1;7.5,0;title;Title:;" ..
|
||||
minetest.formspec_escape(title) .. "]" ..
|
||||
"textarea[0.5,1.5;7.5,7;text;Contents:;" ..
|
||||
minetest.formspec_escape(text) .. "]" ..
|
||||
"button_exit[2.5,7.5;3,1;save;Save]"
|
||||
else
|
||||
formspec = "size[8,8]"..default.gui_bg..
|
||||
"label[0.5,0.5;by "..owner.."]"..
|
||||
"label[0.5,0;"..minetest.formspec_escape(title).."]"..
|
||||
"tableoptions[background=#00000000;highlight=#00000000;border=false]"..
|
||||
"table[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text):gsub("\n", ",")..";1]"
|
||||
formspec = "size[8,8]" .. default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
"label[0.5,0.5;by " .. owner .. "]" ..
|
||||
"tablecolumns[color;text]" ..
|
||||
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
|
||||
"table[0.4,0;7,0.5;title;#FFFF00," .. minetest.formspec_escape(title) .. "]" ..
|
||||
"textarea[0.5,1.5;7.5,7;;" .. minetest.formspec_escape(text:sub(
|
||||
(cpp * page) - cpp, cpp * page)) .. ";]" ..
|
||||
"button[2.4,7.6;0.8,0.8;book_prev;<]" ..
|
||||
"label[3.2,7.7;Page " .. page .. " of " .. page_max .. "]" ..
|
||||
"button[4.9,7.6;0.8,0.8;book_next;>]"
|
||||
end
|
||||
minetest.show_formspec(user:get_player_name(), "default:book", formspec)
|
||||
|
||||
minetest.show_formspec(player_name, "default:book", formspec)
|
||||
end
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, form_name, fields)
|
||||
if form_name ~= "default:book" or not fields.save or
|
||||
fields.title == "" or fields.text == "" then
|
||||
return
|
||||
end
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname ~= "default:book" then return end
|
||||
local inv = player:get_inventory()
|
||||
local stack = player:get_wielded_item()
|
||||
local new_stack, data
|
||||
if stack:get_name() ~= "default:book_written" then
|
||||
local count = stack:get_count()
|
||||
if count == 1 then
|
||||
stack:set_name("default:book_written")
|
||||
|
||||
if fields.save and fields.title ~= "" and fields.text ~= "" then
|
||||
local new_stack, data
|
||||
if stack:get_name() ~= "default:book_written" then
|
||||
local count = stack:get_count()
|
||||
if count == 1 then
|
||||
stack:set_name("default:book_written")
|
||||
else
|
||||
stack:set_count(count - 1)
|
||||
new_stack = ItemStack("default:book_written")
|
||||
end
|
||||
else
|
||||
stack:set_count(count - 1)
|
||||
new_stack = ItemStack("default:book_written")
|
||||
data = minetest.deserialize(stack:get_metadata())
|
||||
end
|
||||
else
|
||||
data = minetest.deserialize(stack:get_metadata())
|
||||
end
|
||||
if not data then data = {} end
|
||||
data.title = fields.title
|
||||
data.text = fields.text
|
||||
data.owner = player:get_player_name()
|
||||
local data_str = minetest.serialize(data)
|
||||
if new_stack then
|
||||
new_stack:set_metadata(data_str)
|
||||
if inv:room_for_item("main", new_stack) then
|
||||
inv:add_item("main", new_stack)
|
||||
|
||||
if not data then data = {} end
|
||||
data.title = fields.title
|
||||
data.text = fields.text
|
||||
data.text_len = fields.text:len()
|
||||
data.page = 1
|
||||
data.chars_per_page = 650
|
||||
data.page_max = math.ceil(data.text_len / data.chars_per_page)
|
||||
data.owner = player:get_player_name()
|
||||
local data_str = minetest.serialize(data)
|
||||
|
||||
if new_stack then
|
||||
new_stack:set_metadata(data_str)
|
||||
if inv:room_for_item("main", new_stack) then
|
||||
inv:add_item("main", new_stack)
|
||||
else
|
||||
minetest.add_item(player:getpos(), new_stack)
|
||||
end
|
||||
else
|
||||
minetest.add_item(player:getpos(), new_stack)
|
||||
stack:set_metadata(data_str)
|
||||
end
|
||||
else
|
||||
|
||||
player:set_wielded_item(stack)
|
||||
|
||||
elseif fields.book_next or fields.book_prev then
|
||||
local data = minetest.deserialize(stack:get_metadata())
|
||||
if not data.page then return end
|
||||
|
||||
if fields.book_next then
|
||||
data.page = data.page + 1
|
||||
if data.page > data.page_max then
|
||||
data.page = 1
|
||||
end
|
||||
else
|
||||
data.page = data.page - 1
|
||||
if data.page == 0 then
|
||||
data.page = data.page_max
|
||||
end
|
||||
end
|
||||
|
||||
local data_str = minetest.serialize(data)
|
||||
stack:set_metadata(data_str)
|
||||
book_on_use(stack, player)
|
||||
end
|
||||
player:set_wielded_item(stack)
|
||||
end)
|
||||
|
||||
minetest.register_craftitem("default:book", {
|
||||
description = "Book",
|
||||
inventory_image = "default_book.png",
|
||||
groups = {book=1},
|
||||
groups = {book = 1},
|
||||
on_use = book_on_use,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:book_written", {
|
||||
description = "Book With Text",
|
||||
inventory_image = "default_book_written.png",
|
||||
groups = {book=1, not_in_creative_inventory=1},
|
||||
groups = {book = 1, not_in_creative_inventory = 1},
|
||||
stack_max = 1,
|
||||
on_use = book_on_use,
|
||||
})
|
||||
|
@ -94,7 +137,7 @@ minetest.register_craftitem("default:book_written", {
|
|||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "default:book_written",
|
||||
recipe = { "default:book", "default:book_written" }
|
||||
recipe = {"default:book", "default:book_written"}
|
||||
})
|
||||
|
||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
|
@ -123,23 +166,18 @@ end)
|
|||
|
||||
minetest.register_craftitem("default:coal_lump", {
|
||||
description = "Coal Lump",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_coal_lump.png",
|
||||
groups = {coal = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:iron_lump", {
|
||||
description = "Iron Lump",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_iron_lump.png",
|
||||
groups = {ingot_lump = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:copper_lump", {
|
||||
description = "Copper Lump",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_copper_lump.png",
|
||||
groups = {ingot_lump = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:mese_crystal", {
|
||||
|
@ -149,9 +187,7 @@ minetest.register_craftitem("default:mese_crystal", {
|
|||
|
||||
minetest.register_craftitem("default:gold_lump", {
|
||||
description = "Gold Lump",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_gold_lump.png",
|
||||
groups = {ingot_lump = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:diamond", {
|
||||
|
@ -162,34 +198,29 @@ minetest.register_craftitem("default:diamond", {
|
|||
minetest.register_craftitem("default:clay_lump", {
|
||||
description = "Clay Lump",
|
||||
stack_max = 200,
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_clay_lump.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:steel_ingot", {
|
||||
description = "Steel Ingot",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_steel_ingot.png",
|
||||
groups = {ingot = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:copper_ingot", {
|
||||
description = "Copper Ingot",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_copper_ingot.png",
|
||||
groups = {ingot = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:bronze_ingot", {
|
||||
description = "Bronze Ingot",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_bronze_ingot.png",
|
||||
groups = {ingot = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:gold_ingot", {
|
||||
description = "Gold Ingot",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
groups = {ingot = 1},
|
||||
inventory_image = "default_gold_ingot.png"
|
||||
})
|
||||
|
@ -201,7 +232,6 @@ minetest.register_craftitem("default:mese_crystal_fragment", {
|
|||
|
||||
minetest.register_craftitem("default:clay_brick", {
|
||||
description = "Clay Brick",
|
||||
wield_scale = {x = 1, y = 1, z = 2},
|
||||
inventory_image = "default_clay_brick.png",
|
||||
})
|
||||
|
||||
|
@ -214,3 +244,9 @@ minetest.register_craftitem("default:obsidian_shard", {
|
|||
description = "Obsidian Shard",
|
||||
inventory_image = "default_obsidian_shard.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:flint", {
|
||||
description = "Flint",
|
||||
inventory_image = "default_flint.png"
|
||||
})
|
||||
|
||||
|
|
|
@ -7,40 +7,20 @@
|
|||
function default.node_sound_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_hard_footstep", gain = 0.6}
|
||||
table.dig = table.dig or
|
||||
{name = "default_hard_footstep", gain = 0.7}
|
||||
{name = "", gain = 1.0}
|
||||
table.dug = table.dug or
|
||||
{name = "default_hard_footstep", gain = 0.8}
|
||||
{name = "default_dug_node", gain = 0.25}
|
||||
table.place = table.place or
|
||||
{name = "default_hard_footstep", gain = 0.8}
|
||||
{name = "default_place_node_hard", gain = 1.0}
|
||||
return table
|
||||
end
|
||||
|
||||
function default.node_sound_stone_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_hard_footstep", gain = 0.6}
|
||||
table.dig = table.dig or
|
||||
{name = "default_hard_footstep", gain = 0.7}
|
||||
{name = "default_hard_footstep", gain = 0.5}
|
||||
table.dug = table.dug or
|
||||
{name = "default_hard_footstep", gain = 0.8}
|
||||
table.place = table.place or
|
||||
{name = "default_hard_footstep", gain = 0.8}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
||||
function default.node_sound_metal_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_metal_footstep", gain = 0.575}
|
||||
table.dig = table.dig or
|
||||
{name = "default_metal_footstep", gain = 0.65}
|
||||
table.dug = table.dug or
|
||||
{name = "default_metal_footstep", gain = 0.8}
|
||||
table.place = table.place or
|
||||
{name = "default_metal_footstep", gain = 0.8}
|
||||
{name = "default_hard_footstep", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
@ -48,27 +28,11 @@ end
|
|||
function default.node_sound_dirt_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_dirt_footstep", gain = 0.8}
|
||||
table.dig = table.dig or
|
||||
{name = "default_dirt_footstep", gain = 0.9}
|
||||
{name = "default_dirt_footstep", gain = 1.0}
|
||||
table.dug = table.dug or
|
||||
{name = "default_dirt_footstep", gain = 1.0}
|
||||
{name = "default_dirt_footstep", gain = 1.5}
|
||||
table.place = table.place or
|
||||
{name = "default_dirt_footstep", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
||||
function default.node_sound_gravel_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_dirt_footstep", gain = 0.8}
|
||||
table.dig = table.dig or
|
||||
{name = "default_dirt_footstep", gain = 0.9}
|
||||
table.dug = table.dug or
|
||||
{name = "default_dirt_footstep", gain = 1.0}
|
||||
table.place = table.place or
|
||||
{name = "default_dirt_footstep", gain = 1.0}
|
||||
{name = "default_place_node", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
@ -76,13 +40,11 @@ end
|
|||
function default.node_sound_sand_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_sand_footstep", gain = 0.6}
|
||||
table.dig = table.dig or
|
||||
{name = "default_sand_footstep", gain = 0.7}
|
||||
{name = "default_sand_footstep", gain = 0.12}
|
||||
table.dug = table.dug or
|
||||
{name = "default_sand_footstep", gain = 0.8}
|
||||
{name = "default_sand_footstep", gain = 0.24}
|
||||
table.place = table.place or
|
||||
{name = "default_sand_footstep", gain = 0.8}
|
||||
{name = "default_place_node", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
@ -90,13 +52,9 @@ end
|
|||
function default.node_sound_wood_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_wood_footstep", gain = 0.625}
|
||||
table.dig = table.dig or
|
||||
{name = "default_wood_footstep", gain = 0.7}
|
||||
{name = "default_wood_footstep", gain = 0.5}
|
||||
table.dug = table.dug or
|
||||
{name = "default_wood_footstep", gain = 0.8}
|
||||
table.place = table.place or
|
||||
{name = "default_wood_footstep", gain = 0.8}
|
||||
{name = "default_wood_footstep", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
@ -104,13 +62,13 @@ end
|
|||
function default.node_sound_leaves_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_grass_footstep", gain = 0.6}
|
||||
table.dig = table.dig or
|
||||
{name = "default_grass_footstep", gain = 0.7}
|
||||
{name = "default_grass_footstep", gain = 0.35}
|
||||
table.dug = table.dug or
|
||||
{name = "default_snow_footstep", gain = 0.8}
|
||||
{name = "default_grass_footstep", gain = 0.7}
|
||||
table.dig = table.dig or
|
||||
{name = "default_dig_crumbly", gain = 0.4}
|
||||
table.place = table.place or
|
||||
{name = "default_snow_footstep", gain = 0.8}
|
||||
{name = "default_place_node", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
@ -118,13 +76,9 @@ end
|
|||
function default.node_sound_glass_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_hard_footstep", gain = 0.55}
|
||||
table.dig = table.dig or
|
||||
{name = "default_hard_footstep", gain = 0.65}
|
||||
{name = "default_glass_footstep", gain = 0.5}
|
||||
table.dug = table.dug or
|
||||
{name = "default_break_glass", gain = 0.8}
|
||||
table.place = table.place or
|
||||
{name = "default_hard_footstep", gain = 0.75}
|
||||
{name = "default_break_glass", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
@ -134,67 +88,24 @@ end
|
|||
-- Lavacooling
|
||||
--
|
||||
|
||||
local function cool_wf_vm(pos, node1, node2)
|
||||
local t1 = os.clock()
|
||||
local minp = vector.subtract(pos, 10)
|
||||
local maxp = vector.add(pos, 10)
|
||||
local manip = minetest.get_voxel_manip()
|
||||
local emerged_pos1, emerged_pos2 = manip:read_from_map(minp, maxp)
|
||||
local area = VoxelArea:new({MinEdge=emerged_pos1, MaxEdge=emerged_pos2})
|
||||
local nodes = manip:get_data()
|
||||
|
||||
local stone = minetest.get_content_id(node2)
|
||||
local lava = minetest.get_content_id(node1)
|
||||
|
||||
for i in area:iterp(minp, maxp) do
|
||||
local p = area:position(i)
|
||||
if nodes[i] == lava and minetest.find_node_near(p, 1, {"group:water"}) then
|
||||
nodes[i] = stone
|
||||
end
|
||||
default.cool_lava = function(pos, node)
|
||||
if node.name == "default:lava_source" then
|
||||
minetest.set_node(pos, {name = "default:obsidian"})
|
||||
else -- Lava flowing
|
||||
minetest.set_node(pos, {name = "default:stone"})
|
||||
end
|
||||
|
||||
manip:set_data(nodes)
|
||||
manip:write_to_map()
|
||||
-- minetest.log("action", "Lava cooling happened at (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ").")
|
||||
local t1 = os.clock()
|
||||
manip:update_map()
|
||||
-- minetest.log("action", string.format("Lava cooling updated the map after ca. %.2fs.", os.clock() - t1))
|
||||
end
|
||||
|
||||
local del1 = 0
|
||||
local count = 0
|
||||
|
||||
default.cool_lava_source = function(pos)
|
||||
minetest.set_node(pos, {name = "default:obsidian"})
|
||||
minetest.sound_play("default_cool_lava",
|
||||
{pos = pos, max_hear_distance = 16, gain = 0.25})
|
||||
end
|
||||
|
||||
default.cool_lava_flowing = function(pos)
|
||||
minetest.set_node(pos, {name = "default:stone"})
|
||||
minetest.sound_play("default_cool_lava",
|
||||
{pos = pos, max_hear_distance = 16, gain = 0.25})
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:lava_flowing"},
|
||||
nodenames = {"default:lava_source", "default:lava_flowing"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 1,
|
||||
chance = 2,
|
||||
chance = 1,
|
||||
catch_up = false,
|
||||
action = function(...)
|
||||
default.cool_lava_flowing(...)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:lava_source"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 1,
|
||||
chance = 2,
|
||||
catch_up = false,
|
||||
action = function(...)
|
||||
default.cool_lava_source(...)
|
||||
default.cool_lava(...)
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -254,8 +165,8 @@ end
|
|||
minetest.register_abm({
|
||||
nodenames = {"default:cactus"},
|
||||
neighbors = {"group:sand", "default:dirt_with_dry_grass"}, --MFF
|
||||
interval = 60,
|
||||
chance = 25,
|
||||
interval = 12,
|
||||
chance = 83,
|
||||
action = function(...)
|
||||
default.grow_cactus(...)
|
||||
end
|
||||
|
@ -264,8 +175,8 @@ minetest.register_abm({
|
|||
minetest.register_abm({
|
||||
nodenames = {"default:papyrus"},
|
||||
neighbors = {"default:dirt", "default:dirt_with_grass", "default:sand", "default:desert_sand"}, --MFF
|
||||
interval = 60,
|
||||
chance = 25,
|
||||
interval = 14,
|
||||
chance = 71,
|
||||
action = function(...)
|
||||
default.grow_papyrus(...)
|
||||
end
|
||||
|
@ -286,6 +197,62 @@ function default.dig_up(pos, node, digger)
|
|||
end
|
||||
|
||||
|
||||
--
|
||||
-- Fence registration helper
|
||||
--
|
||||
function default.register_fence(name, def)
|
||||
minetest.register_craft({
|
||||
output = name .. " 4",
|
||||
recipe = {
|
||||
{ def.material, 'group:stick', def.material },
|
||||
{ def.material, 'group:stick', def.material },
|
||||
}
|
||||
})
|
||||
|
||||
local fence_texture = "default_fence_overlay.png^" .. def.texture ..
|
||||
"^default_fence_overlay.png^[makealpha:255,126,126"
|
||||
-- Allow almost everything to be overridden
|
||||
local default_fields = {
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "connected",
|
||||
fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}},
|
||||
-- connect_top =
|
||||
-- connect_bottom =
|
||||
connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
|
||||
{-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
|
||||
connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
|
||||
{-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
|
||||
connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
|
||||
{-1/16,-5/16,1/8,1/16,-3/16,1/2}},
|
||||
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
|
||||
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
|
||||
},
|
||||
connects_to = {"group:fence", "group:wood", "group:tree"},
|
||||
inventory_image = fence_texture,
|
||||
wield_image = fence_texture,
|
||||
tiles = {def.texture},
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {},
|
||||
}
|
||||
for k, v in pairs(default_fields) do
|
||||
if not def[k] then
|
||||
def[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
-- Always add to the fence group, even if no group provided
|
||||
def.groups.fence = 1
|
||||
|
||||
def.texture = nil
|
||||
def.material = nil
|
||||
|
||||
minetest.register_node(name, def)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Leafdecay
|
||||
--
|
||||
|
@ -302,17 +269,19 @@ minetest.register_globalstep(function(dtime)
|
|||
end)
|
||||
|
||||
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
|
||||
local node = minetest.get_node(pos)
|
||||
node.param2 = 1
|
||||
minetest.set_node(pos, node)
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
local node = minetest.get_node(pos)
|
||||
node.param2 = 1
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:leafdecay"},
|
||||
neighbors = {"air", "group:liquid"},
|
||||
-- A low interval and a high inverse chance spreads the load
|
||||
interval = 1,
|
||||
chance = 2,
|
||||
interval = 2,
|
||||
chance = 5,
|
||||
|
||||
action = function(p0, node, _, _)
|
||||
--print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")")
|
||||
|
@ -399,14 +368,15 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
|
|||
end)
|
||||
|
||||
--
|
||||
-- Grass growing
|
||||
-- Grass growing on well-lit dirt
|
||||
--
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:dirt"},
|
||||
neighbors = {"air"},
|
||||
interval = 6,
|
||||
chance = 67,
|
||||
catch_up = false,
|
||||
interval = 30,
|
||||
chance = 5,
|
||||
action = function(pos, node)
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local name = minetest.get_node(above).name
|
||||
|
@ -431,8 +401,8 @@ minetest.register_abm({
|
|||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
|
||||
interval = 2,
|
||||
chance = 20,
|
||||
interval = 8,
|
||||
chance = 50,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
|
@ -454,7 +424,7 @@ minetest.register_abm({
|
|||
minetest.register_abm({
|
||||
nodenames = {"default:cobble"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 17,
|
||||
interval = 16,
|
||||
chance = 200,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
--
|
||||
|
||||
local function active_formspec(fuel_percent, item_percent)
|
||||
local formspec =
|
||||
local formspec =
|
||||
"size[8,8.5]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
|
@ -90,6 +90,137 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player
|
|||
return stack:get_count()
|
||||
end
|
||||
|
||||
local function swap_node(pos, name)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == name then
|
||||
return
|
||||
end
|
||||
node.name = name
|
||||
minetest.swap_node(pos, node)
|
||||
end
|
||||
|
||||
local function furnace_node_timer(pos, elapsed)
|
||||
--
|
||||
-- Inizialize metadata
|
||||
--
|
||||
local meta = minetest.get_meta(pos)
|
||||
local fuel_time = meta:get_float("fuel_time") or 0
|
||||
local src_time = meta:get_float("src_time") or 0
|
||||
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
|
||||
|
||||
local inv = meta:get_inventory()
|
||||
local srclist = inv:get_list("src")
|
||||
local fuellist = inv:get_list("fuel")
|
||||
local dstlist = inv:get_list("dst")
|
||||
|
||||
--
|
||||
-- Cooking
|
||||
--
|
||||
|
||||
-- Check if we have cookable content
|
||||
local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||
local cookable = true
|
||||
|
||||
if cooked.time == 0 then
|
||||
cookable = false
|
||||
end
|
||||
|
||||
-- Check if we have enough fuel to burn
|
||||
if fuel_time < fuel_totaltime then
|
||||
-- The furnace is currently active and has enough fuel
|
||||
fuel_time = fuel_time + 1
|
||||
|
||||
-- If there is a cookable item then check if it is ready yet
|
||||
if cookable then
|
||||
src_time = src_time + 1
|
||||
if src_time >= cooked.time then
|
||||
-- Place result in dst list if possible
|
||||
if inv:room_for_item("dst", cooked.item) then
|
||||
inv:add_item("dst", cooked.item)
|
||||
inv:set_stack("src", 1, aftercooked.items[1])
|
||||
src_time = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- Furnace ran out of fuel
|
||||
if cookable then
|
||||
-- We need to get new fuel
|
||||
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
|
||||
|
||||
if fuel.time == 0 then
|
||||
-- No valid fuel in fuel list
|
||||
fuel_totaltime = 0
|
||||
fuel_time = 0
|
||||
src_time = 0
|
||||
else
|
||||
-- Take fuel from fuel list
|
||||
inv:set_stack("fuel", 1, afterfuel.items[1])
|
||||
|
||||
fuel_totaltime = fuel.time
|
||||
fuel_time = 0
|
||||
end
|
||||
else
|
||||
-- We don't need to get new fuel since there is no cookable item
|
||||
fuel_totaltime = 0
|
||||
fuel_time = 0
|
||||
src_time = 0
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Update formspec, infotext and node
|
||||
--
|
||||
local formspec = inactive_formspec
|
||||
local item_state = ""
|
||||
local item_percent = 0
|
||||
if cookable then
|
||||
item_percent = math.floor(src_time / cooked.time * 100)
|
||||
item_state = item_percent .. "%"
|
||||
else
|
||||
if srclist[1]:is_empty() then
|
||||
item_state = "Empty"
|
||||
else
|
||||
item_state = "Not cookable"
|
||||
end
|
||||
end
|
||||
|
||||
local fuel_state = "Empty"
|
||||
local active = "inactive "
|
||||
local result = false
|
||||
|
||||
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
|
||||
active = "active "
|
||||
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
|
||||
fuel_state = fuel_percent .. "%"
|
||||
formspec = active_formspec(fuel_percent, item_percent)
|
||||
swap_node(pos, "default:furnace_active")
|
||||
-- make sure timer restarts automatically
|
||||
result = true
|
||||
else
|
||||
if not fuellist[1]:is_empty() then
|
||||
fuel_state = "0%"
|
||||
end
|
||||
swap_node(pos, "default:furnace")
|
||||
-- stop timer on the inactive furnace
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:stop()
|
||||
end
|
||||
|
||||
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
|
||||
|
||||
--
|
||||
-- Set meta values
|
||||
--
|
||||
meta:set_float("fuel_totaltime", fuel_totaltime)
|
||||
meta:set_float("fuel_time", fuel_time)
|
||||
meta:set_float("src_time", src_time)
|
||||
meta:set_string("formspec", formspec)
|
||||
meta:set_string("infotext", infotext)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Node definitions
|
||||
--
|
||||
|
@ -109,6 +240,27 @@ minetest.register_node("default:furnace", {
|
|||
|
||||
can_dig = can_dig,
|
||||
|
||||
on_timer = furnace_node_timer,
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", inactive_formspec)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size('src', 1)
|
||||
inv:set_size('fuel', 1)
|
||||
inv:set_size('dst', 4)
|
||||
end,
|
||||
|
||||
on_metadata_inventory_move = function(pos)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(1.0)
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos)
|
||||
-- start timer function, it will sort out whether furnace can burn or not.
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(1.0)
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||
allow_metadata_inventory_take = allow_metadata_inventory_take,
|
||||
|
@ -138,6 +290,7 @@ minetest.register_node("default:furnace_active", {
|
|||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_timer = furnace_node_timer,
|
||||
|
||||
can_dig = can_dig,
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ default.LIGHT_MAX = 14
|
|||
-- GUI related stuff
|
||||
default.gui_bg = "bgcolor[#080808BB;true]"
|
||||
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
|
||||
default.gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]"
|
||||
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
|
||||
|
||||
function default.get_hotbar_bg(x,y)
|
||||
local out = ""
|
||||
|
@ -31,8 +31,10 @@ default.gui_survival_form = "size[8,8.5]"..
|
|||
"list[current_player;main;0,5.5;8,3;8]"..
|
||||
"list[current_player;craft;1.75,0.5;3,3;]"..
|
||||
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
|
||||
default.get_hotbar_bg(0,4.25)..
|
||||
default.get_hotbar_bg(0,5.25)
|
||||
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_player;craft]"..
|
||||
default.get_hotbar_bg(0,4.25)
|
||||
|
||||
-- Load files
|
||||
dofile(minetest.get_modpath("default").."/functions.lua")
|
||||
|
|
|
@ -31,10 +31,6 @@ minetest.register_alias("mapgen_pine_needles", "default:pine_needles")
|
|||
|
||||
-- Dungeons
|
||||
|
||||
minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron")
|
||||
minetest.register_alias("mapgen_mese", "default:mese")
|
||||
minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal")
|
||||
minetest.register_alias("mapgen_clay", "default:clay")
|
||||
minetest.register_alias("mapgen_cobble", "default:cobble")
|
||||
minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
|
||||
minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
|
||||
|
@ -53,22 +49,22 @@ function default.register_ores()
|
|||
|
||||
-- Clay
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "blob",
|
||||
ore = "default:clay",
|
||||
wherein = {"default:sand"},
|
||||
clust_scarcity = 24 * 24 * 24,
|
||||
clust_size = 7,
|
||||
y_min = -15,
|
||||
y_max = 0,
|
||||
noise_treshold = 0.0,
|
||||
noise_params = {
|
||||
offset = 0.35,
|
||||
minetest.register_ore({
|
||||
ore_type = "blob",
|
||||
ore = "default:clay",
|
||||
wherein = {"default:sand"},
|
||||
clust_scarcity = 24 * 24 * 24,
|
||||
clust_size = 7,
|
||||
y_min = -15,
|
||||
y_max = 0,
|
||||
noise_threshold = 0.0,
|
||||
noise_params = {
|
||||
offset = 0.5,
|
||||
scale = 0.2,
|
||||
spread = {x = 5, y = 5, z = 5},
|
||||
seed = -316,
|
||||
octaves = 1,
|
||||
persist = 0.5
|
||||
persist = 0.0
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -79,18 +75,18 @@ function default.register_ores()
|
|||
ore = "default:sand",
|
||||
wherein = {"default:stone", "default:sandstone",
|
||||
"default:desert_stone"},
|
||||
clust_scarcity = 24 * 24 * 24,
|
||||
clust_size = 7,
|
||||
y_min = -63,
|
||||
y_max = 4,
|
||||
noise_treshold = 0,
|
||||
noise_params = {
|
||||
offset = 0.35,
|
||||
clust_scarcity = 24 * 24 * 24,
|
||||
clust_size = 7,
|
||||
y_min = -63,
|
||||
y_max = 4,
|
||||
noise_threshold = 0.0,
|
||||
noise_params = {
|
||||
offset = 0.5,
|
||||
scale = 0.2,
|
||||
spread = {x = 5, y = 5, z = 5},
|
||||
seed = 2316,
|
||||
octaves = 1,
|
||||
persist = 0.5
|
||||
persist = 0.0
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -100,18 +96,18 @@ function default.register_ores()
|
|||
ore_type = "blob",
|
||||
ore = "default:dirt",
|
||||
wherein = {"default:stone", "default:sandstone"},
|
||||
clust_scarcity = 24 * 24 * 24,
|
||||
clust_size = 7,
|
||||
y_min = -63,
|
||||
y_max = 31000,
|
||||
noise_treshold = 0,
|
||||
noise_params = {
|
||||
offset = 0.35,
|
||||
clust_scarcity = 24 * 24 * 24,
|
||||
clust_size = 7,
|
||||
y_min = -63,
|
||||
y_max = 31000,
|
||||
noise_threshold = 0.0,
|
||||
noise_params = {
|
||||
offset = 0.5,
|
||||
scale = 0.2,
|
||||
spread = {x = 5, y = 5, z = 5},
|
||||
seed = 17676,
|
||||
octaves = 1,
|
||||
persist = 0.5
|
||||
persist = 0.0
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -121,18 +117,18 @@ function default.register_ores()
|
|||
ore_type = "blob",
|
||||
ore = "default:gravel",
|
||||
wherein = {"default:stone"},
|
||||
clust_scarcity = 24 * 24 * 24,
|
||||
clust_size = 7,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
noise_treshold = 0,
|
||||
noise_params = {
|
||||
offset = 0.35,
|
||||
clust_scarcity = 24 * 24 * 24,
|
||||
clust_size = 7,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
noise_threshold = 0.0,
|
||||
noise_params = {
|
||||
offset = 0.5,
|
||||
scale = 0.2,
|
||||
spread = {x = 5, y = 5, z = 5},
|
||||
seed = 766,
|
||||
octaves = 1,
|
||||
persist = 0.5
|
||||
persist = 0.0
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -203,8 +199,8 @@ function default.register_ores()
|
|||
clust_scarcity = 9 * 9 * 9,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 3,
|
||||
y_min = -63,
|
||||
y_max = -16,
|
||||
y_min = -63,
|
||||
y_max = -16,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -216,7 +212,6 @@ function default.register_ores()
|
|||
clust_size = 3,
|
||||
y_min = -30000,
|
||||
y_max = -64,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -228,7 +223,6 @@ function default.register_ores()
|
|||
clust_size = 6,
|
||||
y_min = -30000,
|
||||
y_max = -64,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -253,7 +247,6 @@ function default.register_ores()
|
|||
clust_size = 2,
|
||||
y_min = -255,
|
||||
y_max = -128,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -265,7 +258,6 @@ function default.register_ores()
|
|||
clust_size = 3,
|
||||
y_min = -1024,
|
||||
y_max = -256,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -277,7 +269,6 @@ function default.register_ores()
|
|||
clust_size = 2,
|
||||
y_min = -30000,
|
||||
y_max = -1024,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -342,7 +333,6 @@ function default.register_ores()
|
|||
clust_size = 2,
|
||||
y_min = -255,
|
||||
y_max = -64,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -354,7 +344,6 @@ function default.register_ores()
|
|||
clust_size = 3,
|
||||
y_min = -30000,
|
||||
y_max = -256,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
-- Diamond
|
||||
|
@ -368,7 +357,6 @@ function default.register_ores()
|
|||
clust_size = 3,
|
||||
y_min = -512,
|
||||
y_max = -256,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -380,7 +368,6 @@ function default.register_ores()
|
|||
clust_size = 3,
|
||||
y_min = -30000,
|
||||
y_max = -512,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -427,7 +414,6 @@ function default.register_ores()
|
|||
clust_size = 3,
|
||||
y_min = -30000,
|
||||
y_max = -64,
|
||||
flags = "absheight",
|
||||
})
|
||||
|
||||
-- Gold Coins
|
||||
|
@ -468,44 +454,6 @@ function default.register_ores()
|
|||
y_max = 64,
|
||||
})
|
||||
|
||||
if minetest.setting_get("mg_name") == "indev" then
|
||||
-- Floatlands and high mountains springs:
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:water_source",
|
||||
ore_param2 = 128,
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 40 *40 *40,
|
||||
clust_num_ores = 8,
|
||||
clust_size = 3,
|
||||
y_min = 100,
|
||||
y_max = 30000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:lava_source",
|
||||
ore_param2 = 128,
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 50 * 50 * 50,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 2,
|
||||
y_min = 10000,
|
||||
y_max = 30000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:sand",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = 20 * 20 * 20,
|
||||
clust_num_ores = 5 * 5 * 3,
|
||||
clust_size = 5,
|
||||
y_min = 500,
|
||||
y_max = 30000,
|
||||
})
|
||||
end
|
||||
|
||||
-- Underground springs:
|
||||
|
||||
minetest.register_ore({
|
||||
|
@ -1165,10 +1113,6 @@ function default.register_biomes()
|
|||
y_max = -113,
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
node_underwater = "default:sand",
|
||||
height_shore = 3,
|
||||
node_shore_filler = "default:sand",
|
||||
node_shore_top = "default:sand",
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -1200,7 +1144,7 @@ function default.register_mgv6_decorations()
|
|||
y_max = 1,
|
||||
decoration = "default:papyrus",
|
||||
height = 2,
|
||||
y_max = 4,
|
||||
height_max = 4,
|
||||
spawn_by = "default:water_source",
|
||||
num_spawn_by = 1,
|
||||
})
|
||||
|
@ -1223,7 +1167,7 @@ function default.register_mgv6_decorations()
|
|||
y_max = 30,
|
||||
decoration = "default:cactus",
|
||||
height = 3,
|
||||
y_max = 4,
|
||||
height_max = 4,
|
||||
})
|
||||
|
||||
-- Long grasses
|
||||
|
@ -1339,8 +1283,8 @@ function default.register_decorations()
|
|||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0.04,
|
||||
scale = 0.02,
|
||||
offset = 0.036,
|
||||
scale = 0.022,
|
||||
spread = {x = 250, y = 250, z = 250},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
|
@ -1358,8 +1302,8 @@ function default.register_decorations()
|
|||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0.002,
|
||||
scale = 0.001,
|
||||
offset = 0.0018,
|
||||
scale = 0.0011,
|
||||
spread = {x = 250, y = 250, z = 250},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
|
@ -1369,17 +1313,17 @@ function default.register_decorations()
|
|||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = {
|
||||
size = { x = 3, y = 3, z = 1},
|
||||
size = {x = 3, y = 3, z = 1},
|
||||
data = {
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "default:tree", param2 = 12, prob = 191 },
|
||||
{ name = "default:tree", param2 = 12 },
|
||||
{ name = "default:tree", param2 = 12, prob = 127 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "flowers:mushroom_brown", prob = 63 },
|
||||
{ name = "air", prob = 0 },
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "default:tree", param2 = 12, prob = 191},
|
||||
{name = "default:tree", param2 = 12},
|
||||
{name = "default:tree", param2 = 12, prob = 127},
|
||||
{name = "air", prob = 0},
|
||||
{name = "flowers:mushroom_brown", prob = 63},
|
||||
{name = "air", prob = 0},
|
||||
},
|
||||
},
|
||||
flags = "place_center_x",
|
||||
|
@ -1392,7 +1336,7 @@ function default.register_decorations()
|
|||
deco_type = "schematic",
|
||||
place_on = {"default:dirt_with_grass", "default:dirt"},
|
||||
sidelen = 80,
|
||||
fill_ratio = 0.09,
|
||||
fill_ratio = 0.1,
|
||||
biomes = {"rainforest", "rainforest_swamp"},
|
||||
y_min = 0,
|
||||
y_max = 31000,
|
||||
|
@ -1405,22 +1349,22 @@ function default.register_decorations()
|
|||
deco_type = "schematic",
|
||||
place_on = {"default:dirt_with_grass", "default:dirt"},
|
||||
sidelen = 80,
|
||||
fill_ratio = 0.01,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {"rainforest", "rainforest_swamp"},
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = {
|
||||
size = { x = 3, y = 3, z = 1},
|
||||
size = {x = 3, y = 3, z = 1},
|
||||
data = {
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "default:jungletree", param2 = 12, prob = 191 },
|
||||
{ name = "default:jungletree", param2 = 12 },
|
||||
{ name = "default:jungletree", param2 = 12, prob = 127 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "flowers:mushroom_brown", prob = 127 },
|
||||
{ name = "air", prob = 0 },
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "default:jungletree", param2 = 12, prob = 191},
|
||||
{name = "default:jungletree", param2 = 12},
|
||||
{name = "default:jungletree", param2 = 12, prob = 127},
|
||||
{name = "air", prob = 0},
|
||||
{name = "flowers:mushroom_brown", prob = 127},
|
||||
{name = "air", prob = 0},
|
||||
},
|
||||
},
|
||||
flags = "place_center_x",
|
||||
|
@ -1434,8 +1378,8 @@ function default.register_decorations()
|
|||
place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0.04,
|
||||
scale = 0.02,
|
||||
offset = 0.036,
|
||||
scale = 0.022,
|
||||
spread = {x = 250, y = 250, z = 250},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
|
@ -1452,22 +1396,29 @@ function default.register_decorations()
|
|||
deco_type = "schematic",
|
||||
place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
|
||||
sidelen = 80,
|
||||
fill_ratio = 0.003,
|
||||
noise_params = {
|
||||
offset = 0.0018,
|
||||
scale = 0.0011,
|
||||
spread = {x = 250, y = 250, z = 250},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
persist = 0.66
|
||||
},
|
||||
biomes = {"taiga", "coniferous_forest"},
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = {
|
||||
size = { x = 3, y = 3, z = 1},
|
||||
size = {x = 3, y = 3, z = 1},
|
||||
data = {
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "default:pine_tree", param2 = 12, prob = 191 },
|
||||
{ name = "default:pine_tree", param2 = 12 },
|
||||
{ name = "default:pine_tree", param2 = 12, prob = 127 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "flowers:mushroom_red", prob = 63 },
|
||||
{ name = "air", prob = 0 },
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "default:pine_tree", param2 = 12, prob = 191},
|
||||
{name = "default:pine_tree", param2 = 12},
|
||||
{name = "default:pine_tree", param2 = 12, prob = 127},
|
||||
{name = "air", prob = 0},
|
||||
{name = "flowers:mushroom_red", prob = 63},
|
||||
{name = "air", prob = 0},
|
||||
},
|
||||
},
|
||||
flags = "place_center_x",
|
||||
|
@ -1512,14 +1463,14 @@ function default.register_decorations()
|
|||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = {
|
||||
size = { x = 3, y = 2, z = 1},
|
||||
size = {x = 3, y = 2, z = 1},
|
||||
data = {
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "default:acacia_tree", param2 = 12, prob = 191 },
|
||||
{ name = "default:acacia_tree", param2 = 12 },
|
||||
{ name = "default:acacia_tree", param2 = 12, prob = 127 },
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "default:acacia_tree", param2 = 12, prob = 191},
|
||||
{name = "default:acacia_tree", param2 = 12},
|
||||
{name = "default:acacia_tree", param2 = 12, prob = 127},
|
||||
},
|
||||
},
|
||||
flags = "place_center_x",
|
||||
|
@ -1533,8 +1484,8 @@ function default.register_decorations()
|
|||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0.01,
|
||||
scale = -0.02,
|
||||
offset = 0.0,
|
||||
scale = -0.015,
|
||||
spread = {x = 250, y = 250, z = 250},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
|
@ -1545,7 +1496,6 @@ function default.register_decorations()
|
|||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("default").."/schematics/aspen_tree.mts",
|
||||
flags = "place_center_x, place_center_z",
|
||||
rotation = "random",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
|
@ -1553,8 +1503,8 @@ function default.register_decorations()
|
|||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0.0005,
|
||||
scale = -0.001,
|
||||
offset = 0.0,
|
||||
scale = -0.0008,
|
||||
spread = {x = 250, y = 250, z = 250},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
|
@ -1564,17 +1514,17 @@ function default.register_decorations()
|
|||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = {
|
||||
size = { x = 3, y = 3, z = 1},
|
||||
size = {x = 3, y = 3, z = 1},
|
||||
data = {
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "air", prob = 0 },
|
||||
{ name = "default:aspen_tree", param2 = 12 },
|
||||
{ name = "default:aspen_tree", param2 = 12 },
|
||||
{ name = "default:aspen_tree", param2 = 12, prob = 127 },
|
||||
{ name = "flowers:mushroom_red", prob = 63 },
|
||||
{ name = "flowers:mushroom_brown", prob = 63 },
|
||||
{ name = "air", prob = 0 },
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "air", prob = 0},
|
||||
{name = "default:aspen_tree", param2 = 12},
|
||||
{name = "default:aspen_tree", param2 = 12},
|
||||
{name = "default:aspen_tree", param2 = 12, prob = 127},
|
||||
{name = "flowers:mushroom_red", prob = 63},
|
||||
{name = "flowers:mushroom_brown", prob = 63},
|
||||
{name = "air", prob = 0},
|
||||
},
|
||||
},
|
||||
flags = "place_center_x",
|
||||
|
@ -1621,7 +1571,7 @@ function default.register_decorations()
|
|||
y_max = 31000,
|
||||
decoration = "default:cactus",
|
||||
height = 2,
|
||||
y_max = 5,
|
||||
height_max = 5,
|
||||
})
|
||||
|
||||
-- Papyrus
|
||||
|
@ -1735,12 +1685,12 @@ function default.generate_nyancats(minp, maxp, seed)
|
|||
local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1)
|
||||
local pr = PseudoRandom(seed + 9324342)
|
||||
local max_num_nyancats = math.floor(volume / (16 * 16 * 16))
|
||||
for i = 1,max_num_nyancats do
|
||||
for i = 1, max_num_nyancats do
|
||||
if pr:next(0, 1000) == 0 then
|
||||
local x0 = pr:next(minp.x, maxp.x)
|
||||
local y0 = pr:next(minp.y, maxp.y)
|
||||
local z0 = pr:next(minp.z, maxp.z)
|
||||
local p0 = { x =x0, y = y0, z = z0}
|
||||
local p0 = {x = x0, y = y0, z = z0}
|
||||
default.make_nyancat(p0, pr:next(0, 3), pr:next(10, 15))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -95,7 +95,7 @@ minetest.register_on_joinplayer(function(player)
|
|||
default.player_attached[player:get_player_name()] = false
|
||||
default.player_set_model(player, "character.b3d")
|
||||
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
|
||||
|
||||
|
||||
-- set GUI
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
player:set_inventory_formspec(default.gui_survival_form)
|
||||
|
|
BIN
minetestforfun_game/mods/default/schematics/acacia_tree.mts
Executable file → Normal file
BIN
minetestforfun_game/mods/default/schematics/apple_tree.mts
Executable file → Normal file
BIN
minetestforfun_game/mods/default/schematics/large_cactus.mts
Executable file → Normal file
BIN
minetestforfun_game/mods/default/schematics/pine_tree.mts
Executable file → Normal file
Before Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 232 B |
After Width: | Height: | Size: 450 B |
After Width: | Height: | Size: 231 B |
After Width: | Height: | Size: 233 B |
BIN
minetestforfun_game/mods/default/textures/default_fence_wood.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
minetestforfun_game/mods/default/textures/default_flint.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 827 B |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 409 B |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 467 B |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 12 KiB |
BIN
minetestforfun_game/mods/default/textures/default_sign_steel.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.3 KiB |
BIN
minetestforfun_game/mods/default/textures/default_sign_wood.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 5.4 KiB |
|
@ -5,7 +5,6 @@ minetest.register_item(":", {
|
|||
type = "none",
|
||||
wield_image = "wieldhand.png",
|
||||
wield_scale = {x=1,y=1,z=2.5},
|
||||
range = 5,
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.8,
|
||||
max_drop_level = 0,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
local random = math.random
|
||||
|
||||
--
|
||||
-- Grow trees from saplings
|
||||
--
|
||||
|
||||
-- 'Can grow' function
|
||||
|
||||
local random = math.random
|
||||
-- 'can grow' function
|
||||
|
||||
function default.can_grow(pos)
|
||||
local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||
|
@ -16,22 +16,55 @@ function default.can_grow(pos)
|
|||
if is_soil == 0 then
|
||||
return false
|
||||
end
|
||||
local ll = minetest.get_node_light(pos)
|
||||
if not ll or ll < 13 then -- Minimum light level for growth
|
||||
return false -- matches grass, wheat and cotton
|
||||
local light_level = minetest.get_node_light(pos)
|
||||
if not light_level or light_level < 13 then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
-- 'is snow nearby' function
|
||||
|
||||
local function is_snow_nearby(pos)
|
||||
local x, y, z = pos.x, pos.y, pos.z
|
||||
local c_snow = minetest.get_content_id("default:snow")
|
||||
local c_snowblock = minetest.get_content_id("default:snowblock")
|
||||
local c_dirtsnow = minetest.get_content_id("default:dirt_with_snow")
|
||||
|
||||
local vm = minetest.get_voxel_manip()
|
||||
local minp, maxp = vm:read_from_map(
|
||||
{x = x - 1, y = y - 1, z = z - 1},
|
||||
{x = x + 1, y = y + 1, z = z + 1}
|
||||
)
|
||||
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
|
||||
local data = vm:get_data()
|
||||
|
||||
for yy = y - 1, y + 1 do
|
||||
for zz = z - 1, z + 1 do
|
||||
local vi = a:index(x - 1, yy, zz)
|
||||
for xx = x - 1, x + 1 do
|
||||
local nodid = data[vi]
|
||||
if nodid == c_snow or nodid == c_snowblock or nodid == c_dirtsnow then
|
||||
return true
|
||||
end
|
||||
vi = vi + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
-- Sapling ABM
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:sapling", "default:junglesapling",
|
||||
"default:pine_sapling", "default:acacia_sapling",
|
||||
"default:aspen_sapling"},
|
||||
interval = 5,
|
||||
chance = 40,
|
||||
interval = 10,
|
||||
chance = 50,
|
||||
action = function(pos, node)
|
||||
if not default.can_grow(pos) then
|
||||
return
|
||||
|
@ -57,8 +90,11 @@ minetest.register_abm({
|
|||
elseif node.name == "default:pine_sapling" then
|
||||
minetest.log("action", "A pine sapling grows into a tree at "..
|
||||
minetest.pos_to_string(pos))
|
||||
local snow = is_snow_nearby(pos)
|
||||
if mapgen == "v6" then
|
||||
default.grow_pine_tree(pos)
|
||||
default.grow_pine_tree(pos, snow)
|
||||
elseif snow then
|
||||
default.grow_new_snowy_pine_tree(pos)
|
||||
else
|
||||
default.grow_new_pine_tree(pos)
|
||||
end
|
||||
|
@ -199,7 +235,8 @@ function default.grow_jungle_tree(pos, bad)
|
|||
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
|
||||
local data = vm:get_data()
|
||||
|
||||
add_trunk_and_leaves(data, a, pos, c_jungletree, c_jungleleaves, height, 3, 30, false)
|
||||
add_trunk_and_leaves(data, a, pos, c_jungletree, c_jungleleaves,
|
||||
height, 3, 30, false)
|
||||
|
||||
-- Roots
|
||||
for z_dist = -1, 1 do
|
||||
|
@ -240,7 +277,7 @@ local function add_snow(data, vi, c_air, c_ignore, c_snow)
|
|||
end
|
||||
end
|
||||
|
||||
function default.grow_pine_tree(pos)
|
||||
function default.grow_pine_tree(pos, snow)
|
||||
local x, y, z = pos.x, pos.y, pos.z
|
||||
local maxy = y + random(9, 13) -- Trunk top
|
||||
|
||||
|
@ -249,32 +286,15 @@ function default.grow_pine_tree(pos)
|
|||
local c_pine_tree = minetest.get_content_id("default:pine_tree")
|
||||
local c_pine_needles = minetest.get_content_id("default:pine_needles")
|
||||
local c_snow = minetest.get_content_id("default:snow")
|
||||
local c_snowblock = minetest.get_content_id("default:snowblock")
|
||||
local c_dirtsnow = minetest.get_content_id("default:dirt_with_snow")
|
||||
|
||||
local vm = minetest.get_voxel_manip()
|
||||
local minp, maxp = vm:read_from_map(
|
||||
{x = x - 3, y = y - 1, z = z - 3},
|
||||
{x = x - 3, y = y, z = z - 3},
|
||||
{x = x + 3, y = maxy + 3, z = z + 3}
|
||||
)
|
||||
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
|
||||
local data = vm:get_data()
|
||||
|
||||
-- Scan for snow nodes near sapling to enable snow on branches
|
||||
local snow = false
|
||||
for yy = y - 1, y + 1 do
|
||||
for zz = z - 1, z + 1 do
|
||||
local vi = a:index(x - 1, yy, zz)
|
||||
for xx = x - 1, x + 1 do
|
||||
local nodid = data[vi]
|
||||
if nodid == c_snow or nodid == c_snowblock or nodid == c_dirtsnow then
|
||||
snow = true
|
||||
end
|
||||
vi = vi + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Upper branches layer
|
||||
local dev = 3
|
||||
for yy = maxy - 1, maxy + 1 do
|
||||
|
@ -350,7 +370,8 @@ function default.grow_pine_tree(pos)
|
|||
end
|
||||
|
||||
-- Trunk
|
||||
data[a:index(x, y, z)] = c_pine_tree -- Force-place lowest trunk node to replace sapling
|
||||
-- Force-place lowest trunk node to replace sapling
|
||||
data[a:index(x, y, z)] = c_pine_tree
|
||||
for yy = y + 1, maxy do
|
||||
local vi = a:index(x, yy, z)
|
||||
local node_id = data[vi]
|
||||
|
@ -365,47 +386,63 @@ function default.grow_pine_tree(pos)
|
|||
vm:update_map()
|
||||
end
|
||||
|
||||
|
||||
-- New apple tree
|
||||
|
||||
function default.grow_new_apple_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/apple_tree_from_sapling.mts"
|
||||
local path = minetest.get_modpath("default") ..
|
||||
"/schematics/apple_tree_from_sapling.mts"
|
||||
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
path, 0, nil, false)
|
||||
path, "0", nil, false)
|
||||
end
|
||||
|
||||
|
||||
-- New jungle tree
|
||||
|
||||
function default.grow_new_jungle_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree_from_sapling.mts"
|
||||
local path = minetest.get_modpath("default") ..
|
||||
"/schematics/jungle_tree_from_sapling.mts"
|
||||
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
path, 0, nil, false)
|
||||
path, "random", nil, false)
|
||||
end
|
||||
|
||||
|
||||
-- New pine tree
|
||||
|
||||
function default.grow_new_pine_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/pine_tree_from_sapling.mts"
|
||||
local path = minetest.get_modpath("default") ..
|
||||
"/schematics/pine_tree_from_sapling.mts"
|
||||
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
path, 0, nil, false)
|
||||
path, "0", nil, false)
|
||||
end
|
||||
|
||||
|
||||
-- New snowy pine tree
|
||||
|
||||
function default.grow_new_snowy_pine_tree(pos)
|
||||
local path = minetest.get_modpath("default") ..
|
||||
"/schematics/snowy_pine_tree_from_sapling.mts"
|
||||
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
path, "random", nil, false)
|
||||
end
|
||||
|
||||
|
||||
-- New acacia tree
|
||||
|
||||
function default.grow_new_acacia_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/acacia_tree_from_sapling.mts"
|
||||
local path = minetest.get_modpath("default") ..
|
||||
"/schematics/acacia_tree_from_sapling.mts"
|
||||
minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
|
||||
path, random, nil, false)
|
||||
path, "random", nil, false)
|
||||
end
|
||||
|
||||
-- New aspen tree
|
||||
|
||||
function default.grow_new_aspen_tree(pos)
|
||||
local path = minetest.get_modpath("default") .. "/schematics/aspen_tree_from_sapling.mts"
|
||||
local path = minetest.get_modpath("default") ..
|
||||
"/schematics/aspen_tree_from_sapling.mts"
|
||||
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
|
||||
path, 0, nil, false)
|
||||
path, "0", nil, false)
|
||||
end
|
||||
|
||||
-- From BFD:
|
||||
|
|
|
@ -1,40 +1,59 @@
|
|||
-- minetest/dye/init.lua
|
||||
|
||||
-- Other mods can use these for looping through available colors
|
||||
|
||||
dye = {}
|
||||
dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"}
|
||||
dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"}
|
||||
dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow",
|
||||
"lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"}
|
||||
|
||||
-- Local stuff
|
||||
local dyelocal = {}
|
||||
-- Make dye names and descriptions available globally
|
||||
|
||||
-- This collection of colors is partly a historic thing, partly something else.
|
||||
dyelocal.dyes = {
|
||||
{"white", "White dye", {dye=1, basecolor_white=1, excolor_white=1, unicolor_white=1}, true},
|
||||
{"grey", "Grey dye", {dye=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1}},
|
||||
{"dark_grey", "Dark grey dye", {dye=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}},
|
||||
{"black", "Black dye", {dye=1, basecolor_black=1, excolor_black=1, unicolor_black=1}},
|
||||
{"violet", "Violet dye", {dye=1, basecolor_magenta=1, excolor_violet=1, unicolor_violet=1}, true},
|
||||
{"blue", "Blue dye", {dye=1, basecolor_blue=1, excolor_blue=1, unicolor_blue=1}, true},
|
||||
{"cyan", "Cyan dye", {dye=1, basecolor_cyan=1, excolor_cyan=1, unicolor_cyan=1}},
|
||||
{"dark_green", "Dark green dye",{dye=1, basecolor_green=1, excolor_green=1, unicolor_dark_green=1}},
|
||||
{"green", "Green dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_green=1}},
|
||||
{"yellow", "Yellow dye", {dye=1, basecolor_yellow=1, excolor_yellow=1, unicolor_yellow=1}, true},
|
||||
{"brown", "Brown dye", {dye=1, basecolor_brown=1, excolor_orange=1, unicolor_dark_orange=1}},
|
||||
{"orange", "Orange dye", {dye=1, basecolor_orange=1, excolor_orange=1, unicolor_orange=1}, true},
|
||||
{"red", "Red dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_red=1}, true},
|
||||
{"magenta", "Magenta dye", {dye=1, basecolor_magenta=1, excolor_red_violet=1,unicolor_red_violet=1}},
|
||||
{"pink", "Pink dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_light_red=1}},
|
||||
dye.dyes = {
|
||||
{"white", "White"},
|
||||
{"grey", "Grey"},
|
||||
{"dark_grey", "Dark grey"},
|
||||
{"black", "Black"},
|
||||
{"violet", "Violet"},
|
||||
{"blue", "Blue"},
|
||||
{"cyan", "Cyan"},
|
||||
{"dark_green", "Dark green"},
|
||||
{"green", "Green"},
|
||||
{"yellow", "Yellow"},
|
||||
{"brown", "Brown"},
|
||||
{"orange", "Orange"},
|
||||
{"red", "Red"},
|
||||
{"magenta", "Magenta"},
|
||||
{"pink", "Pink"},
|
||||
}
|
||||
|
||||
-- This collection of colors is partly a historic thing, partly something else
|
||||
|
||||
local dyes = {
|
||||
{"white", "White dye", {dye=1, basecolor_white=1, excolor_white=1, unicolor_white=1}, true},
|
||||
{"grey", "Grey dye", {dye=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1}},
|
||||
{"dark_grey", "Dark grey dye", {dye=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}},
|
||||
{"black", "Black dye", {dye=1, basecolor_black=1, excolor_black=1, unicolor_black=1}},
|
||||
{"violet", "Violet dye", {dye=1, basecolor_magenta=1, excolor_violet=1, unicolor_violet=1}, true},
|
||||
{"blue", "Blue dye", {dye=1, basecolor_blue=1, excolor_blue=1, unicolor_blue=1}, true},
|
||||
{"cyan", "Cyan dye", {dye=1, basecolor_cyan=1, excolor_cyan=1, unicolor_cyan=1}},
|
||||
{"dark_green", "Dark green dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_dark_green=1}},
|
||||
{"green", "Green dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_green=1}},
|
||||
{"yellow", "Yellow dye", {dye=1, basecolor_yellow=1, excolor_yellow=1, unicolor_yellow=1}, true},
|
||||
{"brown", "Brown dye", {dye=1, basecolor_brown=1, excolor_orange=1, unicolor_dark_orange=1}},
|
||||
{"orange", "Orange dye", {dye=1, basecolor_orange=1, excolor_orange=1, unicolor_orange=1}, true},
|
||||
{"red", "Red dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_red=1}, true},
|
||||
{"magenta", "Magenta dye", {dye=1, basecolor_magenta=1, excolor_red_violet=1, unicolor_red_violet=1}},
|
||||
{"pink", "Pink dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_light_red=1}},
|
||||
}
|
||||
|
||||
-- Define items
|
||||
for _, row in ipairs(dyelocal.dyes) do
|
||||
|
||||
for _, row in ipairs(dyes) do
|
||||
local name = row[1]
|
||||
local description = row[2]
|
||||
local groups = row[3]
|
||||
local flower = row[4]
|
||||
local item_name = "dye:"..name
|
||||
local item_image = "dye_"..name..".png"
|
||||
local item_name = "dye:" .. name
|
||||
local item_image = "dye_" .. name .. ".png"
|
||||
minetest.register_craftitem(item_name, {
|
||||
inventory_image = item_image,
|
||||
description = description,
|
||||
|
@ -42,14 +61,15 @@ for _, row in ipairs(dyelocal.dyes) do
|
|||
})
|
||||
if flower then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = item_name.." 4",
|
||||
recipe = {"group:flower,color_"..name},
|
||||
type = "shapeless",
|
||||
output = item_name .. " 4",
|
||||
recipe = {"group:flower,color_" .. name},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- manually add coal->black dye
|
||||
-- Manually add coal->black dye
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:black 4",
|
||||
|
@ -59,35 +79,34 @@ minetest.register_craft({
|
|||
-- Mix recipes
|
||||
-- Just mix everything to everything somehow sanely
|
||||
|
||||
dyelocal.mixbases = {"magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white", "light_grey"}
|
||||
local mixbases = {"pink", "magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white", "light_grey"}
|
||||
|
||||
dyelocal.mixes = {
|
||||
-- magenta, red, orange, brown, yellow, green, dark_green, cyan, blue, violet, black, dark_grey, grey, white, light_grey
|
||||
white = {"pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet", "grey", "grey", "light_grey", "white", "white"},
|
||||
grey = {"pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "pink", "dark_grey", "grey", "grey"},
|
||||
dark_grey = {"brown", "brown", "brown", "brown", "brown", "dark_green", "dark_green", "blue", "blue", "violet", "black", "black"},
|
||||
black = {"black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black"},
|
||||
violet= {"magenta", "magenta", "red", "brown", "red", "cyan", "brown", "blue", "violet", "violet"},
|
||||
blue = {"violet", "magenta", "brown", "brown", "dark_green", "cyan", "cyan", "cyan", "blue"},
|
||||
cyan = {"blue", "brown", "dark_green", "dark_grey", "green", "cyan", "dark_green", "cyan"},
|
||||
dark_green = {"brown", "brown", "brown", "brown", "green", "green", "dark_green"},
|
||||
green = {"brown", "yellow", "yellow", "dark_green", "green", "green"},
|
||||
yellow= {"red", "orange", "yellow", "orange", "yellow"},
|
||||
brown = {"brown", "brown", "orange", "brown"},
|
||||
orange= {"red", "orange", "orange"},
|
||||
red = {"magenta", "red"},
|
||||
magenta = {"magenta"},
|
||||
local mixes = {
|
||||
-- pink, magenta, red, orange, brown, yellow, green, dark_green, cyan, blue, violet, black, dark_grey, grey, white, light_grey
|
||||
white = {"pink", "pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet","grey", "grey", "grey","white", "white"},
|
||||
grey = {"pink", "pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet","dark_grey","grey", "grey"},
|
||||
dark_grey = {"brown", "brown", "brown", "brown", "brown", "brown", "dark_green","dark_green","blue", "blue", "violet","black", "dark_grey"},
|
||||
black = {"black", "black", "black", "black", "black", "black", "black", "black", "black","black", "black", "black"},
|
||||
violet = {"magenta","magenta","magenta","red", "brown", "red", "cyan", "brown", "blue", "violet","violet"},
|
||||
blue = {"violet", "violet", "magenta","brown", "brown", "dark_green","cyan", "cyan", "cyan", "blue"},
|
||||
cyan = {"brown", "blue", "brown", "dark_green","dark_grey", "green", "cyan", "dark_green","cyan"},
|
||||
dark_green = {"brown", "brown", "brown", "brown", "brown", "green", "green", "dark_green"},
|
||||
green = {"yellow", "brown", "yellow", "yellow", "dark_green","green", "green"},
|
||||
yellow = {"orange", "red", "orange", "yellow", "orange", "yellow"},
|
||||
brown = {"brown", "brown", "brown", "orange", "brown"},
|
||||
orange = {"orange", "red", "orange", "orange"},
|
||||
red = {"pink", "magenta","red"},
|
||||
magenta = {"magenta","magenta"},
|
||||
pink = {"pink"},
|
||||
}
|
||||
|
||||
minetest.after(1, function()
|
||||
for one,results in pairs(dyelocal.mixes) do
|
||||
for i,result in ipairs(results) do
|
||||
local another = dyelocal.mixbases[i]
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'dye:'..result..' 2',
|
||||
recipe = {'dye:'..one, 'dye:'..another},
|
||||
})
|
||||
end
|
||||
for one, results in pairs(mixes) do
|
||||
for i, result in ipairs(results) do
|
||||
local another = mixbases[i]
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'dye:' .. result .. ' 2',
|
||||
recipe = {'dye:' .. one, 'dye:' .. another},
|
||||
})
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -30,3 +30,7 @@ fire_large.ogg sampled from:
|
|||
|
||||
fire_basic_flame_animated.png:
|
||||
Muadtralk
|
||||
|
||||
fire_flint_steel.png
|
||||
Gambit (WTFPL)
|
||||
|
||||
|
|
|
@ -5,25 +5,30 @@
|
|||
fire = {}
|
||||
|
||||
|
||||
-- Register flame node
|
||||
-- Register flame nodes
|
||||
|
||||
minetest.register_node("fire:basic_flame", {
|
||||
description = "Fire",
|
||||
drawtype = "firelike",
|
||||
tiles = {{
|
||||
name = "fire_basic_flame_animated.png",
|
||||
animation = {type = "vertical_frames",
|
||||
aspect_w = 16, aspect_h = 16, length = 1},
|
||||
}},
|
||||
tiles = {
|
||||
{
|
||||
name = "fire_basic_flame_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 1
|
||||
},
|
||||
},
|
||||
},
|
||||
inventory_image = "fire_basic_flame.png",
|
||||
paramtype = "light",
|
||||
light_source = 14,
|
||||
groups = {igniter = 2, dig_immediate = 3, hot = 3},
|
||||
drop = '',
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
damage_per_second = 4,
|
||||
groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1},
|
||||
drop = "",
|
||||
|
||||
on_construct = function(pos)
|
||||
minetest.after(0, fire.on_flame_add_at, pos)
|
||||
|
@ -33,9 +38,70 @@ minetest.register_node("fire:basic_flame", {
|
|||
minetest.after(0, fire.on_flame_remove_at, pos)
|
||||
end,
|
||||
|
||||
on_blast = function() end, -- unaffected by explosions
|
||||
on_blast = function()
|
||||
end, -- unaffected by explosions
|
||||
})
|
||||
|
||||
minetest.register_node("fire:permanent_flame", {
|
||||
description = "Permanent Flame",
|
||||
drawtype = "firelike",
|
||||
tiles = {
|
||||
{
|
||||
name = "fire_basic_flame_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 1
|
||||
},
|
||||
},
|
||||
},
|
||||
inventory_image = "fire_basic_flame.png",
|
||||
paramtype = "light",
|
||||
light_source = 14,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
damage_per_second = 4,
|
||||
groups = {igniter = 2, dig_immediate = 3},
|
||||
drop = "",
|
||||
|
||||
on_blast = function()
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_tool("fire:flint_and_steel", {
|
||||
description = "Flint and Steel",
|
||||
inventory_image = "fire_flint_steel.png",
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
local player_name = user:get_player_name()
|
||||
local pt = pointed_thing
|
||||
|
||||
if pt.type == "node" and minetest.get_node(pt.above).name == "air" then
|
||||
itemstack:add_wear(1000)
|
||||
local node_under = minetest.get_node(pt.under).name
|
||||
|
||||
if minetest.get_item_group(node_under, "flammable") >= 1 then
|
||||
if not minetest.is_protected(pt.above, player_name) then
|
||||
minetest.set_node(pt.above, {name = "fire:basic_flame"})
|
||||
else
|
||||
minetest.chat_send_player(player_name, "This area is protected")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "fire:flint_and_steel",
|
||||
recipe = {
|
||||
{"default:flint", "default:steel_ingot"}
|
||||
}
|
||||
})
|
||||
|
||||
-- Get sound area of position
|
||||
|
||||
|
@ -135,7 +201,7 @@ minetest.register_abm({
|
|||
nodenames = {"fire:basic_flame", "fire:permanent_flame"},
|
||||
neighbors = {"group:puts_out_fire"},
|
||||
interval = 3,
|
||||
chance = 2,
|
||||
chance = 1,
|
||||
catch_up = false,
|
||||
action = function(p0, node, _, _)
|
||||
minetest.remove_node(p0)
|
||||
|
@ -149,12 +215,12 @@ minetest.register_abm({
|
|||
|
||||
if minetest.setting_getbool("disable_fire") then
|
||||
|
||||
-- Extinguish flames quickly with dedicated ABM
|
||||
-- Remove basic flames only
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"fire:basic_flame"},
|
||||
interval = 3,
|
||||
chance = 2,
|
||||
interval = 7,
|
||||
chance = 1,
|
||||
catch_up = false,
|
||||
action = function(p0, node, _, _)
|
||||
minetest.remove_node(p0)
|
||||
|
@ -177,13 +243,13 @@ else
|
|||
end,
|
||||
})
|
||||
|
||||
-- Ignite neighboring nodes
|
||||
-- Ignite neighboring nodes, add basic flames
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:flammable"},
|
||||
neighbors = {"group:igniter"},
|
||||
interval = 7,
|
||||
chance = 16,
|
||||
chance = 12,
|
||||
catch_up = false,
|
||||
action = function(p0, node, _, _)
|
||||
-- If there is water or stuff like that around node, don't ignite
|
||||
|
@ -197,23 +263,27 @@ else
|
|||
end,
|
||||
})
|
||||
|
||||
-- Remove flames and flammable nodes
|
||||
-- Remove basic flames and flammable nodes
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"fire:basic_flame"},
|
||||
interval = 5,
|
||||
chance = 16,
|
||||
chance = 6,
|
||||
catch_up = false,
|
||||
action = function(p0, node, _, _)
|
||||
-- If there are no flammable nodes around flame, remove flame
|
||||
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
|
||||
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
|
||||
if not p then
|
||||
minetest.remove_node(p0)
|
||||
return
|
||||
end
|
||||
if math.random(1, 4) == 1 then
|
||||
-- remove flammable nodes around flame
|
||||
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
|
||||
if p then
|
||||
local node = minetest.get_node(p)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if def.on_burn then
|
||||
def.on_burn(p)
|
||||
else
|
||||
minetest.remove_node(p)
|
||||
nodeupdate(p)
|
||||
end
|
||||
|
|
BIN
minetestforfun_game/mods/fire/textures/fire_flint_steel.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
|
@ -99,8 +99,8 @@ minetest.register_node("flowers:lily_pad", {
|
|||
minetest.register_abm({
|
||||
nodenames = {"group:flora"},
|
||||
neighbors = {"default:dirt_with_grass", "default:desert_sand"},
|
||||
interval = 2,
|
||||
chance = 500,
|
||||
interval = 13,
|
||||
chance = 96,
|
||||
action = function(pos, node)
|
||||
pos.y = pos.y - 1
|
||||
local under = minetest.get_node(pos)
|
||||
|
@ -241,6 +241,7 @@ minetest.register_node("flowers:waterlily", {
|
|||
liquids_pointable = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
groups = {snappy = 3, flower = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
node_box = {
|
||||
|
@ -252,14 +253,11 @@ minetest.register_node("flowers:waterlily", {
|
|||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
|
||||
},
|
||||
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
local find_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1},
|
||||
{x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:water_source")
|
||||
local find_river_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1},
|
||||
{x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:river_water_source")
|
||||
if #find_water ~= 0 then
|
||||
minetest.set_node(pos, {name = "default:water_source"})
|
||||
pos.y = pos.y + 1
|
||||
on_place = function(_, _, pointed_thing)
|
||||
local pos = pointed_thing.above
|
||||
local node = minetest.get_node(pointed_thing.under).name
|
||||
local def = minetest.registered_nodes[node]
|
||||
if def and def.liquidtype == "source" and minetest.get_item_group(node, "water") > 0 then
|
||||
minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)})
|
||||
elseif #find_river_water ~= 0 then
|
||||
minetest.set_node(pos, {name = "default:river_water_source"})
|
||||
|
|
|
@ -216,7 +216,7 @@ minetest.register_decoration({
|
|||
|
||||
-- Mods using singlenode mapgen can call these functions to enable
|
||||
-- the use of minetest.generate_ores or minetest.generate_decorations
|
||||
-- Enable in mapgen v6 only
|
||||
|
||||
local mg_params = minetest.get_mapgen_params()
|
||||
if mg_params.mgname == "v6" then
|
||||
flowers.register_mgv6_decorations()
|
||||
|
|
|
@ -22,7 +22,7 @@ local USES = 200
|
|||
local USES_perfect = 10000
|
||||
|
||||
-- Handles rotation
|
||||
local function screwdriver_handler(itemstack, user, pointed_thing, mode)
|
||||
screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
@ -37,7 +37,7 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode)
|
|||
local node = minetest.get_node(pos)
|
||||
local ndef = minetest.registered_nodes[node.name]
|
||||
-- verify node is facedir (expected to be rotatable)
|
||||
if ndef.paramtype2 ~= "facedir" then
|
||||
if not ndef or ndef.paramtype2 ~= "facedir" then
|
||||
return
|
||||
end
|
||||
-- Compute param2
|
||||
|
@ -91,12 +91,12 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode)
|
|||
return itemstack
|
||||
end
|
||||
|
||||
-- Screwdriver (en steel à 200 utilisation)
|
||||
-- Screwdriver
|
||||
minetest.register_tool("screwdriver:screwdriver", {
|
||||
description = "Screwdriver (left-click rotates face, right-click rotates axis)",
|
||||
inventory_image = "screwdriver.png",
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
screwdriver_handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE)
|
||||
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 200)
|
||||
return itemstack
|
||||
end,
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
|
@ -110,11 +110,11 @@ minetest.register_tool("screwdriver:screwdriver_perfect", {
|
|||
description = "Perfect Screwdriver (left-click rotates face, right-click rotates axis)",
|
||||
inventory_image = "screwdriver_perfect.png",
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
screwdriver_handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE)
|
||||
screwdriver_handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 10000)
|
||||
return itemstack
|
||||
end,
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
screwdriver_handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS)
|
||||
screwdriver_handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS, 10000)
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -172,7 +172,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
|||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
-- Upside down slabs
|
||||
if p0.y - 1 == p1.y then
|
||||
-- Turn into full block if pointing at a existing slab
|
||||
|
@ -233,7 +233,7 @@ end
|
|||
if replace then
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:slabs_replace"},
|
||||
interval = 8,
|
||||
interval = 16,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
node.name = minetest.registered_nodes[node.name].replace_name
|
||||
|
@ -344,7 +344,7 @@ stairs.register_stair_and_slab("sandstone", "default:sandstone",
|
|||
"Sandstone Stair",
|
||||
"Sandstone Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick",
|
||||
{crumbly = 2, cracky = 2},
|
||||
{"default_sandstone_brick.png"},
|
||||
|
|
|
@ -24,54 +24,29 @@ minetest.register_node("vessels:shelf", {
|
|||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", vessels_shelf_formspec)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("vessels", 8*2)
|
||||
inv:set_size("vessels", 8 * 2)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
return inv:is_empty("vessels")
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local to_stack = inv:get_stack(listname, index)
|
||||
if listname == "vessels" then
|
||||
if minetest.get_item_group(stack:get_name(), "vessel") ~= 0
|
||||
and to_stack:is_empty() then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
end
|
||||
if minetest.get_item_group(stack:get_name(), "vessel") ~= 0 then
|
||||
return stack:get_count()
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local stack = inv:get_stack(from_list, from_index)
|
||||
local to_stack = inv:get_stack(to_list, to_index)
|
||||
if to_list == "vessels" then
|
||||
if minetest.get_item_group(stack:get_name(), "vessel") ~= 0
|
||||
and to_stack:is_empty() then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves stuff in vessels shelf at "..minetest.pos_to_string(pos))
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves stuff in vessels shelf at ".. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" moves stuff to vessels shelf at "..minetest.pos_to_string(pos))
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves stuff to vessels shelf at ".. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
" takes stuff from vessels shelf at "..minetest.pos_to_string(pos))
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes stuff from vessels shelf at ".. minetest.pos_to_string(pos))
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
1
minetestforfun_game/mods/walls/depends.txt
Normal file
|
@ -0,0 +1 @@
|
|||
default
|
61
minetestforfun_game/mods/walls/init.lua
Normal file
|
@ -0,0 +1,61 @@
|
|||
|
||||
--[[
|
||||
|
||||
Walls mod for Minetest
|
||||
|
||||
Copyright (C) 2015 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
This program is free software. It comes without any warranty, to
|
||||
the extent permitted by applicable law. You can redistribute it
|
||||
and/or modify it under the terms of the Do What The Fuck You Want
|
||||
To Public License, Version 2, as published by Sam Hocevar. See
|
||||
http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
|
||||
--]]
|
||||
|
||||
walls = {}
|
||||
|
||||
walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sounds)
|
||||
-- inventory node, and pole-type wall start item
|
||||
minetest.register_node(wall_name, {
|
||||
description = wall_desc,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "connected",
|
||||
fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}},
|
||||
-- connect_bottom =
|
||||
connect_front = {{-3/16, -1/2, -1/2, 3/16, 3/8, -1/4}},
|
||||
connect_left = {{-1/2, -1/2, -3/16, -1/4, 3/8, 3/16}},
|
||||
connect_back = {{-3/16, -1/2, 1/4, 3/16, 3/8, 1/2}},
|
||||
connect_right = {{ 1/4, -1/2, -3/16, 1/2, 3/8, 3/16}},
|
||||
},
|
||||
connects_to = { "group:wall", "group:stone" },
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
tiles = { wall_texture, },
|
||||
walkable = true,
|
||||
groups = { cracky = 3, wall = 1, stone = 2 },
|
||||
sounds = wall_sounds,
|
||||
})
|
||||
|
||||
-- crafting recipe
|
||||
minetest.register_craft({
|
||||
output = wall_name .. " 6",
|
||||
recipe = {
|
||||
{ '', '', '' },
|
||||
{ wall_mat, wall_mat, wall_mat},
|
||||
{ wall_mat, wall_mat, wall_mat},
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
walls.register("walls:cobble", "Cobblestone Wall", "default_cobble.png",
|
||||
"default:cobble", default.node_sound_stone_defaults())
|
||||
|
||||
walls.register("walls:mossycobble", "Mossy Cobblestone Wall", "default_mossycobble.png",
|
||||
"default:mossycobble", default.node_sound_stone_defaults())
|
||||
|
||||
walls.register("walls:desertcobble", "Desert Cobblestone Wall", "default_desert_cobble.png",
|
||||
"default:desert_cobble", default.node_sound_stone_defaults())
|
||||
|
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 703 B |