first commit

master
ezhh 2016-12-23 17:46:55 +00:00
commit b6fff5d563
5 changed files with 153 additions and 0 deletions

20
README.md Normal file
View File

@ -0,0 +1,20 @@
abripanes
===
Mod for Minetest by Shara RedCat which adds faintly glowing coloured glass panes.These can be used for stained glass windows or for gentle lighting.
NOTE: This mod is only fully functional from version 0.4.15.
Crafting
---------
Coloured glass panes can be made from six glass nodes and the matching dye.
Licenses and Attribution
-----------------------
Code for this mod is released under MIT (https://opensource.org/licenses/MIT).
Textures for this mod are released under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/), attribution: Shara RedCat.

2
depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
dye

95
init.lua Normal file
View File

@ -0,0 +1,95 @@
function register_pane(name, def)
for i = 1, 15 do
minetest.register_alias("xpanes:" .. name .. "_" .. i, "xpanes:" .. name .. "_flat")
end
local flatgroups = table.copy(def.groups)
flatgroups.pane = 1
minetest.register_node(":xpanes:" .. name .. "_flat", {
description = def.description,
drawtype = "nodebox",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
inventory_image = def.inventory_image,
wield_image = def.wield_image,
paramtype2 = "facedir",
use_texture_alpha = true,
light_source = 4,
tiles = {def.textures[3], def.textures[3], def.textures[1]},
groups = flatgroups,
drop = "xpanes:" .. name .. "_flat",
sounds = def.sounds,
node_box = {
type = "fixed",
fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}},
},
selection_box = {
type = "fixed",
fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}},
},
connect_sides = { "left", "right" },
})
local groups = table.copy(def.groups)
groups.pane = 1
groups.not_in_creative_inventory = 1
minetest.register_node(":xpanes:" .. name, {
drawtype = "nodebox",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 4,
description = def.description,
tiles = {def.textures[3], def.textures[3], def.textures[1]},
groups = groups,
drop = "xpanes:" .. name .. "_flat",
sounds = def.sounds,
node_box = {
type = "connected",
fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}},
connect_front = {{-1/32, -1/2, -1/2, 1/32, 1/2, -1/32}},
connect_left = {{-1/2, -1/2, -1/32, -1/32, 1/2, 1/32}},
connect_back = {{-1/32, -1/2, 1/32, 1/32, 1/2, 1/2}},
connect_right = {{1/32, -1/2, -1/32, 1/2, 1/2, 1/32}},
},
connects_to = {"group:pane", "group:stone", "group:glass", "group:wood", "group:tree"},
})
minetest.register_craft({
output = "xpanes:" .. name .. "_flat 16",
recipe = def.recipe
})
end
local panes_list = {
{"white", "White", "ffffff", }, {"blue", "Blue", "0000FF", },
{"cyan", "Cyan", "00FFFF", }, {"green", "Green", "00FF00", },
{"magenta", "Magenta", "FF00FF", }, {"orange", "Orange", "FF6103", },
{"violet", "Purple", "800080", }, {"red", "Red", "FF0000", },
{"yellow", "Yellow", "FFFF00", },
}
for i in ipairs(panes_list) do
local name = panes_list[i][1]
local description = panes_list[i][2]
local colour = panes_list[i][3]
local tex = "abriglass_plainglass.png^[colorize:#"..colour..":122"
register_pane("abriglass_pane_"..name, {
description = description.." Glass Pane",
textures = {tex, tex, tex},
groups = {cracky = 3},
use_texture_alpha = true,
wield_image = tex,
inventory_image = tex,
sounds = default.node_sound_glass_defaults(),
recipe = {
{"default:glass", "default:glass", "default:glass",},
{"default:glass", "default:glass", "default:glass",},
{"","dye:"..name,"",},
}
})
end

36
license.txt Normal file
View File

@ -0,0 +1,36 @@
Textures:
CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Attribution: Shara RedCat
Code:
License: MIT (https://opensource.org/licenses/MIT)
By Shara RedCat
Registry code adapted from xpanes mod in minetest_game (https://github.com/minetest/minetest_game/tree/master/mods/xpanes)
---
The MIT License (MIT)
Copyright (c) 2016 Shara RedCat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB