diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2016-04-01 22:10:20 -0400 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2016-04-01 22:42:02 -0400 |
commit | 86ad3e7c6a37699f7f8297a387bf08af74e36629 (patch) | |
tree | dc368b1eaf2cc09b9df2200250890b3038d8cf2d /technic/tools | |
parent | 888b0ebfec8c2eff9015163549a7e47443cb8665 (diff) | |
download | dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.gz dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.bz2 dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.xz dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.zip |
Update all core mods
Diffstat (limited to 'technic/tools')
-rw-r--r-- | technic/tools/chainsaw.lua | 16 | ||||
-rw-r--r-- | technic/tools/mining_lasers.lua | 63 |
2 files changed, 11 insertions, 68 deletions
diff --git a/technic/tools/chainsaw.lua b/technic/tools/chainsaw.lua index bf4efff..3653d2d 100644 --- a/technic/tools/chainsaw.lua +++ b/technic/tools/chainsaw.lua @@ -9,15 +9,19 @@ local chainsaw_leaves = true -- The default trees local timber_nodenames = { - ["default:jungletree"] = true, - ["default:papyrus"] = true, - ["default:cactus"] = true, - ["default:tree"] = true, - ["default:apple"] = true, - ["default:pinetree"] = true, + ["default:acacia_tree"] = true, + ["default:aspen_tree"] = true, + ["default:jungletree"] = true, + ["default:papyrus"] = true, + ["default:cactus"] = true, + ["default:tree"] = true, + ["default:apple"] = true, + ["default:pine_tree"] = true, } if chainsaw_leaves then + timber_nodenames["default:acacia_leaves"] = true + timber_nodenames["default:aspen_leaves"] = true timber_nodenames["default:leaves"] = true timber_nodenames["default:jungleleaves"] = true timber_nodenames["default:pine_needles"] = true diff --git a/technic/tools/mining_lasers.lua b/technic/tools/mining_lasers.lua index 4c83ae9..c09aa92 100644 --- a/technic/tools/mining_lasers.lua +++ b/technic/tools/mining_lasers.lua @@ -32,67 +32,6 @@ minetest.register_craft({ } }) --- Based on code by Uberi: https://gist.github.com/Uberi/3125280 -local function rayIter(pos, dir, range) - local p = vector.round(pos) - local x_step, y_step, z_step = 0, 0, 0 - local x_component, y_component, z_component = 0, 0, 0 - local x_intersect, y_intersect, z_intersect = 0, 0, 0 - - if dir.x == 0 then - x_intersect = math.huge - elseif dir.x > 0 then - x_step = 1 - x_component = 1 / dir.x - x_intersect = x_component - else - x_step = -1 - x_component = 1 / -dir.x - end - if dir.y == 0 then - y_intersect = math.huge - elseif dir.y > 0 then - y_step = 1 - y_component = 1 / dir.y - y_intersect = y_component - else - y_step = -1 - y_component = 1 / -dir.y - end - if dir.z == 0 then - z_intersect = math.huge - elseif dir.z > 0 then - z_step = 1 - z_component = 1 / dir.z - z_intersect = z_component - else - z_step = -1 - z_component = 1 / -dir.z - end - - return function() - if x_intersect < y_intersect then - if x_intersect < z_intersect then - p.x = p.x + x_step - x_intersect = x_intersect + x_component - else - p.z = p.z + z_step - z_intersect = z_intersect + z_component - end - elseif y_intersect < z_intersect then - p.y = p.y + y_step - y_intersect = y_intersect + y_component - else - p.z = p.z + z_step - z_intersect = z_intersect + z_component - end - if vector.distance(pos, p) > range then - return nil - end - return p - end -end - local function laser_node(pos, node, player) local def = minetest.registered_nodes[node.name] if def and def.liquidtype ~= "none" then @@ -132,7 +71,7 @@ local function laser_shoot(player, range, particle_texture, sound) texture = particle_texture .. "^[transform" .. math.random(0, 7), }) minetest.sound_play(sound, {pos = player_pos, max_hear_distance = range}) - for pos in rayIter(start_pos, dir, range) do + for pos in technic.trace_node_ray(start_pos, dir, range) do if minetest.is_protected(pos, player_name) then minetest.record_protection_violation(pos, player_name) break |