Compare commits
275 Commits
0.3.1
...
0.4.dev-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3965d432ca | ||
|
|
746b960c0d | ||
|
|
760416b81f | ||
|
|
1c785c32ef | ||
|
|
cd608b1877 | ||
|
|
c6dd75ccfb | ||
|
|
6b2023dc3e | ||
|
|
2f4a92d701 | ||
|
|
324c544922 | ||
|
|
fbbbcf97d8 | ||
|
|
d96cd236f3 | ||
|
|
581f950e10 | ||
|
|
9344816bd6 | ||
|
|
67c21fc42f | ||
|
|
c2d266efc6 | ||
|
|
ec1859b095 | ||
|
|
bc00cdeb2c | ||
|
|
3e6e35f383 | ||
|
|
b9e8e20c9c | ||
|
|
932988af46 | ||
|
|
69bc9224db | ||
|
|
a17efe6e8f | ||
|
|
e8b0722137 | ||
|
|
ed128fff26 | ||
|
|
a465fd5b99 | ||
|
|
9af0142a36 | ||
|
|
34fd47887e | ||
|
|
2dc9a0c724 | ||
|
|
c357985135 | ||
|
|
ae2b7f9523 | ||
|
|
5344dec760 | ||
|
|
89bc306632 | ||
|
|
dc05b106f2 | ||
|
|
a416cf7c45 | ||
|
|
09010410cf | ||
|
|
f8bbecebf5 | ||
|
|
9d67037570 | ||
|
|
e4daa4c065 | ||
|
|
08a10b8a6a | ||
|
|
af32240545 | ||
|
|
ee0d3bacbc | ||
|
|
9dcfa882b1 | ||
|
|
cb589b1f99 | ||
|
|
e6e3eef0ef | ||
|
|
0e113a4c81 | ||
|
|
1da3a8e24b | ||
|
|
3509714951 | ||
|
|
146be1f0b6 | ||
|
|
223a4f4741 | ||
|
|
1f1c1790f5 | ||
|
|
2ca00fa585 | ||
|
|
1901158b3e | ||
|
|
63d3403a20 | ||
|
|
7f7fe444d3 | ||
|
|
f4272ccf8f | ||
|
|
4196b0d341 | ||
|
|
ebc7a36a83 | ||
|
|
aab50cd2cc | ||
|
|
96c30452f9 | ||
|
|
4d0f227c70 | ||
|
|
50b87c3791 | ||
|
|
b6539399f4 | ||
|
|
8b8ef8acc0 | ||
|
|
74c6836f2f | ||
|
|
d8d6d0dc95 | ||
|
|
f6c6c4f917 | ||
|
|
918c507a66 | ||
|
|
1b61ca412b | ||
|
|
cd563473fa | ||
|
|
d26e19a296 | ||
|
|
a244e367ea | ||
|
|
347216d654 | ||
|
|
49e4f55b09 | ||
|
|
661ed387df | ||
|
|
ccfec0400f | ||
|
|
e109ed5cef | ||
|
|
b2c905d800 | ||
|
|
4bcff65ad0 | ||
|
|
e5d372f238 | ||
|
|
103d4793f0 | ||
|
|
2a610b011a | ||
|
|
cd030639a4 | ||
|
|
6d23fb2592 | ||
|
|
bc48cf076d | ||
|
|
be2ecf9186 | ||
|
|
d57aa531e1 | ||
|
|
bb898bf587 | ||
|
|
9d35e4fa6e | ||
|
|
bd1e5f4fc8 | ||
|
|
95951ce558 | ||
|
|
10a363ebf3 | ||
|
|
d6b30dd3a5 | ||
|
|
1c19f959db | ||
|
|
dde22d26a8 | ||
|
|
c8211ceb3e | ||
|
|
c910ead4db | ||
|
|
fe64f2b673 | ||
|
|
a91eb36277 | ||
|
|
026979e39d | ||
|
|
705f142b8d | ||
|
|
e880cc40e9 | ||
|
|
7bb4b7911b | ||
|
|
fadf248892 | ||
|
|
0f2b932e92 | ||
|
|
34bd1b3032 | ||
|
|
8924588511 | ||
|
|
6029d9e5a9 | ||
|
|
19a1ac1f34 | ||
|
|
30648d1cc9 | ||
|
|
842eb5da28 | ||
|
|
05df2ee8a4 | ||
|
|
ab3911ba9e | ||
|
|
013921782b | ||
|
|
c449e5f20a | ||
|
|
6e0de7b42c | ||
|
|
2e42391b86 | ||
|
|
21bd679076 | ||
|
|
fd8b9a3a44 | ||
|
|
5c1cb01936 | ||
|
|
ec4f58741b | ||
|
|
4ce6e5f0c5 | ||
|
|
a8a82e0b21 | ||
|
|
739cb87385 | ||
|
|
8492796a5c | ||
|
|
218b626016 | ||
|
|
f42c57d9a8 | ||
|
|
82a460ec90 | ||
|
|
b4e6ca63b5 | ||
|
|
1d36e68346 | ||
|
|
41c473cf5e | ||
|
|
b2ccbdffc1 | ||
|
|
769cc9879f | ||
|
|
0dbb31afeb | ||
|
|
1bfc3c1eb9 | ||
|
|
8bd178c2e5 | ||
|
|
b58dc083a9 | ||
|
|
65b2a2cb02 | ||
|
|
70363847aa | ||
|
|
1ce749c86a | ||
|
|
08c9b6037d | ||
|
|
57a2bd056c | ||
|
|
234bf99743 | ||
|
|
f93144fee7 | ||
|
|
945d01fd9e | ||
|
|
d99d27dcbe | ||
|
|
908db7c1d2 | ||
|
|
77337271fc | ||
|
|
c1479a2732 | ||
|
|
1f53ca5f4c | ||
|
|
425db289d5 | ||
|
|
d2eed169ae | ||
|
|
61ffe1eac4 | ||
|
|
9e7ad1e2aa | ||
|
|
ae9f183cda | ||
|
|
71bc20c453 | ||
|
|
ff1ae29f97 | ||
|
|
fdf6eecd59 | ||
|
|
651657edfd | ||
|
|
74770ab718 | ||
|
|
6153a2fb10 | ||
|
|
e5650bb549 | ||
|
|
18bb0ea1ea | ||
|
|
6a8f9135de | ||
|
|
704d8a62bf | ||
|
|
3b3ca65562 | ||
|
|
697ff926ce | ||
|
|
e8a9578774 | ||
|
|
0bf3a15886 | ||
|
|
cebc8c78a4 | ||
|
|
290e921920 | ||
|
|
94feb62b08 | ||
|
|
941176cd65 | ||
|
|
251b015210 | ||
|
|
616bad96af | ||
|
|
1b765b9740 | ||
|
|
0ce0c8fcfb | ||
|
|
811ac5ac3a | ||
|
|
901d98b687 | ||
|
|
4503b03b26 | ||
|
|
0e64406b06 | ||
|
|
1220b642eb | ||
|
|
cc03718d3c | ||
|
|
d7cb6146c8 | ||
|
|
4f021fc7dd | ||
|
|
498ebef357 | ||
|
|
cebbaf1664 | ||
|
|
227e067512 | ||
|
|
9d5b458479 | ||
|
|
8dd3622c6d | ||
|
|
564c3a9c96 | ||
|
|
4725e5c52e | ||
|
|
106027fc29 | ||
|
|
d1298fe5e7 | ||
|
|
eabfb370ac | ||
|
|
62164d955c | ||
|
|
a5545593ba | ||
|
|
f68fa667c8 | ||
|
|
7a29b14a20 | ||
|
|
df8346ef4d | ||
|
|
c0f6395cf0 | ||
|
|
50d63e4b0a | ||
|
|
6a417c538f | ||
|
|
7fae32095a | ||
|
|
37a5f8a30b | ||
|
|
f107967fdc | ||
|
|
a793533d1a | ||
|
|
3318d0b4b8 | ||
|
|
81f1cc662f | ||
|
|
28fe2987a0 | ||
|
|
26abf6fd82 | ||
|
|
594b189569 | ||
|
|
7696a38543 | ||
|
|
cde35d1606 | ||
|
|
9fc78cbece | ||
|
|
e4dff41560 | ||
|
|
2f2392f783 | ||
|
|
c3703ded95 | ||
|
|
e5fd010a6c | ||
|
|
ba762bcd49 | ||
|
|
6da8cb00e2 | ||
|
|
eed727c61b | ||
|
|
89e7bacd99 | ||
|
|
ff34955a0d | ||
|
|
a48a0e77eb | ||
|
|
cf6e22e9a6 | ||
|
|
c1202a2ecc | ||
|
|
01ae0daea5 | ||
|
|
45fc45a49e | ||
|
|
7bdc328a71 | ||
|
|
e71744b918 | ||
|
|
40e7a1a5c9 | ||
|
|
7878d9b3f6 | ||
|
|
9e1c4533b8 | ||
|
|
4b8e4dae58 | ||
|
|
0754f2a7af | ||
|
|
8d2d28f1dc | ||
|
|
e9620d9c8c | ||
|
|
de51f87e05 | ||
|
|
1afed48a2c | ||
|
|
c6fd2986d4 | ||
|
|
abceeee92f | ||
|
|
5fc791ac9a | ||
|
|
72884bf85f | ||
|
|
f97d4355be | ||
|
|
e19d1ea95a | ||
|
|
96b71236ed | ||
|
|
3b77a63d5d | ||
|
|
64fa59e24f | ||
|
|
79c9f14aec | ||
|
|
2ef414d05f | ||
|
|
77cf27b82b | ||
|
|
64996422c0 | ||
|
|
f8c9b70379 | ||
|
|
7b802c547d | ||
|
|
73bb3bc595 | ||
|
|
1320d07068 | ||
|
|
0b97ad8384 | ||
|
|
ddaff2d653 | ||
|
|
75a0ca6bd6 | ||
|
|
38944467d3 | ||
|
|
23adfff4fe | ||
|
|
b35adfbd2d | ||
|
|
526eedf98e | ||
|
|
dcedfdacd1 | ||
|
|
ea8d6d7abd | ||
|
|
f145d498a6 | ||
|
|
41c91391fc | ||
|
|
1ddfdc55dd | ||
|
|
a6a1e6ed1a | ||
|
|
f8430723e0 | ||
|
|
bfc68d3151 | ||
|
|
ee8b6d3444 | ||
|
|
2115a766f6 | ||
|
|
d1a5e97a7f | ||
|
|
7372282a72 |
4
.gitignore
vendored
@@ -21,3 +21,7 @@ src/jthread/libjthread.a
|
||||
debug.txt
|
||||
bin/debug.txt
|
||||
minetestmapper/map.png
|
||||
locale/
|
||||
src/lua/build/
|
||||
src/lua/CMakeFiles/
|
||||
*bak*
|
||||
|
||||
@@ -9,8 +9,8 @@ project(minetest)
|
||||
|
||||
# Also remember to set PROTOCOL_VERSION in clientserver.h when releasing
|
||||
set(VERSION_MAJOR 0)
|
||||
set(VERSION_MINOR 3)
|
||||
set(VERSION_PATCH 1)
|
||||
set(VERSION_MINOR 4)
|
||||
set(VERSION_PATCH dev-20111203-2)
|
||||
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
||||
|
||||
MESSAGE(STATUS "*** Will build version ${VERSION_STRING} ***")
|
||||
|
||||
11
README.txt
@@ -195,16 +195,17 @@ cmake %sourcedir% -G "Visual Studio 10" -DIRRLICHT_SOURCE_DIR=%irrlichtpath% -DR
|
||||
"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" PACKAGE.vcxproj /p:Configuration=Release
|
||||
popd
|
||||
|
||||
License of Minetest-c55 textures
|
||||
--------------------------------
|
||||
License of Minetest-c55 textures and sounds
|
||||
-------------------------------------------
|
||||
|
||||
This does not apply to texture packs made by others.
|
||||
This applies to textures and sounds contained in the main Minetest
|
||||
distribution.
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
License of Minetest-c55
|
||||
-----------------------
|
||||
License of Minetest-c55 source code
|
||||
-----------------------------------
|
||||
|
||||
Minetest-c55
|
||||
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
359
data/builtin.lua
Normal file
@@ -0,0 +1,359 @@
|
||||
--
|
||||
-- This file contains built-in stuff in Minetest implemented in Lua.
|
||||
--
|
||||
-- It is always loaded and executed after registration of the C API,
|
||||
-- before loading and running any mods.
|
||||
--
|
||||
|
||||
function basic_dump2(o)
|
||||
if type(o) == "number" then
|
||||
return tostring(o)
|
||||
elseif type(o) == "string" then
|
||||
return string.format("%q", o)
|
||||
elseif type(o) == "boolean" then
|
||||
return tostring(o)
|
||||
elseif type(o) == "function" then
|
||||
return "<function>"
|
||||
elseif type(o) == "userdata" then
|
||||
return "<userdata>"
|
||||
elseif type(o) == "nil" then
|
||||
return "nil"
|
||||
else
|
||||
error("cannot dump a " .. type(o))
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function dump2(o, name, dumped)
|
||||
name = name or "_"
|
||||
dumped = dumped or {}
|
||||
io.write(name, " = ")
|
||||
if type(o) == "number" or type(o) == "string" or type(o) == "boolean"
|
||||
or type(o) == "function" or type(o) == "nil"
|
||||
or type(o) == "userdata" then
|
||||
io.write(basic_dump2(o), "\n")
|
||||
elseif type(o) == "table" then
|
||||
if dumped[o] then
|
||||
io.write(dumped[o], "\n")
|
||||
else
|
||||
dumped[o] = name
|
||||
io.write("{}\n") -- new table
|
||||
for k,v in pairs(o) do
|
||||
local fieldname = string.format("%s[%s]", name, basic_dump2(k))
|
||||
dump2(v, fieldname, dumped)
|
||||
end
|
||||
end
|
||||
else
|
||||
error("cannot dump a " .. type(o))
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function dump(o, dumped)
|
||||
dumped = dumped or {}
|
||||
if type(o) == "number" then
|
||||
return tostring(o)
|
||||
elseif type(o) == "string" then
|
||||
return string.format("%q", o)
|
||||
elseif type(o) == "table" then
|
||||
if dumped[o] then
|
||||
return "<circular reference>"
|
||||
end
|
||||
dumped[o] = true
|
||||
local t = {}
|
||||
for k,v in pairs(o) do
|
||||
t[#t+1] = "" .. k .. " = " .. dump(v, dumped)
|
||||
end
|
||||
return "{" .. table.concat(t, ", ") .. "}"
|
||||
elseif type(o) == "boolean" then
|
||||
return tostring(o)
|
||||
elseif type(o) == "function" then
|
||||
return "<function>"
|
||||
elseif type(o) == "userdata" then
|
||||
return "<userdata>"
|
||||
elseif type(o) == "nil" then
|
||||
return "nil"
|
||||
else
|
||||
error("cannot dump a " .. type(o))
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Built-in node definitions. Also defined in C.
|
||||
--
|
||||
|
||||
minetest.register_nodedef_defaults({
|
||||
-- name intentionally not defined here
|
||||
drawtype = "normal",
|
||||
visual_scale = 1.0,
|
||||
tile_images = {"unknown_block.png"},
|
||||
inventory_image = "unknown_block.png",
|
||||
special_materials = {
|
||||
{image="", backface_culling=true},
|
||||
{image="", backface_culling=true},
|
||||
},
|
||||
alpha = 255,
|
||||
post_effect_color = {a=0, r=0, g=0, b=0},
|
||||
paramtype = "none",
|
||||
is_ground_content = false,
|
||||
light_propagates = false,
|
||||
sunlight_propagates = false,
|
||||
walkable = true,
|
||||
pointable = true,
|
||||
diggable = true,
|
||||
climbable = false,
|
||||
buildable_to = false,
|
||||
wall_mounted = false,
|
||||
often_contains_mineral = false,
|
||||
dug_item = "",
|
||||
extra_dug_item = "",
|
||||
extra_dug_item_rarity = 2,
|
||||
metadata_name = "",
|
||||
liquidtype = "none",
|
||||
liquid_alternative_flowing = "",
|
||||
liquid_alternative_source = "",
|
||||
liquid_viscosity = 0,
|
||||
light_source = 0,
|
||||
damage_per_second = 0,
|
||||
selection_box = {type="regular"},
|
||||
material = {
|
||||
diggablity = "normal",
|
||||
weight = 0,
|
||||
crackiness = 0,
|
||||
crumbliness = 0,
|
||||
cuttability = 0,
|
||||
flammability = 0,
|
||||
},
|
||||
cookresult_item = "", -- Cannot be cooked
|
||||
furnace_cooktime = 3.0,
|
||||
furnace_burntime = -1, -- Cannot be used as fuel
|
||||
})
|
||||
|
||||
minetest.register_node("air", {
|
||||
drawtype = "airlike",
|
||||
paramtype = "light",
|
||||
light_propagates = true,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
air_equivalent = true,
|
||||
})
|
||||
|
||||
minetest.register_node("ignore", {
|
||||
drawtype = "airlike",
|
||||
paramtype = "none",
|
||||
light_propagates = false,
|
||||
sunlight_propagates = false,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true, -- A way to remove accidentally placed ignores
|
||||
air_equivalent = true,
|
||||
})
|
||||
|
||||
--
|
||||
-- stackstring manipulation functions
|
||||
-- example stackstring: 'craft "apple" 4'
|
||||
-- example item: {type="craft", name="apple"}
|
||||
-- example item: {type="tool", name="SteelPick", wear="23272"}
|
||||
--
|
||||
|
||||
function stackstring_take_item(stackstring)
|
||||
if stackstring == nil then
|
||||
return '', nil
|
||||
end
|
||||
local stacktype = nil
|
||||
stacktype = string.match(stackstring,
|
||||
'([%a%d]+)')
|
||||
if stacktype == "node" or stacktype == "craft" then
|
||||
local itemtype = nil
|
||||
local itemname = nil
|
||||
local itemcount = nil
|
||||
itemtype, itemname, itemcount = string.match(stackstring,
|
||||
'([%a%d]+) "([^"]*)" (%d+)')
|
||||
itemcount = tonumber(itemcount)
|
||||
if itemcount == 0 then
|
||||
return '', nil
|
||||
elseif itemcount == 1 then
|
||||
return '', {type=itemtype, name=itemname}
|
||||
else
|
||||
return itemtype.." \""..itemname.."\" "..(itemcount-1),
|
||||
{type=itemtype, name=itemname}
|
||||
end
|
||||
elseif stacktype == "tool" then
|
||||
local itemtype = nil
|
||||
local itemname = nil
|
||||
local itemwear = nil
|
||||
itemtype, itemname, itemwear = string.match(stackstring,
|
||||
'([%a%d]+) "([^"]*)" (%d+)')
|
||||
itemwear = tonumber(itemwear)
|
||||
return '', {type=itemtype, name=itemname, wear=itemwear}
|
||||
end
|
||||
end
|
||||
|
||||
function stackstring_put_item(stackstring, item)
|
||||
if item == nil then
|
||||
return stackstring, false
|
||||
end
|
||||
stackstring = stackstring or ''
|
||||
local stacktype = nil
|
||||
stacktype = string.match(stackstring,
|
||||
'([%a%d]+)')
|
||||
stacktype = stacktype or ''
|
||||
if stacktype ~= '' and stacktype ~= item.type then
|
||||
return stackstring, false
|
||||
end
|
||||
if item.type == "node" or item.type == "craft" then
|
||||
local itemtype = nil
|
||||
local itemname = nil
|
||||
local itemcount = nil
|
||||
itemtype, itemname, itemcount = string.match(stackstring,
|
||||
'([%a%d]+) "([^"]*)" (%d+)')
|
||||
itemtype = itemtype or item.type
|
||||
itemname = itemname or item.name
|
||||
if itemcount == nil then
|
||||
itemcount = 0
|
||||
end
|
||||
itemcount = itemcount + 1
|
||||
return itemtype.." \""..itemname.."\" "..itemcount, true
|
||||
elseif item.type == "tool" then
|
||||
if stacktype ~= nil then
|
||||
return stackstring, false
|
||||
end
|
||||
local itemtype = nil
|
||||
local itemname = nil
|
||||
local itemwear = nil
|
||||
itemtype, itemname, itemwear = string.match(stackstring,
|
||||
'([%a%d]+) "([^"]*)" (%d+)')
|
||||
itemwear = tonumber(itemwear)
|
||||
return itemtype.." \""..itemname.."\" "..itemwear, true
|
||||
end
|
||||
return stackstring, false
|
||||
end
|
||||
|
||||
function stackstring_put_stackstring(stackstring, src)
|
||||
while src ~= '' do
|
||||
--print("src="..dump(src))
|
||||
src, item = stackstring_take_item(src)
|
||||
--print("src="..dump(src).." item="..dump(item))
|
||||
local success
|
||||
stackstring, success = stackstring_put_item(stackstring, item)
|
||||
if not success then
|
||||
return stackstring, false
|
||||
end
|
||||
end
|
||||
return stackstring, true
|
||||
end
|
||||
|
||||
function test_stackstring()
|
||||
local stack
|
||||
local item
|
||||
local success
|
||||
|
||||
stack, item = stackstring_take_item('node "TNT" 3')
|
||||
assert(stack == 'node "TNT" 2')
|
||||
assert(item.type == 'node')
|
||||
assert(item.name == 'TNT')
|
||||
|
||||
stack, item = stackstring_take_item('craft "with spaces" 2')
|
||||
assert(stack == 'craft "with spaces" 1')
|
||||
assert(item.type == 'craft')
|
||||
assert(item.name == 'with spaces')
|
||||
|
||||
stack, item = stackstring_take_item('craft "with spaces" 1')
|
||||
assert(stack == '')
|
||||
assert(item.type == 'craft')
|
||||
assert(item.name == 'with spaces')
|
||||
|
||||
stack, item = stackstring_take_item('craft "s8df2kj3" 0')
|
||||
assert(stack == '')
|
||||
assert(item == nil)
|
||||
|
||||
stack, item = stackstring_take_item('tool "With Spaces" 32487')
|
||||
assert(stack == '')
|
||||
assert(item.type == 'tool')
|
||||
assert(item.name == 'With Spaces')
|
||||
assert(item.wear == 32487)
|
||||
|
||||
stack, success = stackstring_put_item('node "With Spaces" 40',
|
||||
{type='node', name='With Spaces'})
|
||||
assert(stack == 'node "With Spaces" 41')
|
||||
assert(success == true)
|
||||
|
||||
stack, success = stackstring_put_item('craft "With Spaces" 40',
|
||||
{type='craft', name='With Spaces'})
|
||||
assert(stack == 'craft "With Spaces" 41')
|
||||
assert(success == true)
|
||||
|
||||
stack, success = stackstring_put_item('tool "With Spaces" 32487',
|
||||
{type='tool', name='With Spaces'})
|
||||
assert(stack == 'tool "With Spaces" 32487')
|
||||
assert(success == false)
|
||||
|
||||
stack, success = stackstring_put_item('node "With Spaces" 40',
|
||||
{type='tool', name='With Spaces'})
|
||||
assert(stack == 'node "With Spaces" 40')
|
||||
assert(success == false)
|
||||
|
||||
assert(stackstring_put_stackstring('node "With Spaces" 2',
|
||||
'node "With Spaces" 1') == 'node "With Spaces" 3')
|
||||
end
|
||||
test_stackstring()
|
||||
|
||||
--
|
||||
-- craftitem helpers
|
||||
--
|
||||
|
||||
minetest.craftitem_place_item = function(item, placer, pos)
|
||||
--print("craftitem_place_item")
|
||||
--print("item: " .. dump(item))
|
||||
--print("placer: " .. dump(placer))
|
||||
--print("pos: " .. dump(pos))
|
||||
minetest.env:add_item(pos, 'craft "' .. item .. '" 1')
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.craftitem_eat = function(hp_change)
|
||||
return function(item, user, pointed_thing) -- closure
|
||||
--print("craftitem_eat(" .. hp_change .. ")")
|
||||
--print("item: " .. dump(item))
|
||||
--print("user: " .. dump(user))
|
||||
--print("pointed_thing: " .. dump(pointed_thing))
|
||||
user:set_hp(user:get_hp() + hp_change)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Creative inventory
|
||||
--
|
||||
|
||||
minetest.creative_inventory = {}
|
||||
|
||||
minetest.add_to_creative_inventory = function(itemstring)
|
||||
table.insert(minetest.creative_inventory, itemstring)
|
||||
end
|
||||
|
||||
--
|
||||
-- Callback registration
|
||||
--
|
||||
|
||||
function make_registration()
|
||||
local t = {}
|
||||
local registerfunc = function(func) table.insert(t, func) end
|
||||
return t, registerfunc
|
||||
end
|
||||
|
||||
minetest.registered_on_chat_messages, minetest.register_on_chat_message = make_registration()
|
||||
minetest.registered_globalsteps, minetest.register_globalstep = make_registration()
|
||||
minetest.registered_on_placenodes, minetest.register_on_placenode = make_registration()
|
||||
minetest.registered_on_dignodes, minetest.register_on_dignode = make_registration()
|
||||
minetest.registered_on_punchnodes, minetest.register_on_punchnode = make_registration()
|
||||
minetest.registered_on_generateds, minetest.register_on_generated = make_registration()
|
||||
minetest.registered_on_newplayers, minetest.register_on_newplayer = make_registration()
|
||||
minetest.registered_on_respawnplayers, minetest.register_on_respawnplayer = make_registration()
|
||||
|
||||
-- END
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 498 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
BIN
data/clienttextures/unknown_object.png
Normal file
|
After Width: | Height: | Size: 489 B |
BIN
data/glass.png
|
Before Width: | Height: | Size: 1.3 KiB |
2
data/mods/bucket/depends.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
default
|
||||
|
||||
73
data/mods/bucket/init.lua
Normal file
@@ -0,0 +1,73 @@
|
||||
minetest.register_craft({
|
||||
output = 'craft "bucket:bucket_empty" 1',
|
||||
recipe = {
|
||||
{'craft "steel_ingot"', '', 'craft "steel_ingot"'},
|
||||
{'', 'craft "steel_ingot"', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bucket:bucket_empty", {
|
||||
image = "bucket.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
on_place_on_ground = minetest.craftitem_place_item,
|
||||
on_use = function(item, player, pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
n = minetest.env:get_node(pointed_thing.under)
|
||||
if n.name == "water_source" then
|
||||
minetest.env:add_node(pointed_thing.under, {name="air"})
|
||||
player:add_to_inventory_later('craft "bucket:bucket_water" 1')
|
||||
return true
|
||||
elseif n.name == "lava_source" then
|
||||
minetest.env:add_node(pointed_thing.under, {name="air"})
|
||||
player:add_to_inventory_later('craft "bucket:bucket_lava" 1')
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bucket:bucket_water", {
|
||||
image = "bucket:bucket_water.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
on_place_on_ground = minetest.craftitem_place_item,
|
||||
on_use = function(item, player, pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
n = minetest.env:get_node(pointed_thing.under)
|
||||
if n.name == "water_source" then
|
||||
-- unchanged
|
||||
elseif n.name == "water_flowing" or n.name == "lava_source" or n.name == "lava_flowing" then
|
||||
minetest.env:add_node(pointed_thing.under, {name="water_source"})
|
||||
else
|
||||
minetest.env:add_node(pointed_thing.above, {name="water_source"})
|
||||
end
|
||||
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bucket:bucket_lava", {
|
||||
image = "bucket:bucket_lava.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
on_place_on_ground = minetest.craftitem_place_item,
|
||||
on_use = function(item, player, pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
n = minetest.env:get_node(pointed_thing.under)
|
||||
if n.name == "lava_source" then
|
||||
-- unchanged
|
||||
elseif n.name == "water_source" or n.name == "water_flowing" or n.name == "lava_flowing" then
|
||||
minetest.env:add_node(pointed_thing.under, {name="lava_source"})
|
||||
else
|
||||
minetest.env:add_node(pointed_thing.above, {name="lava_source"})
|
||||
end
|
||||
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
})
|
||||
BIN
data/mods/bucket/textures/bucket.png
Normal file
|
After Width: | Height: | Size: 329 B |
BIN
data/mods/bucket/textures/bucket_lava.png
Normal file
|
After Width: | Height: | Size: 363 B |
BIN
data/mods/bucket/textures/bucket_water.png
Normal file
|
After Width: | Height: | Size: 369 B |
1579
data/mods/default/init.lua
Normal file
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 597 B After Width: | Height: | Size: 597 B |
|
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 604 B |
|
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 279 B |
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
|
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 224 B |
|
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 151 B |
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 613 B After Width: | Height: | Size: 613 B |
|
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 249 B |
|
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 118 B |
|
Before Width: | Height: | Size: 830 B After Width: | Height: | Size: 830 B |
|
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 239 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 539 B |
|
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 603 B |
|
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 116 B |
|
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 236 B |
BIN
data/mods/default/textures/glass.png
Normal file
|
After Width: | Height: | Size: 978 B |
|
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 874 B |
|
Before Width: | Height: | Size: 856 B After Width: | Height: | Size: 856 B |
|
Before Width: | Height: | Size: 878 B After Width: | Height: | Size: 878 B |
|
Before Width: | Height: | Size: 591 B After Width: | Height: | Size: 591 B |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
|
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 672 B |
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 502 B |
|
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
|
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 395 B |
|
Before Width: | Height: | Size: 357 B After Width: | Height: | Size: 357 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 933 B |
|
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 936 B |
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 952 B After Width: | Height: | Size: 952 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 965 B After Width: | Height: | Size: 965 B |
BIN
data/mods/default/textures/mud.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 303 B |
|
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
|
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
|
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 341 B |
|
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
|
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 366 B |
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
|
Before Width: | Height: | Size: 555 B After Width: | Height: | Size: 555 B |
|
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 545 B |
|
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 542 B |
|
Before Width: | Height: | Size: 920 B After Width: | Height: | Size: 920 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 772 B |
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 502 B |
|
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
|
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: 489 B After Width: | Height: | Size: 489 B |
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 598 B After Width: | Height: | Size: 598 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |
|
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 199 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 190 B After Width: | Height: | Size: 190 B |
|
Before Width: | Height: | Size: 190 B After Width: | Height: | Size: 190 B |
|
Before Width: | Height: | Size: 190 B After Width: | Height: | Size: 190 B |
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 219 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 182 B |
|
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 806 B |
BIN
data/mods/default/textures/tnt_bottom.png
Normal file
|
After Width: | Height: | Size: 161 B |
BIN
data/mods/default/textures/tnt_side.png
Normal file
|
After Width: | Height: | Size: 186 B |
BIN
data/mods/default/textures/tnt_top.png
Normal file
|
After Width: | Height: | Size: 264 B |
|
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 927 B After Width: | Height: | Size: 927 B |
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |