Add walls mod (for compatibility only)

This commit is contained in:
MoNTE48 2019-07-08 18:27:09 +02:00
parent f53fb1a1ec
commit 5f3b8c767b
6 changed files with 83 additions and 8 deletions

View File

@ -488,17 +488,17 @@ minetest.register_abm({
local moss_correspondences = {
["default:cobble"] = "default:mossycobble",
["stairs:slab_cobble"] = "stairs:slab_mossycobble",
["stairs:stair_cobble"] = "stairs:stair_mossycobble",
["stairs:slab_default_cobble"] = "stairs:slab_mossycobble",
["stairs:stair_default_cobble"] = "stairs:stair_mossycobble",
["stairs:stair_innerstair_cobble"] = "stairs:stair_innerstair_mossycobble",
["stairs:stair_outerstair_cobble"] = "stairs:stair_outerstair_mossycobble",
-- ["walls:cobble"] = "walls:mossycobble",
["walls:cobble"] = "walls:mossycobble"
}
minetest.register_abm({
label = "Moss growth",
nodenames = {"default:cobble", "stairs:slab_cobble", "stairs:stair_cobble",
nodenames = {"default:cobble", "stairs:slab_default_cobble", "stairs:stair_default_cobble",
"stairs:stair_innerstair_cobble", "stairs:stair_outerstair_cobble",
-- "walls:cobble"
"walls:cobble"
},
neighbors = {"group:water"},
interval = 16,

View File

@ -1,6 +1,6 @@
# Player Effects
## Summary
This is an framework for assigning temporary status effects to players. This mod is aimed to modders and maybe interested people. This framework is a work in progress and not finished.
This is an framework for assigning temporary status effects to players. This mod is aimed to modders and maybe interested people.
## Profile
* Name: Player Effects
@ -65,11 +65,19 @@ Normally you dont need to read or edit fields of this table. Use `playereffec
#### Effect group
An effect group is basically a concept. Any effect type can be member of any number of effect groups. The main point of effect groups is to find effects which affect the same property. For example, an effect which makes you faster and another effect which makes you slower both affect the same property: speed. The group for that then would be the string `"speed"`. See also `examples.lua`, which includes the effects `high_speed` and `low_speed`.
Currently, the main rule of Player Effects requires that there can only be one effect in place. Dont worry, Player Effects already does that job for you. Back to the example: it is possible to be fast and it is possible to be slow. But it is not possible to be fast `and` slow at the same time. Player Effects ensures that by cancelling all conflicting concepts before applying a new one.
Currently, the main rule of Player Effects requires that there can only be one effect in place. Player Effects already does that job for you. Back to the example: it is possible to be fast and it is possible to be slow. But it is not possible to be fast *and* slow at the same time. Player Effects ensures that by cancelling all conflicting concepts before applying a new one.
The concept of groups may be changed or extended in the future.
You can invent effect groups (like the groups in Minetest) on the fly. A group is just a string. Practically, you should use groups which other people use.
The following effect group names have standardized meanings and should solely be used for their intended purpose:
* `speed`: Affects the player speed set by the `speed` value of `set_physics_override`
* `gravity`: Affects the player gravity set by the `gravity` value of `set_physics_override`
* `jump`: Affects the player jump strength set by the `jump` value of `set_physics_override`
* `health`: Affects the player health
* `breath`: Affects the player breath
You can also invent effect groups (like the groups in Minetest) on the fly. A group is just a string. Practically, you should use groups which other people use.
#### Effect (`effect`)
An effect is an current change of a player property (like speed, jump height, and so on). It is the realization of an effect type. All effects are temporary. There are currently two types of effects: Repeating and non-repeating. Non-repeating effects call their `apply` callback once when they are created. Repeating effects call their apply callback multiple times with a specified interval. By default, effects are non-repeating.

View File

@ -0,0 +1,7 @@
Minetest Game mod: walls
========================
See license.txt for license information.
Authors of source code
----------------------
Auke Kok <sofar@foo-projects.org> (LGPLv3.0+)

View File

@ -0,0 +1 @@
default

View File

@ -0,0 +1,45 @@
walls = {}
walls.register = function(wall_name, wall_desc, wall_texture_table, wall_mat, wall_sounds)
--make wall_texture_table paramenter backwards compatible for mods passing single texture
if type(wall_texture_table) ~= "table" then
wall_texture_table = { wall_texture_table }
end
-- 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_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", "group:fence"},
paramtype = "light",
is_ground_content = false,
tiles = wall_texture_table,
walkable = true,
groups = {cracky = 3, wall = 1, stone = 2, not_in_creative_inventory = 1},
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())

View File

@ -0,0 +1,14 @@
License of source code
----------------------
GNU Lesser General Public License, version 3.0
Copyright (C) 2015 Auke Kok <sofar@foo-projects.org>
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software Foundation;
either version 3.0 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details:
http://www.gnu.org/licenses/lgpl-3.0.html