Compare commits
166 Commits
0.4.dev-20
...
sapier-201
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c17133d80a | ||
|
|
14a64000ea | ||
|
|
e3122ae727 | ||
|
|
65ac1d46b3 | ||
|
|
dd73852ce4 | ||
|
|
3454e67793 | ||
|
|
0c78767754 | ||
|
|
f0679969b2 | ||
|
|
285f5a0259 | ||
|
|
71186974fa | ||
|
|
525bc8855f | ||
|
|
de166e75a1 | ||
|
|
569156b013 | ||
|
|
6d4bc012f0 | ||
|
|
2f5c28aaf1 | ||
|
|
4f2c1e36a1 | ||
|
|
bc743ca7ce | ||
|
|
f9d7e399b2 | ||
|
|
3e6f824e6c | ||
|
|
6286c555d4 | ||
|
|
4630281318 | ||
|
|
cd0019acd2 | ||
|
|
e82a76e438 | ||
|
|
ab57fbe4ca | ||
|
|
56f55ab1af | ||
|
|
2445cbbbdc | ||
|
|
48131bf988 | ||
|
|
2b9596fe9b | ||
|
|
0e1f448b61 | ||
|
|
ff82b95800 | ||
|
|
49b7055cb3 | ||
|
|
cb88f7b6d4 | ||
|
|
9425fb8192 | ||
|
|
e48ccd7943 | ||
|
|
6be5441176 | ||
|
|
d5ba7ebaf0 | ||
|
|
270a482740 | ||
|
|
e0b4890794 | ||
|
|
247e8b6e5d | ||
|
|
b760e2ba23 | ||
|
|
103173fc9b | ||
|
|
70ed371d0c | ||
|
|
81d3485109 | ||
|
|
7b7b68cdab | ||
|
|
135a65e200 | ||
|
|
123529e5eb | ||
|
|
e81989a0d8 | ||
|
|
1c15f53318 | ||
|
|
7937813c98 | ||
|
|
ad4040d982 | ||
|
|
69579306dd | ||
|
|
bd21f00f0a | ||
|
|
012bcbcb48 | ||
|
|
e06d4555bf | ||
|
|
abd106bacb | ||
|
|
008de2fb8f | ||
|
|
2e67fa3e48 | ||
|
|
ea36951bc4 | ||
|
|
09c48b60bd | ||
|
|
4cc117ddf6 | ||
|
|
ceaf8edade | ||
|
|
520200d597 | ||
|
|
ab67985d21 | ||
|
|
bc5cc638fc | ||
|
|
bff8be8b76 | ||
|
|
3e95b8a158 | ||
|
|
e8539d4dae | ||
|
|
1907b31da7 | ||
|
|
6145a135bd | ||
|
|
97c3bc408b | ||
|
|
a00e908f52 | ||
|
|
4ad8891e05 | ||
|
|
2b8b2a4f30 | ||
|
|
5c24450e54 | ||
|
|
3a689a5c4f | ||
|
|
44e36d9aad | ||
|
|
62f7f72d20 | ||
|
|
829c632511 | ||
|
|
8730dfb1f9 | ||
|
|
6764365994 | ||
|
|
8addbc9655 | ||
|
|
658d1a7235 | ||
|
|
4b00d4d9d2 | ||
|
|
6a5829788e | ||
|
|
03074cd23e | ||
|
|
2620e8eada | ||
|
|
9b5e676ffa | ||
|
|
fd1ef11617 | ||
|
|
9fa567a6ce | ||
|
|
fc6c00cbe1 | ||
|
|
66f90a6101 | ||
|
|
1fe5c58d56 | ||
|
|
f23616acaf | ||
|
|
7d37913ea4 | ||
|
|
ac56053c74 | ||
|
|
d566ffaa5f | ||
|
|
d06d7cb9a4 | ||
|
|
e494b5d422 | ||
|
|
fdf7b3bcdf | ||
|
|
871e6c0c73 | ||
|
|
392485aa45 | ||
|
|
275a348b75 | ||
|
|
189689716c | ||
|
|
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 |
@@ -10,7 +10,7 @@ project(minetest)
|
||||
# Also remember to set PROTOCOL_VERSION in clientserver.h when releasing
|
||||
set(VERSION_MAJOR 0)
|
||||
set(VERSION_MINOR 4)
|
||||
set(VERSION_PATCH dev-20111201-0)
|
||||
set(VERSION_PATCH dev-20120106-1)
|
||||
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>
|
||||
|
||||
178
data/builtin.lua
@@ -97,7 +97,6 @@ minetest.register_nodedef_defaults({
|
||||
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,
|
||||
@@ -133,7 +132,6 @@ minetest.register_nodedef_defaults({
|
||||
minetest.register_node("air", {
|
||||
drawtype = "airlike",
|
||||
paramtype = "light",
|
||||
light_propagates = true,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
@@ -145,7 +143,6 @@ minetest.register_node("air", {
|
||||
minetest.register_node("ignore", {
|
||||
drawtype = "airlike",
|
||||
paramtype = "none",
|
||||
light_propagates = false,
|
||||
sunlight_propagates = false,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
@@ -156,9 +153,9 @@ minetest.register_node("ignore", {
|
||||
|
||||
--
|
||||
-- stackstring manipulation functions
|
||||
-- example stackstring: 'CraftItem "apple" 4'
|
||||
-- example item: {type="CraftItem", name="apple"}
|
||||
-- example item: {type="ToolItem", name="SteelPick", wear="23272"}
|
||||
-- example stackstring: 'craft "apple" 4'
|
||||
-- example item: {type="craft", name="apple"}
|
||||
-- example item: {type="tool", name="SteelPick", wear="23272"}
|
||||
--
|
||||
|
||||
function stackstring_take_item(stackstring)
|
||||
@@ -167,13 +164,13 @@ function stackstring_take_item(stackstring)
|
||||
end
|
||||
local stacktype = nil
|
||||
stacktype = string.match(stackstring,
|
||||
'([%a%d]+Item[%a%d]*)')
|
||||
if stacktype == "NodeItem" or stacktype == "CraftItem" then
|
||||
'([%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]+Item[%a%d]*) "([^"]*)" (%d+)')
|
||||
'([%a%d]+) "([^"]*)" (%d+)')
|
||||
itemcount = tonumber(itemcount)
|
||||
if itemcount == 0 then
|
||||
return '', nil
|
||||
@@ -183,12 +180,12 @@ function stackstring_take_item(stackstring)
|
||||
return itemtype.." \""..itemname.."\" "..(itemcount-1),
|
||||
{type=itemtype, name=itemname}
|
||||
end
|
||||
elseif stacktype == "ToolItem" then
|
||||
elseif stacktype == "tool" then
|
||||
local itemtype = nil
|
||||
local itemname = nil
|
||||
local itemwear = nil
|
||||
itemtype, itemname, itemwear = string.match(stackstring,
|
||||
'([%a%d]+Item[%a%d]*) "([^"]*)" (%d+)')
|
||||
'([%a%d]+) "([^"]*)" (%d+)')
|
||||
itemwear = tonumber(itemwear)
|
||||
return '', {type=itemtype, name=itemname, wear=itemwear}
|
||||
end
|
||||
@@ -201,17 +198,17 @@ function stackstring_put_item(stackstring, item)
|
||||
stackstring = stackstring or ''
|
||||
local stacktype = nil
|
||||
stacktype = string.match(stackstring,
|
||||
'([%a%d]+Item[%a%d]*)')
|
||||
'([%a%d]+)')
|
||||
stacktype = stacktype or ''
|
||||
if stacktype ~= '' and stacktype ~= item.type then
|
||||
return stackstring, false
|
||||
end
|
||||
if item.type == "NodeItem" or item.type == "CraftItem" then
|
||||
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]+Item[%a%d]*) "([^"]*)" (%d+)')
|
||||
'([%a%d]+) "([^"]*)" (%d+)')
|
||||
itemtype = itemtype or item.type
|
||||
itemname = itemname or item.name
|
||||
if itemcount == nil then
|
||||
@@ -219,7 +216,7 @@ function stackstring_put_item(stackstring, item)
|
||||
end
|
||||
itemcount = itemcount + 1
|
||||
return itemtype.." \""..itemname.."\" "..itemcount, true
|
||||
elseif item.type == "ToolItem" then
|
||||
elseif item.type == "tool" then
|
||||
if stacktype ~= nil then
|
||||
return stackstring, false
|
||||
end
|
||||
@@ -227,7 +224,7 @@ function stackstring_put_item(stackstring, item)
|
||||
local itemname = nil
|
||||
local itemwear = nil
|
||||
itemtype, itemname, itemwear = string.match(stackstring,
|
||||
'([%a%d]+Item[%a%d]*) "([^"]*)" (%d+)')
|
||||
'([%a%d]+) "([^"]*)" (%d+)')
|
||||
itemwear = tonumber(itemwear)
|
||||
return itemtype.." \""..itemname.."\" "..itemwear, true
|
||||
end
|
||||
@@ -253,58 +250,71 @@ function test_stackstring()
|
||||
local item
|
||||
local success
|
||||
|
||||
stack, item = stackstring_take_item('NodeItem "TNT" 3')
|
||||
assert(stack == 'NodeItem "TNT" 2')
|
||||
assert(item.type == 'NodeItem')
|
||||
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('CraftItem "with spaces" 2')
|
||||
assert(stack == 'CraftItem "with spaces" 1')
|
||||
assert(item.type == 'CraftItem')
|
||||
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('CraftItem "with spaces" 1')
|
||||
stack, item = stackstring_take_item('craft "with spaces" 1')
|
||||
assert(stack == '')
|
||||
assert(item.type == 'CraftItem')
|
||||
assert(item.type == 'craft')
|
||||
assert(item.name == 'with spaces')
|
||||
|
||||
stack, item = stackstring_take_item('CraftItem "s8df2kj3" 0')
|
||||
stack, item = stackstring_take_item('craft "s8df2kj3" 0')
|
||||
assert(stack == '')
|
||||
assert(item == nil)
|
||||
|
||||
stack, item = stackstring_take_item('ToolItem "With Spaces" 32487')
|
||||
stack, item = stackstring_take_item('tool "With Spaces" 32487')
|
||||
assert(stack == '')
|
||||
assert(item.type == 'ToolItem')
|
||||
assert(item.type == 'tool')
|
||||
assert(item.name == 'With Spaces')
|
||||
assert(item.wear == 32487)
|
||||
|
||||
stack, success = stackstring_put_item('NodeItem "With Spaces" 40',
|
||||
{type='NodeItem', name='With Spaces'})
|
||||
assert(stack == 'NodeItem "With Spaces" 41')
|
||||
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('CraftItem "With Spaces" 40',
|
||||
{type='CraftItem', name='With Spaces'})
|
||||
assert(stack == 'CraftItem "With Spaces" 41')
|
||||
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('ToolItem "With Spaces" 32487',
|
||||
{type='ToolItem', name='With Spaces'})
|
||||
assert(stack == 'ToolItem "With Spaces" 32487')
|
||||
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('NodeItem "With Spaces" 40',
|
||||
{type='ToolItem', name='With Spaces'})
|
||||
assert(stack == 'NodeItem "With Spaces" 40')
|
||||
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('NodeItem "With Spaces" 2',
|
||||
'NodeItem "With Spaces" 1') == 'NodeItem "With Spaces" 3')
|
||||
assert(stackstring_put_stackstring('node "With Spaces" 2',
|
||||
'node "With Spaces" 1') == 'node "With Spaces" 3')
|
||||
end
|
||||
test_stackstring()
|
||||
|
||||
--
|
||||
-- craftitem helpers
|
||||
-- NodeItem helpers
|
||||
--
|
||||
|
||||
minetest.inventorycube = function(img1, img2, img3)
|
||||
img2 = img2 or img1
|
||||
img3 = img3 or img1
|
||||
return "[inventorycube"
|
||||
.. "{" .. img1:gsub("%^", "&")
|
||||
.. "{" .. img2:gsub("%^", "&")
|
||||
.. "{" .. img3:gsub("%^", "&")
|
||||
end
|
||||
|
||||
--
|
||||
-- CraftItem helpers
|
||||
--
|
||||
|
||||
minetest.craftitem_place_item = function(item, placer, pos)
|
||||
@@ -312,7 +322,7 @@ minetest.craftitem_place_item = function(item, placer, pos)
|
||||
--print("item: " .. dump(item))
|
||||
--print("placer: " .. dump(placer))
|
||||
--print("pos: " .. dump(pos))
|
||||
minetest.env:add_item(pos, 'CraftItem "' .. item .. '" 1')
|
||||
minetest.env:add_item(pos, 'craft "' .. item .. '" 1')
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -327,6 +337,87 @@ minetest.craftitem_eat = function(hp_change)
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Default material types
|
||||
--
|
||||
|
||||
function minetest.digprop_constanttime(time)
|
||||
return {
|
||||
diggability = "constant",
|
||||
constant_time = time,
|
||||
}
|
||||
end
|
||||
|
||||
function minetest.digprop_stonelike(toughness)
|
||||
return {
|
||||
diggablity = "normal",
|
||||
weight = toughness * 5,
|
||||
crackiness = 1,
|
||||
crumbliness = -0.1,
|
||||
cuttability = -0.2,
|
||||
}
|
||||
end
|
||||
|
||||
function minetest.digprop_dirtlike(toughness)
|
||||
return {
|
||||
diggablity = "normal",
|
||||
weight = toughness * 1.2,
|
||||
crackiness = 0,
|
||||
crumbliness = 1.2,
|
||||
cuttability = -0.4,
|
||||
}
|
||||
end
|
||||
|
||||
function minetest.digprop_gravellike(toughness)
|
||||
return {
|
||||
diggablity = "normal",
|
||||
weight = toughness * 2,
|
||||
crackiness = 0.2,
|
||||
crumbliness = 1.5,
|
||||
cuttability = -1.0,
|
||||
}
|
||||
end
|
||||
|
||||
function minetest.digprop_woodlike(toughness)
|
||||
return {
|
||||
diggablity = "normal",
|
||||
weight = toughness * 1.0,
|
||||
crackiness = 0.75,
|
||||
crumbliness = -1.0,
|
||||
cuttability = 1.5,
|
||||
}
|
||||
end
|
||||
|
||||
function minetest.digprop_leaveslike(toughness)
|
||||
return {
|
||||
diggablity = "normal",
|
||||
weight = toughness * (-0.5),
|
||||
crackiness = 0,
|
||||
crumbliness = 0,
|
||||
cuttability = 2.0,
|
||||
}
|
||||
end
|
||||
|
||||
function minetest.digprop_glasslike(toughness)
|
||||
return {
|
||||
diggablity = "normal",
|
||||
weight = toughness * 0.1,
|
||||
crackiness = 2.0,
|
||||
crumbliness = -1.0,
|
||||
cuttability = -1.0,
|
||||
}
|
||||
end
|
||||
|
||||
--
|
||||
-- Creative inventory
|
||||
--
|
||||
|
||||
minetest.creative_inventory = {}
|
||||
|
||||
minetest.add_to_creative_inventory = function(itemstring)
|
||||
table.insert(minetest.creative_inventory, itemstring)
|
||||
end
|
||||
|
||||
--
|
||||
-- Callback registration
|
||||
--
|
||||
@@ -344,6 +435,7 @@ minetest.registered_on_dignodes, minetest.register_on_dignode = make_registratio
|
||||
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_dieplayers, minetest.register_on_dieplayer = make_registration()
|
||||
minetest.registered_on_respawnplayers, minetest.register_on_respawnplayer = make_registration()
|
||||
|
||||
-- END
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
-- bucket (Minetest 0.4 mod)
|
||||
-- A bucket, which can pick up water and lava
|
||||
|
||||
minetest.alias_craftitem("bucket", "bucket:bucket_empty")
|
||||
minetest.alias_craftitem("bucket_water", "bucket:bucket_water")
|
||||
minetest.alias_craftitem("bucket_lava", "bucket:bucket_lava")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'CraftItem "bucket" 1',
|
||||
output = 'craft "bucket:bucket_empty" 1',
|
||||
recipe = {
|
||||
{'CraftItem "steel_ingot"', '', 'CraftItem "steel_ingot"'},
|
||||
{'', 'CraftItem "steel_ingot"', ''},
|
||||
{'craft "steel_ingot"', '', 'craft "steel_ingot"'},
|
||||
{'', 'craft "steel_ingot"', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bucket", {
|
||||
minetest.register_craftitem("bucket:bucket_empty", {
|
||||
image = "bucket.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
@@ -14,13 +21,13 @@ minetest.register_craftitem("bucket", {
|
||||
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
|
||||
if n.name == "default:water_source" then
|
||||
minetest.env:add_node(pointed_thing.under, {name="air"})
|
||||
player:add_to_inventory_later('CraftItem "bucket_water" 1')
|
||||
player:add_to_inventory_later('craft "bucket:bucket_water" 1')
|
||||
return true
|
||||
elseif n.name == "lava_source" then
|
||||
elseif n.name == "default:lava_source" then
|
||||
minetest.env:add_node(pointed_thing.under, {name="air"})
|
||||
player:add_to_inventory_later('CraftItem "bucket_lava" 1')
|
||||
player:add_to_inventory_later('craft "bucket:bucket_lava" 1')
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -28,7 +35,7 @@ minetest.register_craftitem("bucket", {
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bucket_water", {
|
||||
minetest.register_craftitem("bucket:bucket_water", {
|
||||
image = "bucket_water.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
@@ -36,21 +43,21 @@ minetest.register_craftitem("bucket_water", {
|
||||
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
|
||||
if n.name == "default: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"})
|
||||
elseif n.name == "default:water_flowing" or n.name == "default:lava_source" or n.name == "default:lava_flowing" then
|
||||
minetest.env:add_node(pointed_thing.under, {name="default:water_source"})
|
||||
else
|
||||
minetest.env:add_node(pointed_thing.above, {name="water_source"})
|
||||
minetest.env:add_node(pointed_thing.above, {name="default:water_source"})
|
||||
end
|
||||
player:add_to_inventory_later('CraftItem "bucket" 1')
|
||||
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("bucket_lava", {
|
||||
minetest.register_craftitem("bucket:bucket_lava", {
|
||||
image = "bucket_lava.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
@@ -58,14 +65,14 @@ minetest.register_craftitem("bucket_lava", {
|
||||
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
|
||||
if n.name == "default: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"})
|
||||
elseif n.name == "default:water_source" or n.name == "default:water_flowing" or n.name == "default:lava_flowing" then
|
||||
minetest.env:add_node(pointed_thing.under, {name="default:lava_source"})
|
||||
else
|
||||
minetest.env:add_node(pointed_thing.above, {name="lava_source"})
|
||||
minetest.env:add_node(pointed_thing.above, {name="default:lava_source"})
|
||||
end
|
||||
player:add_to_inventory_later('CraftItem "bucket" 1')
|
||||
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
||||
return true
|
||||
end
|
||||
return false
|
||||
|
||||
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 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: 210 B After Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 118 B |
|
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 933 B |
|
Before Width: | Height: | Size: 830 B After Width: | Height: | Size: 830 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 539 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 |
|
Before Width: | Height: | Size: 978 B 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: 936 B After Width: | Height: | Size: 936 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: 203 B After Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 965 B After Width: | Height: | Size: 965 B |
|
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: 242 B After Width: | Height: | Size: 242 B |
|
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 366 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: 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: 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 |
|
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 161 B |
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 186 B |
|
Before Width: | Height: | Size: 264 B 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 |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 291 B |
|
Before Width: | Height: | Size: 931 B After Width: | Height: | Size: 931 B |
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 301 B |
|
Before Width: | Height: | Size: 927 B After Width: | Height: | Size: 927 B |
|
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 255 B |
|
Before Width: | Height: | Size: 925 B After Width: | Height: | Size: 925 B |
|
Before Width: | Height: | Size: 913 B After Width: | Height: | Size: 913 B |
|
Before Width: | Height: | Size: 917 B After Width: | Height: | Size: 917 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 518 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
data/mods/default/textures/wieldhand.png
Normal file
|
After Width: | Height: | Size: 384 B |
@@ -2,29 +2,46 @@
|
||||
-- Experimental things
|
||||
--
|
||||
|
||||
-- For testing random stuff
|
||||
|
||||
function on_step(dtime)
|
||||
-- print("experimental on_step")
|
||||
--[[
|
||||
objs = minetest.env:get_objects_inside_radius({x=0,y=0,z=0}, 10)
|
||||
for k, obj in pairs(objs) do
|
||||
name = obj:get_player_name()
|
||||
if name then
|
||||
print(name.." at "..dump(obj:getpos()))
|
||||
print(name.." dir: "..dump(obj:get_look_dir()))
|
||||
print(name.." pitch: "..dump(obj:get_look_pitch()))
|
||||
print(name.." yaw: "..dump(obj:get_look_yaw()))
|
||||
else
|
||||
print("Some object at "..dump(obj:getpos()))
|
||||
end
|
||||
end
|
||||
--]]
|
||||
end
|
||||
minetest.register_globalstep(on_step)
|
||||
|
||||
-- An example furnace-thing implemented in Lua
|
||||
|
||||
minetest.register_node("luafurnace", {
|
||||
tile_images = {"lava.png", "furnace_side.png", "furnace_side.png",
|
||||
"furnace_side.png", "furnace_side.png", "furnace_front.png"},
|
||||
minetest.register_node("experimental:luafurnace", {
|
||||
tile_images = {"default_lava.png", "default_furnace_side.png",
|
||||
"default_furnace_side.png", "default_furnace_side.png",
|
||||
"default_furnace_side.png", "default_furnace_front.png"},
|
||||
--inventory_image = "furnace_front.png",
|
||||
inventory_image = inventorycube("furnace_front.png"),
|
||||
inventory_image = minetest.inventorycube("default_furnace_front.png"),
|
||||
paramtype = "facedir_simple",
|
||||
metadata_name = "generic",
|
||||
material = digprop_stonelike(3.0),
|
||||
material = minetest.digprop_stonelike(3.0),
|
||||
})
|
||||
|
||||
minetest.register_on_placenode(function(pos, newnode, placer)
|
||||
if newnode.name == "luafurnace" then
|
||||
print("get_meta");
|
||||
if newnode.name == "experimental:luafurnace" then
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
print("inventory_set_list");
|
||||
meta:inventory_set_list("fuel", {""})
|
||||
print("inventory_set_list");
|
||||
meta:inventory_set_list("src", {""})
|
||||
print("inventory_set_list");
|
||||
meta:inventory_set_list("dst", {"","","",""})
|
||||
print("set_inventory_draw_spec");
|
||||
meta:set_inventory_draw_spec(
|
||||
"invsize[8,9;]"
|
||||
.."list[current_name;fuel;2,3;1,1;]"
|
||||
@@ -34,15 +51,134 @@ minetest.register_on_placenode(function(pos, newnode, placer)
|
||||
)
|
||||
|
||||
local total_cooked = 0;
|
||||
print("set_string")
|
||||
meta:set_string("total_cooked", total_cooked)
|
||||
print("set_infotext");
|
||||
meta:set_infotext("Lua Furnace: total cooked: "..total_cooked)
|
||||
end
|
||||
end)
|
||||
|
||||
local get_item_definition = function(item)
|
||||
if not item then return nil end
|
||||
if item.type == "node" then
|
||||
return minetest.registered_nodes[item.name]
|
||||
elseif item.type == "craft" then
|
||||
return minetest.registered_craftitems[item.name]
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"luafurnace"},
|
||||
nodenames = {"experimental:luafurnace"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
for i, name in ipairs({
|
||||
"fuel_totaltime",
|
||||
"fuel_time",
|
||||
"src_totaltime",
|
||||
"src_time"
|
||||
}) do
|
||||
if not meta:get_string(name) then
|
||||
meta:set_string(name, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local inv = meta:get_inventory()
|
||||
|
||||
local fuelitem = inv:get_stack("fuel", 1):peek_item()
|
||||
local srcitem = inv:get_stack("src", 1):peek_item()
|
||||
--print("fuelitem="..dump(fuelitem))
|
||||
--print("srcitem="..dump(srcitem))
|
||||
|
||||
local was_active = false
|
||||
|
||||
local src_cooktime = -1
|
||||
local result_stackstring = nil
|
||||
|
||||
if srcitem then
|
||||
local prop = get_item_definition(srcitem)
|
||||
if prop and prop.cookresult_itemstring ~= "" then
|
||||
result_stackstring = prop.cookresult_itemstring
|
||||
src_cooktime = prop.furnace_cooktime or 3
|
||||
end
|
||||
end
|
||||
|
||||
print("src_cooktime="..dump(src_cooktime))
|
||||
print("result_stackstring="..dump(result_stackstring))
|
||||
|
||||
if tonumber(meta:get_string("fuel_time")) < tonumber(meta:get_string("fuel_totaltime")) then
|
||||
was_active = true
|
||||
meta:set_string("fuel_time", tonumber(meta:get_string("fuel_time")) + 1)
|
||||
meta:set_string("src_time", tonumber(meta:get_string("src_time")) + 1)
|
||||
--print("result_stackstring="..dump(result_stackstring))
|
||||
--print('tonumber(meta:get_string("src_time"))='..dump(tonumber(meta:get_string("src_time"))))
|
||||
--print("src_cooktime="..dump(src_cooktime))
|
||||
if result_stackstring and tonumber(meta:get_string("src_time")) >= src_cooktime and src_cooktime >= 0 then
|
||||
-- Put result in "dst" list
|
||||
success = inv:autoinsert_stackstring("dst", result_stackstring)
|
||||
if not success then
|
||||
print("Could not autoinsert '"..result_stackstring.."'")
|
||||
end
|
||||
-- If succeeded, take stuff from "src" list
|
||||
if success then
|
||||
srcstack = inv:get_stack("src", 1)
|
||||
srcstack:take_item()
|
||||
inv:set_stack("src", 1, srcstack)
|
||||
end
|
||||
meta:set_string("src_time", 0)
|
||||
end
|
||||
end
|
||||
|
||||
if tonumber(meta:get_string("fuel_time")) < tonumber(meta:get_string("fuel_totaltime")) then
|
||||
meta:set_infotext("Furnace active: "..(tonumber(meta:get_string("fuel_time"))/tonumber(meta:get_string("fuel_totaltime"))*100).."%")
|
||||
return
|
||||
end
|
||||
|
||||
local srcitem = inv:get_stack("src", 1):peek_item()
|
||||
|
||||
local src_cooktime = 0
|
||||
local result_stackstring = nil
|
||||
|
||||
if srcitem then
|
||||
local prop = get_item_definition(srcitem)
|
||||
if prop and prop.cookresult_itemstring ~= "" then
|
||||
result_stackstring = prop.cookresult_itemstring
|
||||
src_cooktime = prop.furnace_cooktime or 3
|
||||
end
|
||||
end
|
||||
|
||||
local fuelitem = inv:get_stack("fuel", 1):peek_item()
|
||||
|
||||
if not result_stackstring or not fuelitem then
|
||||
if was_active then
|
||||
meta:set_infotext("Furnace is empty")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local burntime = -1
|
||||
if fuelitem then
|
||||
local prop = get_item_definition(fuelitem)
|
||||
if prop then
|
||||
burntime = prop.furnace_burntime or -1
|
||||
end
|
||||
end
|
||||
|
||||
if burntime <= 0 then
|
||||
meta:set_infotext("Furnace out of fuel")
|
||||
return
|
||||
end
|
||||
|
||||
meta:set_string("fuel_totaltime", burntime)
|
||||
meta:set_string("fuel_time", 0)
|
||||
|
||||
local stack = inv:get_stack("fuel", 1)
|
||||
stack:take_item()
|
||||
inv:set_stack("fuel", 1, stack)
|
||||
end,
|
||||
})
|
||||
--[[
|
||||
minetest.register_abm({
|
||||
nodenames = {"experimental:luafurnace"},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
@@ -56,7 +192,7 @@ minetest.register_abm({
|
||||
_, srcitem = stackstring_take_item(srclist[1])
|
||||
_, fuelitem = stackstring_take_item(fuellist[1])
|
||||
if not srcitem or not fuelitem then return end
|
||||
if fuelitem.type == "NodeItem" then
|
||||
if fuelitem.type == "node" then
|
||||
local prop = minetest.registered_nodes[fuelitem.name]
|
||||
if prop == nil then return end
|
||||
if prop.furnace_burntime < 0 then return end
|
||||
@@ -64,7 +200,7 @@ minetest.register_abm({
|
||||
return
|
||||
end
|
||||
local resultstack = nil
|
||||
if srcitem.type == "NodeItem" then
|
||||
if srcitem.type == "node" then
|
||||
local prop = minetest.registered_nodes[srcitem.name]
|
||||
if prop == nil then return end
|
||||
if prop.cookresult_item == "" then return end
|
||||
@@ -95,13 +231,13 @@ minetest.register_abm({
|
||||
meta:set_infotext("Lua Furnace: total cooked: "..total_cooked)
|
||||
end,
|
||||
})
|
||||
|
||||
--]]
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "luafurnace" 1',
|
||||
output = 'node "experimental:luafurnace" 1',
|
||||
recipe = {
|
||||
{'NodeItem "cobble"', 'NodeItem "cobble"', 'NodeItem "cobble"'},
|
||||
{'NodeItem "cobble"', 'NodeItem "cobble"', 'NodeItem "cobble"'},
|
||||
{'NodeItem "cobble"', 'NodeItem "cobble"', 'NodeItem "cobble"'},
|
||||
{'node "default:cobble"', 'node "default:cobble"', 'node "default:cobble"'},
|
||||
{'node "default:cobble"', 'node "default:steel_ingot"', 'node "default:cobble"'},
|
||||
{'node "default:cobble"', 'node "default:cobble"', 'node "default:cobble"'},
|
||||
}
|
||||
})
|
||||
|
||||
@@ -110,8 +246,8 @@ minetest.register_craft({
|
||||
--
|
||||
|
||||
--[[
|
||||
minetest.register_tool("horribletool", {
|
||||
image = "lava.png",
|
||||
minetest.register_tool("experimental:horribletool", {
|
||||
image = "default_lava.png",
|
||||
basetime = 2.0
|
||||
dt_weight = 0.2
|
||||
dt_crackiness = 0.2
|
||||
@@ -125,16 +261,17 @@ minetest.register_tool("horribletool", {
|
||||
})
|
||||
--]]
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "somenode" 4',
|
||||
--[[minetest.register_craft({
|
||||
output = 'node "somenode" 4',
|
||||
recipe = {
|
||||
{'CraftItem "Stick" 1'},
|
||||
{'craft "default_tick" 1'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("somenode", {
|
||||
minetest.register_node("experimental:somenode", {
|
||||
tile_images = {"lava.png", "mese.png", "stone.png", "grass.png", "cobble.png", "tree_top.png"},
|
||||
inventory_image = "treeprop.png",
|
||||
inventory_image = minetest.inventorycube("lava.png", "mese.png", "stone.png"),
|
||||
--inventory_image = "treeprop.png",
|
||||
material = {
|
||||
diggability = "normal",
|
||||
weight = 0,
|
||||
@@ -144,37 +281,50 @@ minetest.register_node("somenode", {
|
||||
flammability = 0
|
||||
},
|
||||
metadata_name = "chest",
|
||||
})
|
||||
})]]
|
||||
|
||||
--
|
||||
-- TNT (not functional)
|
||||
--
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "TNT" 4',
|
||||
output = 'node "experimental:tnt" 4',
|
||||
recipe = {
|
||||
{'NodeItem "wood" 1'},
|
||||
{'CraftItem "lump_of_coal" 1'},
|
||||
{'NodeItem "wood" 1'}
|
||||
{'node "default:wood" 1'},
|
||||
{'craft "default:coal_lump" 1'},
|
||||
{'node "default:wood" 1'}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("TNT", {
|
||||
tile_images = {"tnt_top.png", "tnt_bottom.png", "tnt_side.png", "tnt_side.png", "tnt_side.png", "tnt_side.png"},
|
||||
inventory_image = "tnt_side.png",
|
||||
minetest.register_node("experimental:tnt", {
|
||||
tile_images = {"default_tnt_top.png", "default_tnt_bottom.png",
|
||||
"default_tnt_side.png", "default_tnt_side.png",
|
||||
"default_tnt_side.png", "default_tnt_side.png"},
|
||||
inventory_image = minetest.inventorycube("default_tnt_top.png",
|
||||
"default_tnt_side.png", "default_tnt_side.png"),
|
||||
dug_item = '', -- Get nothing
|
||||
material = {
|
||||
diggability = "not",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_on_punchnode(function(p, node)
|
||||
if node.name == "experimental:tnt" then
|
||||
minetest.env:remove_node(p)
|
||||
minetest.env:add_entity(p, "experimental:tnt")
|
||||
nodeupdate(p)
|
||||
end
|
||||
end)
|
||||
|
||||
local TNT = {
|
||||
-- Static definition
|
||||
physical = true, -- Collides with things
|
||||
-- weight = 5,
|
||||
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
|
||||
visual = "cube",
|
||||
textures = {"tnt_top.png","tnt_bottom.png","tnt_side.png","tnt_side.png","tnt_side.png","tnt_side.png"},
|
||||
textures = {"default_tnt_top.png", "default_tnt_bottom.png",
|
||||
"default_tnt_side.png", "default_tnt_side.png",
|
||||
"default_tnt_side.png", "default_tnt_side.png"},
|
||||
-- Initial value for our timer
|
||||
timer = 0,
|
||||
-- Number of punches required to defuse
|
||||
@@ -213,7 +363,7 @@ function TNT:on_punch(hitter)
|
||||
self.health = self.health - 1
|
||||
if self.health <= 0 then
|
||||
self.object:remove()
|
||||
hitter:add_to_inventory("NodeItem TNT 1")
|
||||
hitter:add_to_inventory("node TNT 1")
|
||||
hitter:set_hp(hitter:get_hp() - 1)
|
||||
end
|
||||
end
|
||||
@@ -225,16 +375,18 @@ function TNT:on_rightclick(clicker)
|
||||
--self.object:moveto(pos, false)
|
||||
end
|
||||
|
||||
print("TNT dump: "..dump(TNT))
|
||||
--print("TNT dump: "..dump(TNT))
|
||||
--print("Registering TNT");
|
||||
minetest.register_entity("experimental:tnt", TNT)
|
||||
|
||||
print("Registering TNT");
|
||||
minetest.register_entity("TNT", TNT)
|
||||
-- Add TNT's old name also
|
||||
minetest.alias_node("TNT", "experimental:tnt")
|
||||
|
||||
--
|
||||
-- A test entity for testing animated and yaw-modulated sprites
|
||||
--
|
||||
|
||||
minetest.register_entity("testentity", {
|
||||
minetest.register_entity("experimental:testentity", {
|
||||
-- Static definition
|
||||
physical = true, -- Collides with things
|
||||
-- weight = 5,
|
||||
@@ -259,7 +411,7 @@ minetest.register_entity("testentity", {
|
||||
|
||||
on_punch = function(self, hitter)
|
||||
self.object:remove()
|
||||
hitter:add_to_inventory('CraftItem testobject1 1')
|
||||
hitter:add_to_inventory('craft testobject1 1')
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -280,8 +432,8 @@ minetest.register_on_generated(function(minp, maxp)
|
||||
end)
|
||||
|
||||
-- Example setting get
|
||||
print("setting max_users = " .. dump(minetest.setting_get("max_users")))
|
||||
print("setting asdf = " .. dump(minetest.setting_get("asdf")))
|
||||
--print("setting max_users = " .. dump(minetest.setting_get("max_users")))
|
||||
--print("setting asdf = " .. dump(minetest.setting_get("asdf")))
|
||||
|
||||
minetest.register_on_chat_message(function(name, message)
|
||||
--[[print("on_chat_message: name="..dump(name).." message="..dump(message))
|
||||
@@ -395,4 +547,6 @@ minetest.register_abm({
|
||||
end,
|
||||
})--]]
|
||||
|
||||
print("experimental modpath="..dump(minetest.get_modpath("experimental")))
|
||||
|
||||
-- END
|
||||
|
||||
@@ -2,11 +2,11 @@ minetest.register_on_newplayer(function(player)
|
||||
print("on_newplayer")
|
||||
if minetest.setting_getbool("give_initial_stuff") then
|
||||
print("giving give_initial_stuff to player")
|
||||
player:add_to_inventory('ToolItem "SteelPick" 0')
|
||||
player:add_to_inventory('NodeItem "torch" 99')
|
||||
player:add_to_inventory('ToolItem "SteelAxe" 0')
|
||||
player:add_to_inventory('ToolItem "SteelShovel" 0')
|
||||
player:add_to_inventory('NodeItem "cobble" 99')
|
||||
player:add_to_inventory('tool "SteelPick" 0')
|
||||
player:add_to_inventory('node "torch" 99')
|
||||
player:add_to_inventory('tool "SteelAxe" 0')
|
||||
player:add_to_inventory('tool "SteelShovel" 0')
|
||||
player:add_to_inventory('node "cobble" 99')
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
2
data/mods/legacy/depends.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
default
|
||||
|
||||
101
data/mods/legacy/init.lua
Normal file
@@ -0,0 +1,101 @@
|
||||
-- legacy (Minetest 0.4 mod)
|
||||
-- Provides as much backwards-compatibility as feasible
|
||||
|
||||
--
|
||||
-- Aliases to support loading 0.3 and old 0.4 worlds and inventories
|
||||
--
|
||||
|
||||
minetest.alias_node("stone", "default:stone")
|
||||
minetest.alias_node("dirt_with_grass", "default:dirt_with_grass")
|
||||
minetest.alias_node("dirt_with_grass_footsteps", "default:dirt_with_grass_footsteps")
|
||||
minetest.alias_node("dirt", "default:dirt")
|
||||
minetest.alias_node("sand", "default:sand")
|
||||
minetest.alias_node("gravel", "default:gravel")
|
||||
minetest.alias_node("sandstone", "default:sandstone")
|
||||
minetest.alias_node("clay", "default:clay")
|
||||
minetest.alias_node("brick", "default:brick")
|
||||
minetest.alias_node("tree", "default:tree")
|
||||
minetest.alias_node("jungletree", "default:jungletree")
|
||||
minetest.alias_node("junglegrass", "default:junglegrass")
|
||||
minetest.alias_node("leaves", "default:leaves")
|
||||
minetest.alias_node("cactus", "default:cactus")
|
||||
minetest.alias_node("papyrus", "default:papyrus")
|
||||
minetest.alias_node("bookshelf", "default:bookshelf")
|
||||
minetest.alias_node("glass", "default:glass")
|
||||
minetest.alias_node("wooden_fence", "default:fence_wood")
|
||||
minetest.alias_node("rail", "default:rail")
|
||||
minetest.alias_node("ladder", "default:ladder")
|
||||
minetest.alias_node("wood", "default:wood")
|
||||
minetest.alias_node("mese", "default:mese")
|
||||
minetest.alias_node("cloud", "default:cloud")
|
||||
minetest.alias_node("water_flowing", "default:water_flowing")
|
||||
minetest.alias_node("water_source", "default:water_source")
|
||||
minetest.alias_node("lava_flowing", "default:lava_flowing")
|
||||
minetest.alias_node("lava_source", "default:lava_source")
|
||||
minetest.alias_node("torch", "default:torch")
|
||||
minetest.alias_node("sign_wall", "default:sign_wall")
|
||||
minetest.alias_node("furnace", "default:furnace")
|
||||
minetest.alias_node("chest", "default:chest")
|
||||
minetest.alias_node("locked_chest", "default:chest_locked")
|
||||
minetest.alias_node("cobble", "default:cobble")
|
||||
minetest.alias_node("mossycobble", "default:mossycobble")
|
||||
minetest.alias_node("steelblock", "default:steelblock")
|
||||
minetest.alias_node("nyancat", "default:nyancat")
|
||||
minetest.alias_node("nyancat_rainbow", "default:nyancat_rainbow")
|
||||
minetest.alias_node("sapling", "default:sapling")
|
||||
minetest.alias_node("apple", "default:apple")
|
||||
|
||||
minetest.alias_tool("WPick", "default:pick_wood")
|
||||
minetest.alias_tool("STPick", "default:pick_stone")
|
||||
minetest.alias_tool("SteelPick", "default:pick_steel")
|
||||
minetest.alias_tool("MesePick", "default:pick_mese")
|
||||
minetest.alias_tool("WShovel", "default:shovel_wood")
|
||||
minetest.alias_tool("STShovel", "default:shovel_stone")
|
||||
minetest.alias_tool("SteelShovel", "default:shovel_steel")
|
||||
minetest.alias_tool("WAxe", "default:axe_wood")
|
||||
minetest.alias_tool("STAxe", "default:axe_stone")
|
||||
minetest.alias_tool("SteelAxe", "default:axe_steel")
|
||||
minetest.alias_tool("WSword", "default:sword_wood")
|
||||
minetest.alias_tool("STSword", "default:sword_stone")
|
||||
minetest.alias_tool("SteelSword", "default:sword_steel")
|
||||
|
||||
minetest.alias_craftitem("Stick", "default:stick")
|
||||
minetest.alias_craftitem("paper", "default:paper")
|
||||
minetest.alias_craftitem("book", "default:book")
|
||||
minetest.alias_craftitem("lump_of_coal", "default:coal_lump")
|
||||
minetest.alias_craftitem("lump_of_iron", "default:iron_lump")
|
||||
minetest.alias_craftitem("lump_of_clay", "default:clay_lump")
|
||||
minetest.alias_craftitem("steel_ingot", "default:steel_ingot")
|
||||
minetest.alias_craftitem("clay_brick", "default:clay_brick")
|
||||
minetest.alias_craftitem("scorched_stuff", "default:scorched_stuff")
|
||||
minetest.alias_craftitem("apple", "default:apple")
|
||||
|
||||
--
|
||||
-- Old items
|
||||
--
|
||||
|
||||
minetest.register_craftitem(":rat", {
|
||||
image = "rat.png",
|
||||
cookresult_itemstring = 'craft "cooked_rat" 1',
|
||||
on_drop = function(item, dropper, pos)
|
||||
minetest.env:add_rat(pos)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem(":cooked_rat", {
|
||||
image = "cooked_rat.png",
|
||||
cookresult_itemstring = 'craft "scorched_stuff" 1',
|
||||
on_place_on_ground = minetest.craftitem_place_item,
|
||||
on_use = minetest.craftitem_eat(6),
|
||||
})
|
||||
|
||||
minetest.register_craftitem(":firefly", {
|
||||
image = "firefly.png",
|
||||
on_drop = function(item, dropper, pos)
|
||||
minetest.env:add_firefly(pos)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
-- END
|
||||
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 239 B |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
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: 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: 250 B After Width: | Height: | Size: 250 B |
|
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 341 B |
|
Before Width: | Height: | Size: 920 B After Width: | Height: | Size: 920 B |
@@ -131,12 +131,14 @@
|
||||
#default_password =
|
||||
# Available privileges: build, teleport, settime, privs, shout
|
||||
#default_privs = build, shout
|
||||
# Whether players are transferred to client without any range limit
|
||||
#unlimited_player_transfer_distance = true
|
||||
# Whether to enable players killing each other
|
||||
#enable_pvp = true
|
||||
|
||||
# Profiler data print interval. #0 = disable.
|
||||
#profiler_print_interval = 0
|
||||
#enable_mapgen_debug_info = false
|
||||
# Player and object positions are sent at intervals specified by this
|
||||
#objectdata_interval = 0.2
|
||||
#active_object_send_range_blocks = 3
|
||||
#active_block_range = 2
|
||||
#max_simultaneous_block_sends_per_client = 2
|
||||
@@ -146,8 +148,8 @@
|
||||
#time_send_interval = 20
|
||||
# Length of day/night cycle. 72=20min, 360=4min, 1=24hour
|
||||
#time_speed = 72
|
||||
#server_unload_unused_data_timeout = 60
|
||||
#server_map_save_interval = 60
|
||||
#server_unload_unused_data_timeout = 29
|
||||
#server_map_save_interval = 5.3
|
||||
#full_block_send_enable_min_time_from_building = 2.0
|
||||
# Set to true to enable experimental features or stuff that is tested
|
||||
# (varies from version to version, usually not useful at all)
|
||||
|
||||