]> git.lizzy.rs Git - Crafter.git/commitdiff
Move placing sound serverside
authoroilboi <47129783+oilboi@users.noreply.github.com>
Wed, 4 Mar 2020 22:34:48 +0000 (17:34 -0500)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Wed, 4 Mar 2020 22:34:48 +0000 (17:34 -0500)
mods/craftingtable/init.lua
mods/main/sounds.lua
mods/player/init.lua
todo.txt

index 01c66e89492f56b88d647a85b6f0c5cdee7d4486..9323ba62e59364bded5bfbefe66442773af3d713 100644 (file)
@@ -2,7 +2,7 @@
 
 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(),
index 746a2bdcb70c3b8ee98abc2f097aecce74f98968..3d25511488c6d4f91a93b1d1a6204b20b8902c5e 100644 (file)
@@ -6,7 +6,7 @@ function main.stoneSound(table)
                   {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
@@ -20,7 +20,7 @@ function main.woodSound(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
@@ -35,7 +35,7 @@ function main.sandSound(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}
@@ -51,7 +51,7 @@ function main.grassSound(table)
                   {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
@@ -64,7 +64,7 @@ function main.dirtSound(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
index 5deda04e750a6a57435bc4252982f5a86d5bd4e7..66a0c8ed8b23b4ffa84ce40fc84a85940c664bdc 100644 (file)
@@ -37,14 +37,12 @@ end)
 --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)))
@@ -257,3 +255,13 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
                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)
index 467d9372fced72bde67feb8dd4f87c74706fcced..e9b37c5a3024144e04a2007699cd8f0a42c3d603 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -43,12 +43,8 @@ ALPHA STATE CHANGELOG
 -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