Update xpanes, combine colored glass, and hardened_clay, fix albino sheep (thanks @stujones11)
@ -199,7 +199,7 @@ core.register_entity(":__builtin:item", {
|
|||||||
if own_stack:get_free_space() == 0 then
|
if own_stack:get_free_space() == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local objects = core.get_objects_inside_radius(pos, 0.1)
|
local objects = core.get_objects_inside_radius(pos, 0.25)
|
||||||
for k, obj in pairs(objects) do
|
for k, obj in pairs(objects) do
|
||||||
local entity = obj:get_luaentity()
|
local entity = obj:get_luaentity()
|
||||||
if entity and entity.name == "__builtin:item" then
|
if entity and entity.name == "__builtin:item" then
|
||||||
|
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 132 B |
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 169 B |
14
games/default/files/colored/README.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
MultiCraft game mod: Colored Blocks
|
||||||
|
|
||||||
|
Include Colored Glass, Hardened Clay
|
||||||
|
|
||||||
|
License of source code:
|
||||||
|
-----------------------
|
||||||
|
Copyright (C) 2019 MultiCraft Developement Team
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
http://www.gnu.org/licenses/lgpl-3.0.html
|
@ -1,3 +1,2 @@
|
|||||||
|
|
||||||
default
|
default
|
||||||
dye
|
dye
|
73
games/default/files/colored/init.lua
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
local dyes = dye.dyes
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Colored Glass
|
||||||
|
--
|
||||||
|
|
||||||
|
for i = 1, #dyes do
|
||||||
|
local name, desc = unpack(dyes[i])
|
||||||
|
|
||||||
|
minetest.register_node(":default:glass_" .. name, {
|
||||||
|
description = desc .. " Glass",
|
||||||
|
drawtype = "glasslike",
|
||||||
|
paramtype2 = "glasslikeliquidlevel",
|
||||||
|
paramtype = "light",
|
||||||
|
tiles = {"glass_" .. name .. ".png"},
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
use_texture_alpha = true,
|
||||||
|
groups = {cracky = 3, oddly_breakable_by_hand = 3, colorglass = 1},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
drop = "",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:glass_" .. name,
|
||||||
|
recipe = {
|
||||||
|
{"default:glass", "group:dye,color_" .. name}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "default:glass_" .. name,
|
||||||
|
recipe = {
|
||||||
|
{"group:colorglass", "group:dye,color_" .. name}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_alias("default:glass_purple", "default:glass_violet")
|
||||||
|
minetest.register_alias("default:glass_light_blue", "default:glass_blue")
|
||||||
|
minetest.register_alias("default:glass_lime", "default:glass_green")
|
||||||
|
minetest.register_alias("default:glass_silver", "default:glass_grey")
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Colored Hardened Clay
|
||||||
|
--
|
||||||
|
|
||||||
|
for i = 1, #dyes do
|
||||||
|
local name, desc = unpack(dyes[i])
|
||||||
|
|
||||||
|
minetest.register_node(":hardened_clay:" .. name, {
|
||||||
|
description = desc .. " Hardened Clay",
|
||||||
|
tiles = {"hardened_clay_stained_" .. name .. ".png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 3, hardened_clay = 1},
|
||||||
|
sounds = default.node_sound_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = ":hardened_clay:" .. name .. " 8",
|
||||||
|
recipe = {
|
||||||
|
{"group:hardened_clay", "group:hardened_clay", "group:hardened_clay"},
|
||||||
|
{"group:hardened_clay", "group:dye,color_" .. name, "group:hardened_clay"},
|
||||||
|
{"group:hardened_clay", "group:hardened_clay", "group:hardened_clay"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_alias("hardened_clay:purple", "hardened_clay:violet")
|
||||||
|
minetest.register_alias("hardened_clay:light_blue", "hardened_clay:blue")
|
||||||
|
minetest.register_alias("hardened_clay:lime", "hardened_clay:green")
|
||||||
|
minetest.register_alias("hardened_clay:silver", "hardened_clay:grey")
|
BIN
games/default/files/colored/textures/glass_black.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
games/default/files/colored/textures/glass_blue.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
games/default/files/colored/textures/glass_brown.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
games/default/files/colored/textures/glass_cyan.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
games/default/files/colored/textures/glass_dark_green.png
Normal file
After Width: | Height: | Size: 328 B |
BIN
games/default/files/colored/textures/glass_dark_grey.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
games/default/files/colored/textures/glass_green.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
games/default/files/colored/textures/glass_grey.png
Normal file
After Width: | Height: | Size: 324 B |
BIN
games/default/files/colored/textures/glass_magenta.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
games/default/files/colored/textures/glass_orange.png
Normal file
After Width: | Height: | Size: 328 B |
BIN
games/default/files/colored/textures/glass_pink.png
Normal file
After Width: | Height: | Size: 328 B |
BIN
games/default/files/colored/textures/glass_red.png
Normal file
After Width: | Height: | Size: 324 B |
BIN
games/default/files/colored/textures/glass_violet.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
games/default/files/colored/textures/glass_white.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
games/default/files/colored/textures/glass_yellow.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
games/default/files/colored/textures/hardened_clay.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 837 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -108,3 +108,6 @@ minetest.register_alias("fences:fence_wood_32", "default:fence_wood")
|
|||||||
minetest.register_alias("fences:fence_wood_33", "default:fence_wood")
|
minetest.register_alias("fences:fence_wood_33", "default:fence_wood")
|
||||||
minetest.register_alias("fences:fence_wood_34", "default:fence_wood")
|
minetest.register_alias("fences:fence_wood_34", "default:fence_wood")
|
||||||
minetest.register_alias("fences:fence_wood_35", "default:fence_wood")
|
minetest.register_alias("fences:fence_wood_35", "default:fence_wood")
|
||||||
|
|
||||||
|
-- Hardened Clay
|
||||||
|
minetest.register_alias("hardened_clay:hardened_clay", "default:hardened_clay")
|
||||||
|
@ -567,6 +567,12 @@ minetest.register_craft({
|
|||||||
recipe = "default:clay_lump",
|
recipe = "default:clay_lump",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "cooking",
|
||||||
|
output = "default:hardened_clay",
|
||||||
|
recipe = "default:clay",
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
output = "default:fish",
|
output = "default:fish",
|
||||||
|
@ -213,6 +213,14 @@ minetest.register_node("default:clay", {
|
|||||||
sounds = default.node_sound_dirt_defaults(),
|
sounds = default.node_sound_dirt_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_node("default:hardened_clay", {
|
||||||
|
description = "Hardened Clay",
|
||||||
|
tiles = {"hardened_clay.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {cracky = 3, hardened_clay = 1},
|
||||||
|
sounds = default.node_sound_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("default:snow", {
|
minetest.register_node("default:snow", {
|
||||||
description = "Snow",
|
description = "Snow",
|
||||||
@ -1583,44 +1591,3 @@ default.register_leafdecay({
|
|||||||
leaves = {"default:acacia_leaves"},
|
leaves = {"default:acacia_leaves"},
|
||||||
radius = 2,
|
radius = 2,
|
||||||
})
|
})
|
||||||
|
|
||||||
--
|
|
||||||
-- Color Glass
|
|
||||||
--
|
|
||||||
|
|
||||||
function AddGlass(desc, recipeitem, color)
|
|
||||||
minetest.register_node("default:glass"..color, {
|
|
||||||
description = desc,
|
|
||||||
drawtype = "glasslike",
|
|
||||||
tiles = {"xpanes_pane_glass"..color..".png"},
|
|
||||||
paramtype = "light",
|
|
||||||
use_texture_alpha = true,
|
|
||||||
groups = {cracky = 3, oddly_breakable_by_hand = 3, colorglass = 1},
|
|
||||||
sounds = default.node_sound_glass_defaults(),
|
|
||||||
drop = "",
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = 'default:glass_'..color..'',
|
|
||||||
recipe = {
|
|
||||||
{'default:glass', 'group:dye,'..recipeitem}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Colored glass
|
|
||||||
AddGlass( "Glass Red", "basecolor_red", "_red")
|
|
||||||
AddGlass( "Glass Green", "unicolor_dark_green", "_green")
|
|
||||||
AddGlass( "Glass Blue", "basecolor_blue", "_blue")
|
|
||||||
AddGlass( "Glass Light Blue", "basecolor_cyan", "_light_blue")
|
|
||||||
AddGlass( "Glass Black", "basecolor_black", "_black")
|
|
||||||
AddGlass( "Glass White", "basecolor_white", "_white")
|
|
||||||
AddGlass( "Glass Yellow", "basecolor_yellow", "_yellow")
|
|
||||||
AddGlass( "Glass Brown", "unicolor_dark_orange", "_brown")
|
|
||||||
AddGlass( "Glass Orange", "excolor_orange", "_orange")
|
|
||||||
AddGlass( "Glass Pink", "unicolor_light_red", "_pink")
|
|
||||||
AddGlass( "Glass Gray", "unicolor_darkgrey", "_gray")
|
|
||||||
AddGlass( "Glass Lime", "basecolor_green", "_lime")
|
|
||||||
AddGlass( "Glass Silver", "basecolor_grey", "_silver")
|
|
||||||
AddGlass( "Glass Magenta", "basecolor_magenta", "_magenta")
|
|
||||||
AddGlass( "Glass Purple", "excolor_violet", "_purple")
|
|
||||||
|
BIN
games/default/files/default/textures/default_hardened_clay.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 5.3 KiB |
@ -1,57 +0,0 @@
|
|||||||
local clay = {}
|
|
||||||
|
|
||||||
clay.dyes = {
|
|
||||||
{"white", "White", "white"},
|
|
||||||
{"grey", "Grey", "dark_grey"},
|
|
||||||
{"silver", "Light Gray", "grey"},
|
|
||||||
{"black", "Black", "black"},
|
|
||||||
{"red", "Red", "red"},
|
|
||||||
{"yellow", "Yellow", "yellow"},
|
|
||||||
{"green", "Green", "dark_green"},
|
|
||||||
{"cyan", "Cyan", "cyan"},
|
|
||||||
{"blue", "Blue", "blue"},
|
|
||||||
{"magenta", "Magenta", "magenta"},
|
|
||||||
{"orange", "Orange", "orange"},
|
|
||||||
{"purple", "Purple", "violet"},
|
|
||||||
{"brown", "Brown", "dark_orange"},
|
|
||||||
{"pink", "Pink", "light_red"},
|
|
||||||
{"lime", "Lime", "green"},
|
|
||||||
{"light_blue", "Light Blue", "lightblue"},
|
|
||||||
}
|
|
||||||
|
|
||||||
minetest.register_node("hardened_clay:hardened_clay", {
|
|
||||||
description = "Hardened Clay",
|
|
||||||
tiles = {"hardened_clay.png"},
|
|
||||||
groups = {cracky = 3},
|
|
||||||
legacy_mineral = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "cooking",
|
|
||||||
output = "hardened_clay:hardened_clay",
|
|
||||||
recipe = "default:clay",
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
for _, row in ipairs(clay.dyes) do
|
|
||||||
local name = row[1]
|
|
||||||
local desc = row[2]
|
|
||||||
local craft_color_group = row[3]
|
|
||||||
-- Node Definition
|
|
||||||
minetest.register_node("hardened_clay:"..name, {
|
|
||||||
description = desc.." Hardened Clay",
|
|
||||||
tiles = {"hardened_clay_stained_"..name..".png"},
|
|
||||||
groups = {cracky = 3, hardened_clay=1},
|
|
||||||
sounds = default.node_sound_defaults(),
|
|
||||||
})
|
|
||||||
if craft_color_group then
|
|
||||||
minetest.register_craft({
|
|
||||||
output = 'hardened_clay:'..name..' 8',
|
|
||||||
recipe = {
|
|
||||||
{'hardened_clay:hardened_clay', 'hardened_clay:hardened_clay', 'hardened_clay:hardened_clay'},
|
|
||||||
{'hardened_clay:hardened_clay', 'dye:'..craft_color_group, 'hardened_clay:hardened_clay'},
|
|
||||||
{'hardened_clay:hardened_clay', 'hardened_clay:hardened_clay', 'hardened_clay:hardened_clay'},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 849 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
@ -64,12 +64,10 @@ for i = 1, #dyes do
|
|||||||
self.food = 0
|
self.food = 0
|
||||||
self.gotten = false
|
self.gotten = false
|
||||||
|
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
textures = {
|
textures = {"mobs_sheep_" .. name .. ".png"},
|
||||||
{"mobs_sheep_" .. name .. ".png"},
|
mesh = "mobs_sheep.b3d",
|
||||||
},
|
})
|
||||||
mesh = "mobs_sheep.b3d",
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
@ -6,15 +6,15 @@ for i = 1, #dyes do
|
|||||||
minetest.register_node("wool:" .. name, {
|
minetest.register_node("wool:" .. name, {
|
||||||
description = desc .. " Wool",
|
description = desc .. " Wool",
|
||||||
tiles = {"wool_" .. name .. ".png"},
|
tiles = {"wool_" .. name .. ".png"},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3,
|
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3,
|
||||||
flammable = 3, wool = 1},
|
flammable = 3, wool = 1},
|
||||||
sounds = default.node_sound_wool_defaults(),
|
sounds = default.node_sound_wool_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft{
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "wool:" .. name,
|
output = "wool:" .. name,
|
||||||
recipe = {"group:dye,color_" .. name, "group:wool"},
|
recipe = {"group:dye,color_" .. name, "group:wool"},
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
11
games/default/files/xpanes/README.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
MultiCraft Game mod: xpanes
|
||||||
|
=========================
|
||||||
|
See license.txt for license information.
|
||||||
|
|
||||||
|
Authors of source code
|
||||||
|
----------------------
|
||||||
|
Originally by xyz (MIT)
|
||||||
|
BlockMen (MIT)
|
||||||
|
sofar (MIT)
|
||||||
|
Various Minetest developers and contributors (MIT)
|
||||||
|
MultiCraft Developement Team (MIT)
|
@ -1 +1,3 @@
|
|||||||
default
|
default
|
||||||
|
dye
|
||||||
|
colored
|
||||||
|
@ -1,140 +1,227 @@
|
|||||||
-- xPanes mod by xyz custom by davedevils
|
local function is_pane(pos)
|
||||||
function pane(node, desc, dropitem, recipeitem, color)
|
return minetest.get_item_group(minetest.get_node(pos).name, "pane") > 0
|
||||||
local function rshift(x, by)
|
|
||||||
return math.floor(x / 2 ^ by)
|
|
||||||
end
|
|
||||||
|
|
||||||
local directions = {
|
|
||||||
{x = 1, y = 0, z = 0},
|
|
||||||
{x = 0, y = 0, z = 1},
|
|
||||||
{x = -1, y = 0, z = 0},
|
|
||||||
{x = 0, y = 0, z = -1},
|
|
||||||
}
|
|
||||||
|
|
||||||
local function update_pane(pos)
|
|
||||||
if minetest.get_node(pos).name:find("xpanes:pane_"..node..""..color) == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local sum = 0
|
|
||||||
for i = 1, 4 do
|
|
||||||
local node = minetest.get_node({x = pos.x + directions[i].x, y = pos.y + directions[i].y, z = pos.z + directions[i].z})
|
|
||||||
if minetest.registered_nodes[node.name].walkable ~= false then
|
|
||||||
sum = sum + 2 ^ (i - 1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if sum == 0 then
|
|
||||||
sum = 15
|
|
||||||
end
|
|
||||||
minetest.add_node(pos, {name = "xpanes:pane_"..node..""..color.."_"..sum})
|
|
||||||
end
|
|
||||||
|
|
||||||
local function update_nearby(pos)
|
|
||||||
for i = 1,4 do
|
|
||||||
update_pane({x = pos.x + directions[i].x, y = pos.y + directions[i].y, z = pos.z + directions[i].z})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local half_blocks = {
|
|
||||||
{0, -0.5, -0.06, 0.5, 0.5, 0.06},
|
|
||||||
{-0.06, -0.5, 0, 0.06, 0.5, 0.5},
|
|
||||||
{-0.5, -0.5, -0.06, 0, 0.5, 0.06},
|
|
||||||
{-0.06, -0.5, -0.5, 0.06, 0.5, 0}
|
|
||||||
}
|
|
||||||
|
|
||||||
local full_blocks = {
|
|
||||||
{-0.5, -0.5, -0.06, 0.5, 0.5, 0.06},
|
|
||||||
{-0.06, -0.5, -0.5, 0.06, 0.5, 0.5}
|
|
||||||
}
|
|
||||||
|
|
||||||
for i = 1, 15 do
|
|
||||||
local need = {}
|
|
||||||
local cnt = 0
|
|
||||||
for j = 1, 4 do
|
|
||||||
if rshift(i, j - 1) % 2 == 1 then
|
|
||||||
need[j] = true
|
|
||||||
cnt = cnt + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local take = {}
|
|
||||||
if need[1] == true and need[3] == true then
|
|
||||||
need[1] = nil
|
|
||||||
need[3] = nil
|
|
||||||
table.insert(take, full_blocks[1])
|
|
||||||
end
|
|
||||||
if need[2] == true and need[4] == true then
|
|
||||||
need[2] = nil
|
|
||||||
need[4] = nil
|
|
||||||
table.insert(take, full_blocks[2])
|
|
||||||
end
|
|
||||||
for k in pairs(need) do
|
|
||||||
table.insert(take, half_blocks[k])
|
|
||||||
end
|
|
||||||
local texture = "xpanes_pane_"..node..""..color..".png"
|
|
||||||
if cnt == 1 then
|
|
||||||
texture = "xpanes_pane_half_"..node..""..color..".png"
|
|
||||||
end
|
|
||||||
minetest.register_node("xpanes:pane_"..node..""..color.."_"..i, {
|
|
||||||
drawtype = "nodebox",
|
|
||||||
tiles = {"xpanes_top_"..node..""..color..".png", "xpanes_top_"..node..""..color..".png", texture},
|
|
||||||
paramtype = "light",
|
|
||||||
use_texture_alpha = true,
|
|
||||||
groups = {snappy = 2, crack = 3, oddly_breakable_by_hand = 3},
|
|
||||||
drop = dropitem,
|
|
||||||
sounds = default.node_sound_glass_defaults(),
|
|
||||||
node_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = take
|
|
||||||
},
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = take
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_node("xpanes:pane_"..node..""..color, {
|
|
||||||
description = desc,
|
|
||||||
tiles = {"xpanes_pane_"..node..""..color..".png"},
|
|
||||||
inventory_image = "xpanes_pane_"..node..""..color..".png",
|
|
||||||
paramtype = "light",
|
|
||||||
use_texture_alpha = true,
|
|
||||||
wield_image = "xpanes_pane_"..node..""..color..".png",
|
|
||||||
node_placement_prediction = "",
|
|
||||||
on_construct = update_pane,
|
|
||||||
groups = {snappy = 2, crack = 3, oddly_breakable_by_hand = 3},
|
|
||||||
drop = "",
|
|
||||||
sounds = default.node_sound_glass_defaults()
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_on_placenode(update_nearby)
|
|
||||||
minetest.register_on_dignode(update_nearby)
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = 'xpanes:pane_'..node..''..color..' 16',
|
|
||||||
recipe = {
|
|
||||||
{recipeitem, recipeitem, recipeitem},
|
|
||||||
{recipeitem, recipeitem, recipeitem}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
-- Glass
|
|
||||||
pane("glass", "Glass Pane", "", "default:glass", "_natural")
|
|
||||||
pane("glass", "Glass Pane Red", "", "default:glass_red", "_red")
|
|
||||||
pane("glass", "Glass Pane Green", "", "default:glass_green", "_green")
|
|
||||||
pane("glass", "Glass Pane Blue", "", "default:glass_blue", "_blue")
|
|
||||||
pane("glass", "Glass Pane Light Blue", "", "default:glass_light_blue", "_light_blue")
|
|
||||||
pane("glass", "Glass Pane Black", "", "default:glass_black", "_black")
|
|
||||||
pane("glass", "Glass Pane White", "", "default:glass_white", "_white")
|
|
||||||
pane("glass", "Glass Pane Yellow", "", "default:glass_yellow", "_yellow")
|
|
||||||
pane("glass", "Glass Pane Brown", "", "default:glass_brown", "_brown")
|
|
||||||
pane("glass", "Glass Pane Orange", "", "default:glass_orange", "_orange")
|
|
||||||
pane("glass", "Glass Pane Pink", "", "default:glass_pink", "_pink")
|
|
||||||
pane("glass", "Glass Pane Gray", "", "default:glass_gray", "_gray")
|
|
||||||
pane("glass", "Glass Pane Lime", "", "default:glass_lime", "_lime")
|
|
||||||
pane("glass", "Glass Pane Silver", "", "default:glass_silver", "_silver")
|
|
||||||
pane("glass", "Glass Pane Magenta", "", "default:glass_magenta", "_magenta")
|
|
||||||
pane("glass", "Glass Pane Purple", "", "default:glass_purple", "_purple")
|
|
||||||
|
|
||||||
|
local function connects_dir(pos, name, dir)
|
||||||
|
local aside = vector.add(pos, minetest.facedir_to_dir(dir))
|
||||||
|
if is_pane(aside) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
-- Iron
|
local connects_to = minetest.registered_nodes[name].connects_to
|
||||||
pane("iron", "Iron Fence", "xpanes:pane_iron", "default:steel_ingot", "")
|
if not connects_to then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local list = minetest.find_nodes_in_area(aside, aside, connects_to)
|
||||||
|
|
||||||
|
if #list > 0 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local function swap(pos, node, name, param2)
|
||||||
|
if node.name == name and node.param2 == param2 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.set_node(pos, {name = name, param2 = param2})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function update_pane(pos)
|
||||||
|
if not is_pane(pos) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
local name = node.name
|
||||||
|
if name:sub(-5) == "_flat" then
|
||||||
|
name = name:sub(1, -6)
|
||||||
|
end
|
||||||
|
|
||||||
|
local any = node.param2
|
||||||
|
local c = {}
|
||||||
|
local count = 0
|
||||||
|
for dir = 0, 3 do
|
||||||
|
c[dir] = connects_dir(pos, name, dir)
|
||||||
|
if c[dir] then
|
||||||
|
any = dir
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if count == 0 then
|
||||||
|
swap(pos, node, name .. "_flat", any)
|
||||||
|
elseif count == 1 then
|
||||||
|
swap(pos, node, name .. "_flat", (any + 1) % 4)
|
||||||
|
elseif count == 2 then
|
||||||
|
if (c[0] and c[2]) or (c[1] and c[3]) then
|
||||||
|
swap(pos, node, name .. "_flat", (any + 1) % 4)
|
||||||
|
else
|
||||||
|
swap(pos, node, name, 0)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
swap(pos, node, name, 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_placenode(function(pos, node)
|
||||||
|
if minetest.get_item_group(node, "pane") then
|
||||||
|
update_pane(pos)
|
||||||
|
end
|
||||||
|
for i = 0, 3 do
|
||||||
|
local dir = minetest.facedir_to_dir(i)
|
||||||
|
update_pane(vector.add(pos, dir))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_dignode(function(pos)
|
||||||
|
for i = 0, 3 do
|
||||||
|
local dir = minetest.facedir_to_dir(i)
|
||||||
|
update_pane(vector.add(pos, dir))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
xpanes = {}
|
||||||
|
function xpanes.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",
|
||||||
|
tiles = {def.textures[2], def.textures[2], def.textures[2], def.textures[2], def.textures[1], def.textures[1]},
|
||||||
|
groups = flatgroups,
|
||||||
|
drop = "xpanes:" .. name .. "_flat",
|
||||||
|
sounds = def.sounds,
|
||||||
|
use_texture_alpha = def.use_texture_alpha or false,
|
||||||
|
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,
|
||||||
|
description = def.description,
|
||||||
|
tiles = {def.textures[2], def.textures[2], def.textures[1], def.textures[1], def.textures[1], def.textures[1]},
|
||||||
|
groups = groups,
|
||||||
|
drop = "xpanes:" .. name .. "_flat",
|
||||||
|
sounds = def.sounds,
|
||||||
|
use_texture_alpha = def.use_texture_alpha or false,
|
||||||
|
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 " .. def.recipe_items,
|
||||||
|
recipe = def.recipe
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
xpanes.register_pane("pane", {
|
||||||
|
description = "Glass Pane",
|
||||||
|
textures = {"default_glass.png","xpanes_top_glass.png"},
|
||||||
|
wield_image = {"xpanes_glass.png","xpanes_top_glass.png"},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, glasspane = 1},
|
||||||
|
recipe = {
|
||||||
|
{"default:glass", "default:glass", "default:glass"},
|
||||||
|
{"default:glass", "default:glass", "default:glass"}
|
||||||
|
},
|
||||||
|
recipe_items = "16"
|
||||||
|
})
|
||||||
|
|
||||||
|
local dyes = dye.dyes
|
||||||
|
|
||||||
|
for i = 1, #dyes do
|
||||||
|
local name, desc = unpack(dyes[i])
|
||||||
|
|
||||||
|
xpanes.register_pane("pane_" .. name, {
|
||||||
|
description = desc .. " Glass Pane",
|
||||||
|
textures = {"glass_" .. name .. ".png","xpanes_top_glass_" .. name .. ".png"},
|
||||||
|
wield_image = {"glass_" .. name .. ".png","xpanes_top_glass_" .. name .. ".png","xpanes_top_glass_" .. name .. ".png"},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, glasspane = 1},
|
||||||
|
recipe = {
|
||||||
|
{"group:glasspane", "group:glasspane", "group:glasspane"},
|
||||||
|
{"group:glasspane", "group:dye,color_" .. name, "group:glasspane"},
|
||||||
|
{"group:glasspane", "group:glasspane", "group:glasspane"}
|
||||||
|
},
|
||||||
|
recipe_items = "8"
|
||||||
|
})
|
||||||
|
|
||||||
|
for i = 1, 15 do
|
||||||
|
minetest.register_alias("xpanes:pane_glass_" .. name .. "_" .. i, "xpanes:pane_" .. name .. "_flat")
|
||||||
|
end
|
||||||
|
minetest.register_alias("xpanes:pane_glass_" .. name, "xpanes:pane_" .. name .. "_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_natural_" .. i, "xpanes:pane_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_purple_" .. i, "xpanes:pane_violet_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_light_blue_" .. i, "xpanes:pane_blue_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_lime_" .. i, "xpanes:pane_green_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_gray_" .. i, "xpanes:pane_grey_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_silver_" .. i, "xpanes:pane_grey_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_iron_" .. i, "xpanes:bar_flat")
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_alias("xpanes:pane_glass_natural", "xpanes:pane_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_purple", "xpanes:pane_violet_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_light_blue", "xpanes:pane_blue_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_lime", "xpanes:pane_green_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_gray", "xpanes:pane_grey_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_glass_silver", "xpanes:pane_grey_flat")
|
||||||
|
minetest.register_alias("xpanes:pane_iron", "xpanes:bar_flat")
|
||||||
|
|
||||||
|
xpanes.register_pane("bar", {
|
||||||
|
description = "Steel Bars",
|
||||||
|
textures = {"xpanes_bar.png","xpanes_bar_top.png"},
|
||||||
|
inventory_image = "xpanes_bar.png",
|
||||||
|
wield_image = "xpanes_bar.png",
|
||||||
|
groups = {cracky = 2},
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
recipe = {
|
||||||
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||||
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
|
||||||
|
},
|
||||||
|
recipe_items = "16"
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_lbm({
|
||||||
|
name = "xpanes:gen2",
|
||||||
|
nodenames = {"group:pane"},
|
||||||
|
action = function(pos, node)
|
||||||
|
update_pane(pos)
|
||||||
|
for i = 0, 3 do
|
||||||
|
local dir = minetest.facedir_to_dir(i)
|
||||||
|
update_pane(vector.add(pos, dir))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
28
games/default/files/xpanes/license.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
License of source code
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (C) 2014-2016 xyz
|
||||||
|
Copyright (C) 2014-2016 BlockMen
|
||||||
|
Copyright (C) 2016 Auke Kok <sofar@foo-projects.org>
|
||||||
|
Copyright (C) 2014-2016 Various Minetest developers and contributors
|
||||||
|
Copyright (C) 2019 MultiCraft Developement Team
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
For more details:
|
||||||
|
https://opensource.org/licenses/MIT
|
Before Width: | Height: | Size: 792 B After Width: | Height: | Size: 792 B |
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 216 B |
Before Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 216 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 256 B |
Before Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 256 B |
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 792 B |
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 356 B |
Before Width: | Height: | Size: 238 B After Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 373 B |