minetest.register_node("craftingtable:craftingtable", {
description = "Crafting Table",
- tiles = {"crafting_workbench_top.png", "default_wood.png", "crafting_workbench_side.png",
+ tiles = {"crafting_workbench_top.png", "wood.png", "crafting_workbench_side.png",
"crafting_workbench_side.png", "crafting_workbench_front.png", "crafting_workbench_front.png"},
groups = {wood = 1, hard = 1, axe = 1, hand = 3,pathable = 1},
sounds = main.woodSound(),
{name = "stone", gain = 0.1}
table.dug = table.dug or
{name = "stone", gain = 1.0}
- table.place = table.place or
+ table.placing = table.placing or
{name = "stone", gain = 1.0}
--default.node_sound_defaults(table)
return table
{name = "wood", gain = 0.2}
table.dug = table.dug or
{name = "wood", gain = 1.0}
- table.place = table.place or
+ table.placing = table.placing or
{name = "wood", gain = 1.0}
--default.node_sound_defaults(table)
return table
{name = "sand", gain = 0.07}
table.dug = table.dug or
{name = "sand", gain = 0.09}
- table.place = table.place or
+ table.placing = table.placing or
{name = "sand", gain = 0.09}
table.fall = table.fall or
{name = "sand", gain = 0.01}
{name = "leaves", gain = 0.2}
table.dug = table.dug or
{name = "leaves", gain = 1.0}
- table.place = table.place or
+ table.placing = table.placing or
{name = "leaves", gain = 0.5}
--default.node_sound_defaults(table)
return table
{name = "dirt", gain = 0.3}
table.dug = table.dug or
{name = "dirt", gain = 1.0}
- table.place = table.place or
+ table.placing = table.placing or
{name = "dirt", gain = 0.5}
--default.node_sound_defaults(table)
return table
--throw all items on death
minetest.register_on_dieplayer(function(player, reason)
local pos = player:getpos()
- print(reason)
local inv = player:get_inventory()
for i = 1,inv:get_size("main") do
local stack = inv:get_stack("main", i)
local name = stack:get_name()
local count = stack:get_count()
- print(name)
if name ~= "" then
local obj = minetest.add_item(pos, name.." "..count)
obj:setvelocity(vector.new(math.random(-3,3),math.random(4,8),math.random(-3,3)))
end
end,pos, newnode, placer, oldnode, itemstack, pointed_thing,old)
end)
+
+--play sound to keep up with player's placing vs inconsistent client placing sound
+minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
+ local sound = minetest.registered_nodes[newnode.name].sounds.placing
+ minetest.sound_play(sound.name, {
+ pos = pos,
+ gain = sound.gain,
+ --pitch = math.random(60,100)/100
+ })
+end)
-Crafting bench
-Farming with hoes, grass drops seeds, bread, etc
-simplify mobs ai
-running out of a node when placing tries to replace it with another of the same item in inventory
-
-make mobs pathfind again when moving into new node
-
-
-crafting bench
+-running out of a node when placing tries to replace it with another of the same item in inventory
+-crafting bench