minetest_game

master
garywhite207 2016-12-03 13:32:03 -08:00 committed by GitHub
parent 806d535fa8
commit e34f721189
39 changed files with 571 additions and 0 deletions

45
mods/vessels/README.txt Normal file
View File

@ -0,0 +1,45 @@
Minetest Game mod: vessels
==========================
Crafts
-------
Glass bottle (yields 10)
G - G
G - G
- G -
Drinking Glass (yields 14)
G - G
G - G
G G G
Heavy Steel Bottle (yields 5)
S - S
S - S
- S -
License of source code:
-----------------------
Copyright (C) 2012 Vanessa Ezekowitz
Version 2012-09-02
Modifications by Perttu Ahola <celeron55@gmail.com>
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 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
WTFPL
Authors of media files
-----------------------
Unless specifically noted,
Copyright (C) 2012 Vanessa Ezekowitz

1
mods/vessels/depends.txt Normal file
View File

@ -0,0 +1 @@
default

184
mods/vessels/init.lua Normal file
View File

@ -0,0 +1,184 @@
-- Minetest 0.4 mod: vessels
-- See README.txt for licensing and other information.
local vessels_shelf_formspec =
"size[8,7;]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[context;vessels;0,0.3;8,2;]"..
"list[current_player;main;0,2.85;8,1;]"..
"list[current_player;main;0,4.08;8,3;8]"..
"listring[context;vessels]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0,2.85)
minetest.register_node("vessels:shelf", {
description = "Vessels shelf",
tiles = {"default_wood.png", "default_wood.png", "vessels_shelf.png"},
is_ground_content = false,
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", vessels_shelf_formspec)
local inv = meta:get_inventory()
inv:set_size("vessels", 8 * 2)
end,
can_dig = function(pos,player)
local inv = minetest.get_meta(pos):get_inventory()
return inv:is_empty("vessels")
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if minetest.get_item_group(stack:get_name(), "vessel") ~= 0 then
return stack:get_count()
end
return 0
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))
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))
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))
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "vessels", drops)
drops[#drops+1] = "vessels:shelf"
minetest.remove_node(pos)
return drops
end,
})
minetest.register_craft({
output = 'vessels:shelf',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:vessel', 'group:vessel', 'group:vessel'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_node("vessels:glass_bottle", {
description = "Glass Bottle (empty)",
drawtype = "plantlike",
tiles = {"vessels_glass_bottle.png"},
inventory_image = "vessels_glass_bottle_inv.png",
wield_image = "vessels_glass_bottle.png",
paramtype = "light",
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft( {
output = "vessels:glass_bottle 10",
recipe = {
{ "default:glass", "", "default:glass" },
{ "default:glass", "", "default:glass" },
{ "", "default:glass", "" }
}
})
minetest.register_node("vessels:drinking_glass", {
description = "Drinking Glass (empty)",
drawtype = "plantlike",
tiles = {"vessels_drinking_glass.png"},
inventory_image = "vessels_drinking_glass_inv.png",
wield_image = "vessels_drinking_glass.png",
paramtype = "light",
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft( {
output = "vessels:drinking_glass 14",
recipe = {
{ "default:glass", "", "default:glass" },
{ "default:glass", "", "default:glass" },
{ "default:glass", "default:glass", "default:glass" }
}
})
minetest.register_node("vessels:steel_bottle", {
description = "Heavy Steel Bottle (empty)",
drawtype = "plantlike",
tiles = {"vessels_steel_bottle.png"},
inventory_image = "vessels_steel_bottle_inv.png",
wield_image = "vessels_steel_bottle.png",
paramtype = "light",
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1},
sounds = default.node_sound_defaults(),
})
minetest.register_craft( {
output = "vessels:steel_bottle 5",
recipe = {
{ "default:steel_ingot", "", "default:steel_ingot" },
{ "default:steel_ingot", "", "default:steel_ingot" },
{ "", "default:steel_ingot", "" }
}
})
-- Make sure we can recycle them
minetest.register_craftitem("vessels:glass_fragments", {
description = "Pile of Glass Fragments",
inventory_image = "vessels_glass_fragments.png",
})
minetest.register_craft( {
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"vessels:glass_bottle",
"vessels:glass_bottle",
},
})
minetest.register_craft( {
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"vessels:drinking_glass",
"vessels:drinking_glass",
},
})
minetest.register_craft({
type = "cooking",
output = "default:glass",
recipe = "vessels:glass_fragments",
})
minetest.register_craft( {
type = "cooking",
output = "default:steel_ingot",
recipe = "vessels:steel_bottle",
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

1
mods/walls/depends.txt Normal file
View File

@ -0,0 +1 @@
default

61
mods/walls/init.lua Normal file
View 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())

28
mods/wool/README.txt Normal file
View File

@ -0,0 +1,28 @@
Minetest Game mod: wool
=======================
Mostly backward-compatible with jordach's 16-color wool mod.
License of source code:
-----------------------
Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com>
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.
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
-----------------------
Cisoun:
- wool_black.png wool_brown.png wool_dark_green.png wool_green.png
- wool_magenta.png wool_pink.png wool_violet.png wool_yellow.png wool_blue.png
- wool_cyan.png wool_dark_grey.png wool_grey.png wool_orange.png wool_red.png
- wool_white.png

1
mods/wool/depends.txt Normal file
View File

@ -0,0 +1 @@
default

50
mods/wool/init.lua Normal file
View File

@ -0,0 +1,50 @@
-- minetest/wool/init.lua
-- Backwards compatibility with jordach's 16-color wool mod
minetest.register_alias("wool:dark_blue", "wool:blue")
minetest.register_alias("wool:gold", "wool:yellow")
local wool = {}
-- This uses a trick: you can first define the recipes using all of the base
-- colors, and then some recipes using more specific colors for a few non-base
-- colors available. When crafting, the last recipes will be checked first.
wool.dyes = {
{"white", "White", "basecolor_white"},
{"grey", "Grey", "basecolor_grey"},
{"black", "Black", "basecolor_black"},
{"red", "Red", "basecolor_red"},
{"yellow", "Yellow", "basecolor_yellow"},
{"green", "Green", "basecolor_green"},
{"cyan", "Cyan", "basecolor_cyan"},
{"blue", "Blue", "basecolor_blue"},
{"magenta", "Magenta", "basecolor_magenta"},
{"orange", "Orange", "excolor_orange"},
{"violet", "Violet", "excolor_violet"},
{"brown", "Brown", "unicolor_dark_orange"},
{"pink", "Pink", "unicolor_light_red"},
{"dark_grey", "Dark Grey", "unicolor_darkgrey"},
{"dark_green", "Dark Green", "unicolor_dark_green"},
}
for _, row in ipairs(wool.dyes) do
local name = row[1]
local desc = row[2]
local craft_color_group = row[3]
-- Node Definition
minetest.register_node("wool:"..name, {
description = desc.." Wool",
tiles = {"wool_"..name..".png"},
is_ground_content = false,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1},
sounds = default.node_sound_defaults(),
})
if craft_color_group then
-- Crafting from dye and white wool
minetest.register_craft({
type = "shapeless",
output = 'wool:'..name,
recipe = {'group:dye,'..craft_color_group, 'group:wool'},
})
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

16
mods/xpanes/README.txt Normal file
View File

@ -0,0 +1,16 @@
Minetest Game mod: xpanes
=========================
License:
--------
Copyright (C) xyz
modified by BlockMen (iron bars)
Gambit (WTFPL):
xpanes_bar.png
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.

1
mods/xpanes/depends.txt Normal file
View File

@ -0,0 +1 @@
default

183
mods/xpanes/init.lua Normal file
View File

@ -0,0 +1,183 @@
xpanes = {}
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, name)
if not minetest.get_node(pos).name:find("^xpanes:"..name) then
return
end
local sum = 0
for i, dir in pairs(directions) do
local node = minetest.get_node(vector.add(pos, dir))
local def = minetest.registered_nodes[node.name]
local pane_num = def and def.groups.pane or 0
if pane_num > 0 or not def or (def.walkable ~= false and
def.drawtype ~= "nodebox") then
sum = sum + 2 ^ (i - 1)
end
end
if sum == 0 then
sum = 15
end
minetest.set_node(pos, {name = "xpanes:"..name.."_"..sum})
end
local function update_nearby(pos, node)
node = node or minetest.get_node(pos)
local name = node.name
if not name or node.name:sub(1, 7) ~= "xpanes:" then
return
end
local underscore_pos = string.find(name, "_[^_]*$") or 0
local len = name:len()
local num = tonumber(name:sub(underscore_pos+1, len))
if not num or num < 1 or num > 15 then
name = name:sub(8)
else
name = name:sub(8, underscore_pos - 1)
end
for i, dir in pairs(directions) do
update_pane(vector.add(pos, dir), name)
end
end
minetest.register_on_placenode(update_nearby)
minetest.register_on_dignode(update_nearby)
local half_boxes = {
{0, -0.5, -1/32, 0.5, 0.5, 1/32},
{-1/32, -0.5, 0, 1/32, 0.5, 0.5},
{-0.5, -0.5, -1/32, 0, 0.5, 1/32},
{-1/32, -0.5, -0.5, 1/32, 0.5, 0}
}
local full_boxes = {
{-0.5, -0.5, -1/32, 0.5, 0.5, 1/32},
{-1/32, -0.5, -0.5, 1/32, 0.5, 0.5}
}
local sb_half_boxes = {
{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 sb_full_boxes = {
{-0.5, -0.5, -0.06, 0.5, 0.5, 0.06},
{-0.06, -0.5, -0.5, 0.06, 0.5, 0.5}
}
local pane_def_fields = {
drawtype = "airlike",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
air_equivalent = true,
}
function xpanes.register_pane(name, def)
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 = {}
local take2 = {}
if need[1] == true and need[3] == true then
need[1] = nil
need[3] = nil
table.insert(take, full_boxes[1])
table.insert(take2, sb_full_boxes[1])
end
if need[2] == true and need[4] == true then
need[2] = nil
need[4] = nil
table.insert(take, full_boxes[2])
table.insert(take2, sb_full_boxes[2])
end
for k in pairs(need) do
table.insert(take, half_boxes[k])
table.insert(take2, sb_half_boxes[k])
end
local texture = def.textures[1]
if cnt == 1 then
texture = def.textures[1].."^"..def.textures[2]
end
minetest.register_node(":xpanes:"..name.."_"..i, {
drawtype = "nodebox",
tiles = {def.textures[3], def.textures[3], texture},
paramtype = "light",
groups = def.groups,
drop = "xpanes:"..name,
sounds = def.sounds,
node_box = {
type = "fixed",
fixed = take
},
selection_box = {
type = "fixed",
fixed = take2
}
})
end
for k, v in pairs(pane_def_fields) do
def[k] = def[k] or v
end
def.on_construct = function(pos)
update_pane(pos, name)
end
minetest.register_node(":xpanes:"..name, def)
minetest.register_craft({
output = "xpanes:"..name.." 16",
recipe = def.recipe
})
end
xpanes.register_pane("pane", {
description = "Glass Pane",
textures = {"default_glass.png","xpanes_pane_half.png","xpanes_white.png"},
inventory_image = "default_glass.png",
wield_image = "default_glass.png",
sounds = default.node_sound_glass_defaults(),
groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3, pane=1},
recipe = {
{"default:glass", "default:glass", "default:glass"},
{"default:glass", "default:glass", "default:glass"}
}
})
xpanes.register_pane("bar", {
description = "Iron bar",
textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_space.png"},
inventory_image = "xpanes_bar.png",
wield_image = "xpanes_bar.png",
groups = {cracky=2, pane=1},
sounds = default.node_sound_stone_defaults(),
recipe = {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B