]> git.lizzy.rs Git - Crafter.git/commitdiff
Add in functioning Redstone
authoroilboi <47129783+oilboi@users.noreply.github.com>
Sat, 22 Feb 2020 00:29:36 +0000 (19:29 -0500)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Sat, 22 Feb 2020 00:29:36 +0000 (19:29 -0500)
23 files changed:
mods/main/settings.lua
mods/minecart/rail.lua
mods/redstone/depends.txt [new file with mode: 0644]
mods/redstone/init.lua [new file with mode: 0644]
mods/redstone/oldcode.txty [new file with mode: 0644]
mods/redstone/textures/rail.png [new file with mode: 0644]
mods/redstone/textures/railcross.png [new file with mode: 0644]
mods/redstone/textures/railcurve.png [new file with mode: 0644]
mods/redstone/textures/railt.png [new file with mode: 0644]
mods/redstone/textures/redstone_cross.png [new file with mode: 0644]
mods/redstone/textures/redstone_dust.png [new file with mode: 0644]
mods/redstone/textures/redstone_dust_item.png [new file with mode: 0644]
mods/redstone/textures/redstone_dust_main.png [new file with mode: 0644]
mods/redstone/textures/redstone_redstone_dust_line1.png [new file with mode: 0644]
mods/redstone/textures/redstone_t.png [new file with mode: 0644]
mods/redstone/textures/redstone_torch.png [new file with mode: 0644]
mods/redstone/textures/redstone_torch_animated.png [new file with mode: 0644]
mods/redstone/textures/redstone_turn.png [new file with mode: 0644]
mods/redstone/torch.lua [new file with mode: 0644]
mods/redstone/wire [new file with mode: 0644]
mods/redstone/wire.lua [new file with mode: 0644]
mods/torch/init.lua
todo.txt

index 0280d34c2fb67425e46fcff60ce23dae11e692bb..10545aaf25c882b6e70e804455974da646bf36c2 100644 (file)
@@ -4,6 +4,7 @@ local old = settings:get("dedicated_server_step")
 
 settings:set("dedicated_server_step", 0.00001)
 settings:set("liquid_update", 0.25)
+settings:set("abm_interval", 0.25)
 
 print("Changing server step from "..old.." to 0.00001")
 print("Changing liquid update to ")
index 35e8493312d204da61076d177ff0363a05dc3468..389ac1c89e4296de2dd57cfd0d2d00319d6a2d43 100644 (file)
@@ -1,16 +1,10 @@
 minetest.register_node("minecart:rail",{
       description = "Rail",
       wield_image = "rail.png",
-      tiles = {
-            "stone.png", "stone.png",
-            "stone.png", "stone.png"
-      },
-      --[[
       tiles = {
             "rail.png", "railcurve.png",
             "railt.png", "railcross.png"
       },
-      ]]--
       drawtype = "raillike",
       paramtype = "light",
       sunlight_propagates = true,
@@ -26,10 +20,10 @@ minetest.register_node("minecart:rail",{
                   return
             end
             local pos = pointed_thing.above
-            if minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name].walkable then
+            if minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name].walkable and minetest.get_node(pointed_thing.above).name == "air" then
                   minetest.set_node(pointed_thing.above, {name="minecart:rail"})
                   itemstack:take_item(1)
-                  print(minetest.get_node(pointed_thing.above).param1)
+                  --print(minetest.get_node(pointed_thing.above).param1)
                   return(itemstack)
             end
       end,
diff --git a/mods/redstone/depends.txt b/mods/redstone/depends.txt
new file mode 100644 (file)
index 0000000..ba2906d
--- /dev/null
@@ -0,0 +1 @@
+main
diff --git a/mods/redstone/init.lua b/mods/redstone/init.lua
new file mode 100644 (file)
index 0000000..d835d50
--- /dev/null
@@ -0,0 +1,136 @@
+--[[
+
+redstone powder is raillike
+
+check if solid block above
+--if so, do not conduct above
+
+uses height level to do powerlevel
+
+uses lightlevel
+a function for adding and removing redstone level
+
+]]--
+
+
+
+---set a torch source
+
+
+
+local path = minetest.get_modpath("redstone")
+dofile(path.."/wire.lua")
+dofile(path.."/torch.lua")
+
+redstone = {}
+
+--3d plane direct neighbor
+function redstone.update(pos,oldnode)
+      local old_max_level = minetest.registered_nodes[minetest.get_node(pos).name].power
+      --recover old info
+      if not old_max_level then
+            print("recovering")
+            old_max_level = minetest.registered_nodes[oldnode.name].power
+      end
+
+      local max_level = 0
+      for x = -1,1 do
+      for y = -1,1 do
+      for z = -1,1 do
+            if math.abs(x)+math.abs(y)+math.abs(z) == 1 then
+                  local pos2 = vector.add(pos,vector.new(x,y,z))
+                  local level2 = minetest.registered_nodes[minetest.get_node(pos2).name].power
+                  if level2 and level2 > max_level then
+                        max_level = level2 - 1
+                  end
+            end
+      end
+      end
+      end
+
+      --print(max_level)
+      if old_max_level and old_max_level > max_level then
+            max_level = 0
+      end
+      --change to dust
+      if minetest.get_node_group(minetest.get_node(pos).name, "redstone_dust") > 0 then
+            minetest.set_node(pos, {name="redstone:dust_"..max_level})
+      end
+
+      for x = -1,1 do
+      for y = -1,1 do
+      for z = -1,1 do
+            if math.abs(x)+math.abs(y)+math.abs(z) == 1 then
+                  local pos2 = vector.add(pos,vector.new(x,y,z))
+                  local level2 = minetest.registered_nodes[minetest.get_node(pos2).name].power
+                  if level2 and (level2 < max_level or level2 < old_max_level) then
+                        redstone.update(pos2)
+                  end
+            end
+      end
+      end
+      end
+end
+
+
+
+
+minetest.register_craftitem("redstone:dust", {
+      description = "Redstone Dust",
+      inventory_image = "redstone_dust_item.png",
+      wield_image = "redstone_dust_item.png",
+      wield_scale = {x = 1, y = 1, z = 1 + 1/16},
+      liquids_pointable = false,
+      on_place = function(itemstack, placer, pointed_thing)
+            if not pointed_thing.type == "node" then
+                  return
+            end
+            local pos = pointed_thing.above
+            if minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name].walkable and minetest.get_node(pointed_thing.above).name == "air" then
+                  minetest.add_node(pointed_thing.above, {name="redstone:dust_0"})
+                  itemstack:take_item(1)
+                  --print(minetest.get_node(pointed_thing.above).param1)
+                  minetest.after(0,function(pointed_thing)
+                        minetest.punch_node(pointed_thing.above)
+                  end,pointed_thing)
+                  return(itemstack)
+            end
+      end,
+})
+
+
+--8 power levels 8 being the highest
+local color = 0
+for i = 0,8 do
+      local coloring = math.floor(color)
+      minetest.register_node("redstone:dust_"..i,{
+            description = "Redstone Dust",
+            wield_image = "redstone_dust_item.png",
+            tiles = {
+                  "redstone_dust_main.png^[colorize:red:"..coloring, "redstone_turn.png^[colorize:red:"..coloring,
+                  "redstone_t.png^[colorize:red:"..coloring, "redstone_cross.png^[colorize:red:"..coloring
+            },
+            power=i,
+            drawtype = "raillike",
+            paramtype = "light",
+            sunlight_propagates = true,
+            is_ground_content = false,
+            walkable = false,
+            node_placement_prediction = "",
+            selection_box = {
+                  type = "fixed",
+                  fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
+            },
+            groups={instant=1,attached=1,redstone_dust=1,redstone=1},
+            drop="redstone:dust",
+            on_punch = function(pos, node, puncher, pointed_thing)
+                  redstone.update(pos)
+            end,
+            on_dig = function(pos, node, digger)
+                  minetest.node_dig(pos, node, digger)
+                  redstone.update(pos,node)
+            end,
+      })
+      color= color +31.875
+end
+
diff --git a/mods/redstone/oldcode.txty b/mods/redstone/oldcode.txty
new file mode 100644 (file)
index 0000000..0533882
--- /dev/null
@@ -0,0 +1,71 @@
+minetest.register_node("redstone:wire",{
+      description = "Redstone Dust",
+      wield_image = "redstone_dust_item.png",
+      paramtype = "light",
+      drawtype = "nodebox",
+      --paramtype2 = "wallmounted",
+      walkable = false,
+      node_box = {
+            type = "connected",
+            --{xmin, ymin, zmin, xmax, ymax, zmax}
+
+            fixed = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/16},
+            
+            disconnected_sides  = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
+
+            connect_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
+            -- connect_bottom =
+            connect_front = {-1/16, -1/2, -1/2, 1/16, -7/16, 1/16},
+            connect_left =  {-1/2, -1/2, -1/16, 1/16, -7/16, 1/16},
+            connect_back =  {-1/16, -1/2, -1/16, 1/16, -7/16, 1/2},
+            connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
+      },
+      collision_box = {
+            type = "connected",
+            --{xmin, ymin, zmin, xmax, ymax, zmax}
+
+            fixed = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/16},
+            -- connect_top =
+            -- connect_bottom =
+            connect_front = {-1/16, -1/2, -1/2, 1/16, -7/16, 1/16},
+            connect_left =  {-1/2, -1/2, -1/16, 1/16, -7/16, 1/16},
+            connect_back =  {-1/16, -1/2, -1/16, 1/16, -7/16, 1/2},
+            connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
+      },
+      connects_to = {"group:redstone"},
+      inventory_image = fence_texture,
+      wield_image = fence_texture,
+      tiles = {"redstone_dust.png"},
+      sunlight_propagates = true,
+      is_ground_content = false,
+      groups = {redstone =1, instant=1},
+      on_place = function(itemstack, placer, pointed_thing)
+            if pointed_thing.type ~= "node" then
+                  return itemstack
+            end
+
+            local wdir = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.under,pointed_thing.above))
+
+            local fakestack = itemstack
+            local retval = false
+            if wdir < 1 then
+                  return itemstack
+            elseif wdir == 1 then
+                  retval = fakestack:set_name("redstone:dust")
+            else
+                  retval = fakestack:set_name("redstone:dust")
+            end
+            if not retval then
+                  return itemstack
+            end
+            itemstack, retval = minetest.item_place(fakestack, placer, pointed_thing, wdir)
+            itemstack:set_name("redstone:dust")
+
+            if retval then
+                  minetest.sound_play("stone", {pos=pointed_thing.above, gain = 1.0})
+            end
+
+            return itemstack
+            
+      end,
+})
diff --git a/mods/redstone/textures/rail.png b/mods/redstone/textures/rail.png
new file mode 100644 (file)
index 0000000..4f25f6b
Binary files /dev/null and b/mods/redstone/textures/rail.png differ
diff --git a/mods/redstone/textures/railcross.png b/mods/redstone/textures/railcross.png
new file mode 100644 (file)
index 0000000..409f14b
Binary files /dev/null and b/mods/redstone/textures/railcross.png differ
diff --git a/mods/redstone/textures/railcurve.png b/mods/redstone/textures/railcurve.png
new file mode 100644 (file)
index 0000000..1633230
Binary files /dev/null and b/mods/redstone/textures/railcurve.png differ
diff --git a/mods/redstone/textures/railt.png b/mods/redstone/textures/railt.png
new file mode 100644 (file)
index 0000000..f25c510
Binary files /dev/null and b/mods/redstone/textures/railt.png differ
diff --git a/mods/redstone/textures/redstone_cross.png b/mods/redstone/textures/redstone_cross.png
new file mode 100644 (file)
index 0000000..0b23a20
Binary files /dev/null and b/mods/redstone/textures/redstone_cross.png differ
diff --git a/mods/redstone/textures/redstone_dust.png b/mods/redstone/textures/redstone_dust.png
new file mode 100644 (file)
index 0000000..465de2b
Binary files /dev/null and b/mods/redstone/textures/redstone_dust.png differ
diff --git a/mods/redstone/textures/redstone_dust_item.png b/mods/redstone/textures/redstone_dust_item.png
new file mode 100644 (file)
index 0000000..30c42e4
Binary files /dev/null and b/mods/redstone/textures/redstone_dust_item.png differ
diff --git a/mods/redstone/textures/redstone_dust_main.png b/mods/redstone/textures/redstone_dust_main.png
new file mode 100644 (file)
index 0000000..3219df3
Binary files /dev/null and b/mods/redstone/textures/redstone_dust_main.png differ
diff --git a/mods/redstone/textures/redstone_redstone_dust_line1.png b/mods/redstone/textures/redstone_redstone_dust_line1.png
new file mode 100644 (file)
index 0000000..61ebb2c
Binary files /dev/null and b/mods/redstone/textures/redstone_redstone_dust_line1.png differ
diff --git a/mods/redstone/textures/redstone_t.png b/mods/redstone/textures/redstone_t.png
new file mode 100644 (file)
index 0000000..486e6e8
Binary files /dev/null and b/mods/redstone/textures/redstone_t.png differ
diff --git a/mods/redstone/textures/redstone_torch.png b/mods/redstone/textures/redstone_torch.png
new file mode 100644 (file)
index 0000000..6a047fc
Binary files /dev/null and b/mods/redstone/textures/redstone_torch.png differ
diff --git a/mods/redstone/textures/redstone_torch_animated.png b/mods/redstone/textures/redstone_torch_animated.png
new file mode 100644 (file)
index 0000000..1a9addf
Binary files /dev/null and b/mods/redstone/textures/redstone_torch_animated.png differ
diff --git a/mods/redstone/textures/redstone_turn.png b/mods/redstone/textures/redstone_turn.png
new file mode 100644 (file)
index 0000000..9a94f3e
Binary files /dev/null and b/mods/redstone/textures/redstone_turn.png differ
diff --git a/mods/redstone/torch.lua b/mods/redstone/torch.lua
new file mode 100644 (file)
index 0000000..6177198
--- /dev/null
@@ -0,0 +1,199 @@
+--get point where particle spawner is added
+local function get_offset(wdir)
+      local z = 0
+      local x = 0
+      if wdir == 4 then
+            z = 0.25
+      elseif wdir == 2 then
+            x = 0.25
+      elseif wdir == 5 then
+            z = -0.25
+      elseif wdir == 3 then
+            x = -0.25
+      end
+      return {x = x, y = 0.27, z = z}      
+end
+
+--remove smoke and fire
+local function delete_ps(pos)
+      local meta = minetest.get_meta(pos)
+      minetest.delete_particlespawner(meta:get_int("psf"))
+      minetest.delete_particlespawner(meta:get_int("pss"))
+end
+
+--add in smoke and fire
+local function create_ps(pos)
+      local dir = get_offset(minetest.get_node(pos).param2)
+      local ppos = vector.add(dir,pos)
+      local meta = minetest.get_meta(pos)
+      local psf = minetest.add_particlespawner({
+            amount = 2,
+            time = 0,
+            minpos = ppos,
+            maxpos = ppos,
+            minvel = vector.new(0,0,0),
+            maxvel = vector.new(0,0,0),
+            minacc = {x=0, y=0, z=0},
+            maxacc = {x=0, y=0, z=0},
+            minexptime = 1,
+            maxexptime = 1,
+            minsize = 3,
+            maxsize = 3,
+            collisiondetection = false,
+            vertical = true,
+            texture = "redstone_torch_animated.png",
+            animation = {type = "vertical_frames",
+
+                  aspect_w = 16,
+                  -- Width of a frame in pixels
+
+                  aspect_h = 16,
+                  -- Height of a frame in pixels
+
+                  length =  0.2,
+                  -- Full loop length
+            },
+      })
+      local pss = minetest.add_particlespawner({
+            amount = 2,
+            time = 0,
+            minpos = ppos,
+            maxpos = ppos,
+            minvel = vector.new(-0.1,0.1,-0.1),
+            maxvel = vector.new(0.1,0.3,0.1),
+            minacc = vector.new(0,0,0),
+            maxacc = vector.new(0,0,0),
+            minexptime = 1,
+            maxexptime = 2,
+            minsize = 1,
+            maxsize = 2,
+            collisiondetection = false,
+            vertical = false,
+            texture = "smoke.png",
+      })
+      meta:set_int("psf", psf)
+      meta:set_int("pss", pss)
+end
+
+--reload smoke and flame on load
+minetest.register_lbm({
+      name = "redstone:torch",
+      nodenames = {"redstone:torch_floor","redstone:torch_wall"},
+      run_at_every_load = true,
+      action = function(pos, node)
+            create_ps(pos)
+      end,
+})
+
+-- Item definitions
+minetest.register_craftitem("redstone:torch", {
+      description = "Redstone Torch",
+      inventory_image = "redstone_torch.png",
+      wield_image = "redstone_torch.png",
+      wield_scale = {x = 1, y = 1, z = 1 + 1/16},
+      liquids_pointable = false,
+      power = 8,
+      on_place = function(itemstack, placer, pointed_thing)
+            if pointed_thing.type ~= "node" then
+                  return itemstack
+            end
+
+            local wdir = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.under,pointed_thing.above))
+
+            local fakestack = itemstack
+            local retval = false
+            if wdir < 1 then
+                  return itemstack
+            elseif wdir == 1 then
+                  retval = fakestack:set_name("redstone:torch_floor")
+            else
+                  retval = fakestack:set_name("redstone:torch_wall")
+            end
+            if not retval then
+                  return itemstack
+            end
+            itemstack, retval = minetest.item_place(fakestack, placer, pointed_thing, wdir)
+            itemstack:set_name("redstone:torch")
+
+            if retval then
+                  minetest.sound_play("wood", {pos=pointed_thing.above, gain = 1.0})
+            end
+
+            return itemstack
+      end
+})
+
+minetest.register_node("redstone:torch_floor", {
+      inventory_image = "redstone_torch.png",
+      wield_image = "redstone_torch.png",
+      wield_scale = {x = 1, y = 1, z = 1 + 2/16},
+      drawtype = "mesh",
+      mesh = "torch_floor.obj",
+      tiles = {"redstone_torch.png"},
+      paramtype = "light",
+      paramtype2 = "none",
+      power = 8,
+      sunlight_propagates = true,
+      drop = "redstone:torch",
+      walkable = false,
+      light_source = 13,
+      groups = {choppy=2, dig_immediate=3, not_in_creative_inventory=1, attached_node=1, torch=1,redstone=1,connect_to_raillike=1},
+      legacy_wallmounted = true,
+      selection_box = {
+            type = "fixed",
+            fixed = {-1/16, -0.5, -1/16, 1/16, 2/16, 1/16},
+      },
+      on_construct = function(pos)
+            create_ps(pos)
+            redstone.update(pos)
+      end,
+      after_destruct = function(pos, oldnode)
+            redstone.update(pos,oldnode)
+      end,
+      on_destruct = function(pos)
+            delete_ps(pos)
+      end,
+      sounds = main.woodSound(),
+})
+
+minetest.register_node("redstone:torch_wall", {
+      inventory_image = "redstone_torch.png",
+      wield_image = "redstone_torch.png",
+      wield_scale = {x = 1, y = 1, z = 1 + 1/16},
+      drawtype = "mesh",
+      mesh = "torch_wall.obj",
+      tiles = {"redstone_torch.png"},
+      paramtype = "light",
+      paramtype2 = "wallmounted",
+      sunlight_propagates = true,
+      walkable = false,
+      light_source = 13,
+      power = 8,
+      groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1,redstone=1,redstone_torch=1,connect_to_raillike=1},
+      drop = "redstone:torch",
+      selection_box = {
+            type = "wallmounted",
+            wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1},
+            wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.1, 0.1},
+            wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1},
+      },
+      on_construct = function(pos)
+            create_ps(pos)
+            redstone.update(pos)
+      end,
+      after_destruct = function(pos, oldnode)
+            redstone.update(pos,oldnode)
+      end,
+      on_destruct = function(pos)
+            delete_ps(pos)
+      end,
+      sounds = main.woodSound(),
+})
+
+minetest.register_craft({
+      output = "redstone:torch 4",
+      recipe = {
+            {"redstone:dust"},
+            {"main:stick"}
+      }
+})
diff --git a/mods/redstone/wire b/mods/redstone/wire
new file mode 100644 (file)
index 0000000..9ada885
--- /dev/null
@@ -0,0 +1,42 @@
+minetest.register_node("redstone:wire",{
+      description = "Redstone Dust",
+      wield_image = "redstone_dust_item.png",
+      paramtype = "light",
+      drawtype = "nodebox",
+      --paramtype2 = "wallmounted",
+      walkable = false,
+      node_box = {
+            type = "connected",
+            --{xmin, ymin, zmin, xmax, ymax, zmax}
+
+            fixed = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/16},
+            
+            disconnected_sides  = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
+
+            connect_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
+            -- connect_bottom =
+            connect_front = {-1/16, -1/2, -1/2, 1/16, -7/16, 1/16},
+            connect_left =  {-1/2, -1/2, -1/16, 1/16, -7/16, 1/16},
+            connect_back =  {-1/16, -1/2, -1/16, 1/16, -7/16, 1/2},
+            connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
+      },
+      collision_box = {
+            type = "connected",
+            --{xmin, ymin, zmin, xmax, ymax, zmax}
+
+            fixed = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/16},
+            -- connect_top =
+            -- connect_bottom =
+            connect_front = {-1/16, -1/2, -1/2, 1/16, -7/16, 1/16},
+            connect_left =  {-1/2, -1/2, -1/16, 1/16, -7/16, 1/16},
+            connect_back =  {-1/16, -1/2, -1/16, 1/16, -7/16, 1/2},
+            connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
+      },
+      connects_to = {"group:redstone"},
+      inventory_image = fence_texture,
+      wield_image = fence_texture,
+      tiles = {"redstone_dust.png"},
+      sunlight_propagates = true,
+      is_ground_content = false,
+      groups = {redstone =1, instant=1},
+})
diff --git a/mods/redstone/wire.lua b/mods/redstone/wire.lua
new file mode 100644 (file)
index 0000000..cefe748
--- /dev/null
@@ -0,0 +1,42 @@
+minetest.register_node("redstone:wire",{
+      description = "Redstone Wire",
+      wield_image = "redstone_dust.png",
+      paramtype = "light",
+      drawtype = "nodebox",
+      --paramtype2 = "wallmounted",
+      walkable = false,
+      node_box = {
+            type = "connected",
+            --{xmin, ymin, zmin, xmax, ymax, zmax}
+
+            fixed = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/16},
+            
+            disconnected_sides  = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
+
+            connect_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
+            -- connect_bottom =
+            connect_front = {-1/16, -1/2, -1/2, 1/16, -7/16, 1/16},
+            connect_left =  {-1/2, -1/2, -1/16, 1/16, -7/16, 1/16},
+            connect_back =  {-1/16, -1/2, -1/16, 1/16, -7/16, 1/2},
+            connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
+      },
+      collision_box = {
+            type = "connected",
+            --{xmin, ymin, zmin, xmax, ymax, zmax}
+
+            fixed = {-1/16, -1/2, -1/16, 1/16, -7/16, 1/16},
+            -- connect_top =
+            -- connect_bottom =
+            connect_front = {-1/16, -1/2, -1/2, 1/16, -7/16, 1/16},
+            connect_left =  {-1/2, -1/2, -1/16, 1/16, -7/16, 1/16},
+            connect_back =  {-1/16, -1/2, -1/16, 1/16, -7/16, 1/2},
+            connect_right = {-1/16, -1/2, -1/16, 1/2, -7/16, 1/16},
+      },
+      connects_to = {"group:redstone"},
+      inventory_image = fence_texture,
+      wield_image = fence_texture,
+      tiles = {"redstone_dust.png"},
+      sunlight_propagates = true,
+      is_ground_content = false,
+      groups = {redstone =1, instant=1},
+})
index a0d252c922324610b339c2728ba3695f4326af29..f1949ad9761e0719cf7b174e3e864e8d78cdbedd 100644 (file)
@@ -92,11 +92,11 @@ minetest.register_craftitem("torch:torch", {
       wield_image = "torches_torch.png",
       wield_scale = {x = 1, y = 1, z = 1 + 1/16},
       liquids_pointable = false,
-         on_place = function(itemstack, placer, pointed_thing)
+      on_place = function(itemstack, placer, pointed_thing)
             if pointed_thing.type ~= "node" then
                   return itemstack
             end
-            
+
             local wdir = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.under,pointed_thing.above))
 
             local fakestack = itemstack
@@ -113,7 +113,7 @@ minetest.register_craftitem("torch:torch", {
             end
             itemstack, retval = minetest.item_place(fakestack, placer, pointed_thing, wdir)
             itemstack:set_name("torch:torch")
-            
+
             if retval then
                   minetest.sound_play("wood", {pos=pointed_thing.above, gain = 1.0})
             end
index 2a38349710fa2414fe510c0b510310e502c15789..2d262197e656c92cc79922f577038566e455e838 100644 (file)
--- a/todo.txt
+++ b/todo.txt
 --water flow faster
 --torches with particle
 --make a mob
+
 --fix tools causing crash on pigs with no fleshy definition
 --ladders - only placeable on walls
 --eating animation - particles? - entity?
 --boats
-make entities push against players
+--make falling item have fall soundspec
+--rebalance sand audio
+
+
+
 redstone - make nodes drop multiple items individually
+
+
+
+
+make entities push against players
 rewrite the item collection to magnetize using the possible application below
 crafting bench
 fishing
@@ -40,7 +50,9 @@ if placed last node put another stack into hand
 have falling node hurt player?
 add a function to set a velocity goal to entities and then implement it with all entities
 ^make a value if below then stop?
-
+colored chat messages
+check if everyone is in bed before going to next night
+also lock player in bed until they get out or daytime
 
 open bugs:
 fix torches not deleting particles when mounted node dug <- meta glitch?