summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
Diffstat (limited to 'games')
-rw-r--r--games/minimal/mods/default/init.lua181
-rw-r--r--games/minimal/mods/default/mapgen.lua1
-rw-r--r--games/minimal/mods/default/textures/default_chest.pngbin0 -> 263 bytes
-rw-r--r--games/minimal/mods/default/textures/default_chest_front.pngbin114 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/default_chest_lock.pngbin145 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/default_chest_side.pngbin98 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/default_chest_top.pngbin93 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/default_lava_source_animated.pngbin2902 -> 3145 bytes
-rw-r--r--games/minimal/mods/default/textures/default_river_water.pngbin0 -> 716 bytes
-rw-r--r--games/minimal/mods/errorhandler_test/init.lua106
-rw-r--r--games/minimal/mods/experimental/init.lua53
-rw-r--r--games/minimal/mods/stairs/init.lua4
12 files changed, 191 insertions, 154 deletions
diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua
index bff7860e3..fcdf93547 100644
--- a/games/minimal/mods/default/init.lua
+++ b/games/minimal/mods/default/init.lua
@@ -18,6 +18,8 @@ dofile(minetest.get_modpath("default").."/mapgen.lua")
minetest.register_on_joinplayer(function(player)
local cb = function(player)
minetest.chat_send_player(player:get_player_name(), "This is the [minimal] \"Minimal Development Test\" game. Use [minetest_game] for the real thing.")
+ player:set_attribute("test_attribute", "test_me")
+ player:set_attribute("remove_this", nil)
end
minetest.after(2.0, cb, player)
end)
@@ -39,10 +41,15 @@ minetest.register_item(":", {
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3},
- }
+ },
+ damage_groups = {fleshy=1},
}
})
+--
+-- Picks
+--
+
minetest.register_tool("default:pick_wood", {
description = "Wooden Pickaxe",
inventory_image = "default_tool_woodpick.png",
@@ -50,7 +57,8 @@ minetest.register_tool("default:pick_wood", {
max_drop_level=0,
groupcaps={
cracky={times={[2]=2.00, [3]=1.20}, uses=10, maxlevel=1}
- }
+ },
+ damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:pick_stone", {
@@ -60,7 +68,8 @@ minetest.register_tool("default:pick_stone", {
max_drop_level=0,
groupcaps={
cracky={times={[1]=2.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1}
- }
+ },
+ damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:pick_steel", {
@@ -70,7 +79,8 @@ minetest.register_tool("default:pick_steel", {
max_drop_level=1,
groupcaps={
cracky={times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=10, maxlevel=2}
- }
+ },
+ damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:pick_mese", {
@@ -83,9 +93,15 @@ minetest.register_tool("default:pick_mese", {
cracky={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
crumbly={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
snappy={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}
- }
+ },
+ damage_groups = {fleshy=4},
},
})
+
+--
+-- Shovels
+--
+
minetest.register_tool("default:shovel_wood", {
description = "Wooden Shovel",
inventory_image = "default_tool_woodshovel.png",
@@ -93,7 +109,8 @@ minetest.register_tool("default:shovel_wood", {
max_drop_level=0,
groupcaps={
crumbly={times={[1]=2.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1}
- }
+ },
+ damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:shovel_stone", {
@@ -103,7 +120,8 @@ minetest.register_tool("default:shovel_stone", {
max_drop_level=0,
groupcaps={
crumbly={times={[1]=1.20, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1}
- }
+ },
+ damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:shovel_steel", {
@@ -113,9 +131,15 @@ minetest.register_tool("default:shovel_steel", {
max_drop_level=1,
groupcaps={
crumbly={times={[1]=1.00, [2]=0.70, [3]=0.60}, uses=10, maxlevel=2}
- }
+ },
+ damage_groups = {fleshy=4},
},
})
+
+--
+-- Axes
+--
+
minetest.register_tool("default:axe_wood", {
description = "Wooden Axe",
inventory_image = "default_tool_woodaxe.png",
@@ -124,7 +148,8 @@ minetest.register_tool("default:axe_wood", {
groupcaps={
choppy={times={[2]=1.40, [3]=0.80}, uses=10, maxlevel=1},
fleshy={times={[2]=1.50, [3]=0.80}, uses=10, maxlevel=1}
- }
+ },
+ damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:axe_stone", {
@@ -135,7 +160,8 @@ minetest.register_tool("default:axe_stone", {
groupcaps={
choppy={times={[1]=1.50, [2]=1.00, [3]=0.60}, uses=20, maxlevel=1},
fleshy={times={[2]=1.30, [3]=0.70}, uses=20, maxlevel=1}
- }
+ },
+ damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:axe_steel", {
@@ -146,9 +172,15 @@ minetest.register_tool("default:axe_steel", {
groupcaps={
choppy={times={[1]=2.00, [2]=1.60, [3]=1.00}, uses=10, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=40, maxlevel=1}
- }
+ },
+ damage_groups = {fleshy=3},
},
})
+
+--
+-- Swords
+--
+
minetest.register_tool("default:sword_wood", {
description = "Wooden Sword",
inventory_image = "default_tool_woodsword.png",
@@ -159,7 +191,8 @@ minetest.register_tool("default:sword_wood", {
fleshy={times={[2]=1.10, [3]=0.60}, uses=10, maxlevel=1},
snappy={times={[2]=1.00, [3]=0.50}, uses=10, maxlevel=1},
choppy={times={[3]=1.00}, uses=20, maxlevel=0}
- }
+ },
+ damage_groups = {fleshy=2},
}
})
minetest.register_tool("default:sword_stone", {
@@ -172,7 +205,8 @@ minetest.register_tool("default:sword_stone", {
fleshy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
snappy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
choppy={times={[3]=0.90}, uses=20, maxlevel=0}
- }
+ },
+ damage_groups = {fleshy=4},
}
})
minetest.register_tool("default:sword_steel", {
@@ -185,7 +219,8 @@ minetest.register_tool("default:sword_steel", {
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
choppy={times={[3]=0.70}, uses=40, maxlevel=0}
- }
+ },
+ damage_groups = {fleshy=6},
}
})
@@ -957,37 +992,37 @@ minetest.register_node("default:cloud", {
minetest.register_node("default:water_flowing", {
description = "Water (flowing)",
- inventory_image = minetest.inventorycube("default_water.png"),
drawtype = "flowingliquid",
- tiles ={"default_water.png"},
+ tiles = {"default_water.png"},
special_tiles = {
- {name="default_water.png", backface_culling=false},
- {name="default_water.png", backface_culling=true},
+ {name = "default_water.png", backface_culling = false},
+ {name = "default_water.png", backface_culling = true},
},
alpha = WATER_ALPHA,
paramtype = "light",
+ paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
+ drop = "",
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = WATER_VISC,
- post_effect_color = {a=64, r=100, g=100, b=200},
- groups = {water=3, liquid=3},
+ post_effect_color = {a = 64, r = 100, g = 100, b = 200},
+ groups = {water = 3, liquid = 3},
})
minetest.register_node("default:water_source", {
description = "Water",
- inventory_image = minetest.inventorycube("default_water.png"),
drawtype = "liquid",
- tiles ={"default_water.png"},
+ tiles = {"default_water.png"},
special_tiles = {
-- New-style water source material (mostly unused)
- {name="default_water.png", backface_culling=false},
+ {name = "default_water.png", backface_culling = false},
},
alpha = WATER_ALPHA,
paramtype = "light",
@@ -996,13 +1031,70 @@ minetest.register_node("default:water_source", {
diggable = false,
buildable_to = true,
is_ground_content = false,
+ drop = "",
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = WATER_VISC,
- post_effect_color = {a=64, r=100, g=100, b=200},
- groups = {water=3, liquid=3},
+ post_effect_color = {a = 64, r = 100, g = 100, b = 200},
+ groups = {water = 3, liquid = 3},
+})
+
+minetest.register_node("default:river_water_source", {
+ description = "River Water Source",
+ drawtype = "liquid",
+ tiles = {"default_river_water.png"},
+ special_tiles = {
+ -- New-style water source material (mostly unused)
+ {name = "default_river_water.png", backface_culling = false},
+ },
+ alpha = 160,
+ paramtype = "light",
+ walkable = false,
+ pointable = false,
+ diggable = false,
+ buildable_to = true,
+ is_ground_content = false,
+ drop = "",
+ drowning = 1,
+ liquidtype = "source",
+ liquid_alternative_flowing = "default:river_water_flowing",
+ liquid_alternative_source = "default:river_water_source",
+ liquid_viscosity = 1,
+ liquid_renewable = false,
+ liquid_range = 2,
+ post_effect_color = {a = 103, r = 30, g = 76, b = 90},
+ groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
+})
+
+minetest.register_node("default:river_water_flowing", {
+ description = "Flowing River Water",
+ drawtype = "flowingliquid",
+ tiles = {"default_river_water.png"},
+ special_tiles = {
+ {name = "default_river_water.png", backface_culling = false},
+ {name = "default_river_water.png", backface_culling = true},
+ },
+ alpha = 160,
+ paramtype = "light",
+ paramtype2 = "flowingliquid",
+ walkable = false,
+ pointable = false,
+ diggable = false,
+ buildable_to = true,
+ is_ground_content = false,
+ drop = "",
+ drowning = 1,
+ liquidtype = "flowing",
+ liquid_alternative_flowing = "default:river_water_flowing",
+ liquid_alternative_source = "default:river_water_source",
+ liquid_viscosity = 1,
+ liquid_renewable = false,
+ liquid_range = 2,
+ post_effect_color = {a = 103, r = 30, g = 76, b = 90},
+ groups = {water = 3, liquid = 3, puts_out_fire = 1,
+ not_in_creative_inventory = 1, cools_lava = 1},
})
minetest.register_node("default:lava_flowing", {
@@ -1044,8 +1136,11 @@ minetest.register_node("default:lava_source", {
inventory_image = minetest.inventorycube("default_lava.png"),
drawtype = "liquid",
--tiles ={"default_lava.png"},
- tiles ={
- {name="default_lava_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
+ tiles = {
+ {
+ name = "default_lava_source_animated.png",
+ animation = {type="sheet_2d", frames_w=3, frames_h=2, frame_length=0.5}
+ }
},
special_tiles = {
-- New-style lava source material (mostly unused)
@@ -1130,8 +1225,9 @@ minetest.register_node("default:sign_wall", {
minetest.register_node("default:chest", {
description = "Chest",
- tiles ={"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
- "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
+ tiles ={"default_chest.png^[sheet:2x2:0,0", "default_chest.png^[sheet:2x2:0,0",
+ "default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,0",
+ "default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:0,1"},
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,
@@ -1164,8 +1260,9 @@ end
minetest.register_node("default:chest_locked", {
description = "Locked Chest",
- tiles ={"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
- "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
+ tiles ={"default_chest.png^[sheet:2x2:0,0", "default_chest.png^[sheet:2x2:0,0",
+ "default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,0",
+ "default_chest.png^[sheet:2x2:1,0", "default_chest.png^[sheet:2x2:1,1"},
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
legacy_facedir_simple = true,
@@ -1188,6 +1285,8 @@ minetest.register_node("default:chest_locked", {
meta:set_string("owner", "")
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
+ -- this is not really the intended usage but works for testing purposes:
+ meta:mark_as_private("owner")
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
@@ -1349,13 +1448,13 @@ minetest.register_abm({
local srclist = inv:get_list("src")
local cooked = nil
-
+
if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
-
+
local was_active = false
-
+
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
@@ -1375,7 +1474,7 @@ minetest.register_abm({
meta:set_string("src_time", 0)
end
end
-
+
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
@@ -1400,7 +1499,7 @@ minetest.register_abm({
local cooked = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")
-
+
if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
@@ -1426,7 +1525,7 @@ minetest.register_abm({
meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0)
-
+
local stack = inv:get_stack("fuel", 1)
stack:take_item()
inv:set_stack("fuel", 1, stack)
@@ -1533,7 +1632,7 @@ function default.grow_tree(data, a, pos, is_apple_tree, seed)
y = y+th-1 -- (x, y, z) is now last piece of trunk
local leaves_a = VoxelArea:new{MinEdge={x=-2, y=-1, z=-2}, MaxEdge={x=2, y=2, z=2}}
local leaves_buffer = {}
-
+
-- Force leaves near the trunk
local d = 1
for xi = -d, d do
@@ -1543,14 +1642,14 @@ function default.grow_tree(data, a, pos, is_apple_tree, seed)
end
end
end
-
+
-- Add leaves randomly
for iii = 1, 8 do
local d = 1
local xx = pr:next(leaves_a.MinEdge.x, leaves_a.MaxEdge.x - d)
local yy = pr:next(leaves_a.MinEdge.y, leaves_a.MaxEdge.y - d)
local zz = pr:next(leaves_a.MinEdge.z, leaves_a.MaxEdge.z - d)
-
+
for xi = 0, d do
for yi = 0, d do
for zi = 0, d do
@@ -1559,7 +1658,7 @@ function default.grow_tree(data, a, pos, is_apple_tree, seed)
end
end
end
-
+
-- Add the leaves
for xi = leaves_a.MinEdge.x, leaves_a.MaxEdge.x do
for yi = leaves_a.MinEdge.y, leaves_a.MaxEdge.y do
diff --git a/games/minimal/mods/default/mapgen.lua b/games/minimal/mods/default/mapgen.lua
index 65b67dae5..30a865366 100644
--- a/games/minimal/mods/default/mapgen.lua
+++ b/games/minimal/mods/default/mapgen.lua
@@ -8,6 +8,7 @@ minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
minetest.register_alias("mapgen_sand", "default:sand")
minetest.register_alias("mapgen_water_source", "default:water_source")
+minetest.register_alias("mapgen_river_water_source", "default:river_water_source")
minetest.register_alias("mapgen_lava_source", "default:lava_source")
minetest.register_alias("mapgen_gravel", "default:gravel")
diff --git a/games/minimal/mods/default/textures/default_chest.png b/games/minimal/mods/default/textures/default_chest.png
new file mode 100644
index 000000000..9746a3fd9
--- /dev/null
+++ b/games/minimal/mods/default/textures/default_chest.png
Binary files differ
diff --git a/games/minimal/mods/default/textures/default_chest_front.png b/games/minimal/mods/default/textures/default_chest_front.png
deleted file mode 100644
index 55b076c35..000000000
--- a/games/minimal/mods/default/textures/default_chest_front.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/default_chest_lock.png b/games/minimal/mods/default/textures/default_chest_lock.png
deleted file mode 100644
index 4b2d1af6c..000000000
--- a/games/minimal/mods/default/textures/default_chest_lock.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/default_chest_side.png b/games/minimal/mods/default/textures/default_chest_side.png
deleted file mode 100644
index ae4847cb6..000000000
--- a/games/minimal/mods/default/textures/default_chest_side.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/default_chest_top.png b/games/minimal/mods/default/textures/default_chest_top.png
deleted file mode 100644
index ac41551b0..000000000
--- a/games/minimal/mods/default/textures/default_chest_top.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/default_lava_source_animated.png b/games/minimal/mods/default/textures/default_lava_source_animated.png
index aa9d57cf1..54f4c0ddd 100644
--- a/games/minimal/mods/default/textures/default_lava_source_animated.png
+++ b/games/minimal/mods/default/textures/default_lava_source_animated.png
Binary files differ
diff --git a/games/minimal/mods/default/textures/default_river_water.png b/games/minimal/mods/default/textures/default_river_water.png
new file mode 100644
index 000000000..3b55c5f66
--- /dev/null
+++ b/games/minimal/mods/default/textures/default_river_water.png
Binary files differ
diff --git a/games/minimal/mods/errorhandler_test/init.lua b/games/minimal/mods/errorhandler_test/init.lua
deleted file mode 100644
index 9d1535c1d..000000000
--- a/games/minimal/mods/errorhandler_test/init.lua
+++ /dev/null
@@ -1,106 +0,0 @@
---
--- exception handler test module
---
---
--- To avoid this from crashing the module will startup in inactive mode.
--- to make specific errors happen you need to cause them by following
--- chat command:
---
--- exceptiontest <location> <errortype>
---
--- location has to be one of:
--- * mapgen: cause in next on_generate call
--- * entity_step: spawn a entity and make it do error in on_step
--- * globalstep: do error in next globalstep
--- * immediate: cause right in chat handler
---
--- errortypes defined are:
--- * segv: make sigsegv happen
--- * zerodivision: cause a division by zero to happen
--- * exception: throw an exception
-
-if core.cause_error == nil or
- type(core.cause_error) ~= "function" then
- return
-end
-
-
-core.log("action", "WARNING: loading exception handler test module!")
-
-local exceptiondata = {
- tocause = "none",
- mapgen = false,
- entity_step = false,
- globalstep = false,
-}
-
-local exception_entity =
-{
- on_step = function(self, dtime)
- if exceptiondata.entity_step then
- core.cause_error(exceptiondata.tocause)
- end
- end,
-}
-local exception_entity_name = "errorhandler_test:error_entity"
-
-local function exception_chat_handler(playername, param)
- local parameters = param:split(" ")
-
- if #parameters ~= 2 then
- core.chat_send_player(playername, "Invalid argument count for exceptiontest")
- end
-
- core.log("error", "Causing error at:" .. parameters[1])
-
- if parameters[1] == "mapgen" then
- exceptiondata.tocause = parameters[2]
- exceptiondata.mapgen = true
- elseif parameters[1] == "entity_step" then
- --spawn entity at player location
- local player = core.get_player_by_name(playername)
-
- if player:is_player() then
- local pos = player:getpos()
-
- core.add_entity(pos, exception_entity_name)
- end
-
- exceptiondata.tocause = parameters[2]
- exceptiondata.entity_step = true
-
- elseif parameters[1] == "globalstep" then
- exceptiondata.tocause = parameters[2]
- exceptiondata.globalstep = true
-
- elseif parameters[1] == "immediate" then
- core.cause_error(parameters[2])
-
- else
- core.chat_send_player(playername, "Invalid error location: " .. dump(parameters[1]))
- end
-end
-
-core.register_chatcommand("exceptiontest",
- {
- params = "<location> <errortype>",
- description = "cause a given error to happen.\n" ..
- " location=(mapgen,entity_step,globalstep,immediate)\n" ..
- " errortype=(segv,zerodivision,exception)",
- func = exception_chat_handler,
- privs = { server=true }
- })
-
-core.register_globalstep(function(dtime)
- if exceptiondata.globalstep then
- core.cause_error(exceptiondata.tocause)
- end
-end)
-
-core.register_on_generated(function(minp, maxp, blockseed)
- if exceptiondata.mapgen then
- core.cause_error(exceptiondata.tocause)
- end
-end)
-
-core.register_entity(exception_entity_name, exception_entity)
diff --git a/games/minimal/mods/experimental/init.lua b/games/minimal/mods/experimental/init.lua
index 729191bce..6e0fb1738 100644
--- a/games/minimal/mods/experimental/init.lua
+++ b/games/minimal/mods/experimental/init.lua
@@ -28,7 +28,7 @@ minetest.after(1.0, switch_player_visual)
]]
minetest.register_node("experimental:soundblock", {
- tile_images = {"unknown_node.png", "default_tnt_bottom.png",
+ tiles = {"unknown_node.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("unknown_node.png",
@@ -120,7 +120,7 @@ minetest.register_craft({
})
minetest.register_node("experimental:tnt", {
- tile_images = {"default_tnt_top.png", "default_tnt_bottom.png",
+ tiles = {"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",
@@ -453,7 +453,7 @@ minetest.register_abm({
minetest.register_node("experimental:tester_node_1", {
description = "Tester Node 1 (construct/destruct/timer)",
- tile_images = {"wieldhand.png"},
+ tiles = {"wieldhand.png"},
groups = {oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
-- This was known to cause a bug in minetest.item_place_node() when used
@@ -502,10 +502,16 @@ minetest.register_craftitem("experimental:tester_tool_1", {
on_use = function(itemstack, user, pointed_thing)
--print(dump(pointed_thing))
if pointed_thing.type == "node" then
- if minetest.get_node(pointed_thing.under).name == "experimental:tester_node_1" then
+ local node = minetest.get_node(pointed_thing.under)
+ if node.name == "experimental:tester_node_1" or node.name == "default:chest" then
local p = pointed_thing.under
minetest.log("action", "Tester tool used at "..minetest.pos_to_string(p))
- minetest.dig_node(p)
+ if node.name == "experimental:tester_node_1" then
+ minetest.dig_node(p)
+ else
+ minetest.get_meta(p):mark_as_private({"infotext", "formspec"})
+ minetest.chat_send_player(user:get_player_name(), "Verify that chest is unusable now.")
+ end
else
local p = pointed_thing.above
minetest.log("action", "Tester tool used at "..minetest.pos_to_string(p))
@@ -523,6 +529,43 @@ minetest.register_craft({
}
})
+minetest.register_craftitem("experimental:tester_tool_2", {
+ description = "Tester Tool 2",
+ inventory_image = "experimental_tester_tool_1.png^[invert:g",
+ on_use = function(itemstack, user, pointed_thing)
+ local pos = minetest.get_pointed_thing_position(pointed_thing, true)
+ if pos == nil then return end
+ pos = vector.add(pos, {x=0, y=0.5, z=0})
+ local tex, anim
+ if math.random(0, 1) == 0 then
+ tex = "default_lava_source_animated.png"
+ anim = {type="sheet_2d", frames_w=3, frames_h=2, frame_length=0.5}
+ else
+ tex = "default_lava_flowing_animated.png"
+ anim = {type="vertical_frames", aspect_w=16, aspect_h=16, length=3.3}
+ end
+
+ minetest.add_particle({
+ pos = pos,
+ velocity = {x=0, y=0, z=0},
+ acceleration = {x=0, y=0.04, z=0},
+ expirationtime = 6,
+ collisiondetection = true,
+ texture = tex,
+ animation = anim,
+ size = 4,
+ glow = math.random(0, 5),
+ })
+ end,
+})
+
+minetest.register_craft({
+ output = 'experimental:tester_tool_2',
+ recipe = {
+ {'group:crumbly','group:crumbly'},
+ }
+})
+
--[[minetest.register_on_joinplayer(function(player)
minetest.after(3, function()
player:set_inventory_formspec("size[8,7.5]"..
diff --git a/games/minimal/mods/stairs/init.lua b/games/minimal/mods/stairs/init.lua
index 4929d1370..c3bbc561e 100644
--- a/games/minimal/mods/stairs/init.lua
+++ b/games/minimal/mods/stairs/init.lua
@@ -5,7 +5,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description)
minetest.register_node("stairs:stair_" .. subname, {
description = description,
drawtype = "nodebox",
- tile_images = images,
+ tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
@@ -34,7 +34,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description)
minetest.register_node("stairs:slab_" .. subname, {
description = description,
drawtype = "nodebox",
- tile_images = images,
+ tiles = images,
paramtype = "light",
is_ground_content = true,
groups = groups,