From d5df30c3ff5ad0b9486288521abca5b517651936 Mon Sep 17 00:00:00 2001
From: David Leal <halfpacho@gmail.com>
Date: Sat, 14 Sep 2019 12:55:41 +0200
Subject: [PATCH] Replace deprecated functions with newer ones (#510)

---
 modpack.conf                      |    1 
 technic/tools/vacuum.lua          |    2 
 technic_worldgen/mod.conf         |    3 +
 technic/machines/other/frames.lua |   18 ++++----
 technic/tools/prospector.lua      |    2 
 technic/radiation.lua             |    3 -
 technic/tools/mining_lasers.lua   |    2 
 /dev/null                         |    1 
 technic/tools/flashlight.lua      |    6 +-
 technic_chests/mod.conf           |    6 +-
 technic/helpers.lua               |    5 +-
 wrench/mod.conf                   |    3 +
 extranodes/mod.conf               |    3 +
 concrete/mod.conf                 |    3 +
 technic/mod.conf                  |    3 +
 technic_cnc/mod.conf              |    3 +
 16 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/concrete/mod.conf b/concrete/mod.conf
new file mode 100644
index 0000000..506f906
--- /dev/null
+++ b/concrete/mod.conf
@@ -0,0 +1,3 @@
+name = concrete
+depends = default
+optional_depends = basic_materials, intllib, moreblocks
diff --git a/extranodes/mod.conf b/extranodes/mod.conf
new file mode 100644
index 0000000..6f02b1c
--- /dev/null
+++ b/extranodes/mod.conf
@@ -0,0 +1,3 @@
+name = extranodes
+depends = default, technic_worldgen, basic_materials, concrete
+optional_depends = unifieddyes, intllib, moreblocks, steel, streetsmod
diff --git a/modpack.conf b/modpack.conf
new file mode 100644
index 0000000..1452865
--- /dev/null
+++ b/modpack.conf
@@ -0,0 +1 @@
+name = technic
diff --git a/modpack.txt b/modpack.txt
deleted file mode 100644
index 8b13789..0000000
--- a/modpack.txt
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/technic/helpers.lua b/technic/helpers.lua
index 5963b68..b89b180 100644
--- a/technic/helpers.lua
+++ b/technic/helpers.lua
@@ -91,8 +91,8 @@
 technic.tube_inject_item = pipeworks.tube_inject_item or function(pos, start_pos, velocity, item)
 	local tubed = pipeworks.tube_item(vector.new(pos), item)
 	tubed:get_luaentity().start_pos = vector.new(start_pos)
-	tubed:setvelocity(velocity)
-	tubed:setacceleration(vector.new(0, 0, 0))
+	tubed:set_velocity(velocity)
+	tubed:set_acceleration(vector.new(0, 0, 0))
 end
 
 
@@ -221,4 +221,3 @@
 		return p
 	end, vector.round(pos)
 end
-
diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua
index f991ba7..b74d806 100644
--- a/technic/machines/other/frames.lua
+++ b/technic/machines/other/frames.lua
@@ -155,7 +155,7 @@
 	end
 
 	for _, obj in ipairs(objects) do
-		obj:setpos(vector.add(obj:getpos(), vect))
+		obj:set_pos(vector.add(obj:get_pos(), vect))
 	end
 
 	for _, n in ipairs(nodelist) do
@@ -276,7 +276,7 @@
 		end,
 
 		on_punch = function(pos, node, puncher)
-			local ppos = puncher:getpos()
+			local ppos = puncher:get_pos()
 			local pvect = puncher:get_look_dir()
 			local pface = get_face(pos, ppos, pvect)
 
@@ -431,14 +431,14 @@
 	end,
 
 	dig = function(self)
-		minetest.handle_node_drops(self.object:getpos(), { ItemStack("technic:frame_111111") }, self.last_puncher)
-		local pos = vector.round(self.object:getpos())
+		minetest.handle_node_drops(self.object:get_pos(), { ItemStack("technic:frame_111111") }, self.last_puncher)
+		local pos = vector.round(self.object:get_pos())
 		frames_pos[pos_to_string(pos)] = nil
 		self.object:remove()
 	end,
 
 	on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
-		local pos = self.object:getpos()
+		local pos = self.object:get_pos()
 		if self.damage_object == nil then
 			self.damage_object = minetest.add_entity(pos, "technic:damage_entity")
 			self.damage_object:get_luaentity().remaining_time = 0.25
@@ -450,7 +450,7 @@
 		end
 
 		self.last_puncher = puncher
-		local ppos = puncher:getpos()
+		local ppos = puncher:get_pos()
 		local pvect = puncher:get_look_dir()
 		local pface = get_face(pos, ppos, pvect)
 		if pface == nil then return end
@@ -468,8 +468,8 @@
 	end,
 
 	on_rightclick = function(self, clicker)
-		local pos = self.object:getpos()
-		local ppos = clicker:getpos()
+		local pos = self.object:get_pos()
+		local ppos = clicker:get_pos()
 		local pvect = clicker:get_look_dir()
 		local pface = get_face(pos, ppos, pvect)
 
@@ -547,7 +547,7 @@
 				local entity = obj:get_luaentity()
 				if entity and (entity.name == "technic:frame_entity" or
 						entity.name == "technic:damage_entity") then
-					obj:setpos(t.pos)
+					obj:set_pos(t.pos)
 				end
 			end
 		end
diff --git a/technic/mod.conf b/technic/mod.conf
new file mode 100644
index 0000000..f2cefaa
--- /dev/null
+++ b/technic/mod.conf
@@ -0,0 +1,3 @@
+name = technic
+depends = default, pipeworks, technic_worldgen, basic_materials
+optional_depends = bucket, screwdriver, mesecons, mesecons_mvps, digilines, digiline_remote, intllib, unified_inventory, vector_extras, dye
diff --git a/technic/radiation.lua b/technic/radiation.lua
index f0d7f61..dd476c5 100644
--- a/technic/radiation.lua
+++ b/technic/radiation.lua
@@ -309,7 +309,7 @@
 end
 
 local function dmg_object(pos, object, strength)
-	local obj_pos = vector.add(object:getpos(), calculate_object_center(object))
+	local obj_pos = vector.add(object:get_pos(), calculate_object_center(object))
 	local mul
 	if armor_enabled or entity_damage then
 		-- we need to check may the object be damaged even if armor is disabled
@@ -513,4 +513,3 @@
 		end,
 	})
 end
-
diff --git a/technic/tools/flashlight.lua b/technic/tools/flashlight.lua
index 30f2480..a4ac608 100644
--- a/technic/tools/flashlight.lua
+++ b/technic/tools/flashlight.lua
@@ -55,7 +55,7 @@
 
 minetest.register_on_joinplayer(function(player)
 	local player_name = player:get_player_name()
-	local pos = player:getpos()
+	local pos = player:get_pos()
 	local rounded_pos = vector.round(pos)
 	rounded_pos.y = rounded_pos.y + 1
 	player_positions[player_name] = rounded_pos
@@ -77,7 +77,7 @@
 	for i, player in pairs(minetest.get_connected_players()) do
 		local player_name = player:get_player_name()
 		local flashlight_weared = check_for_flashlight(player)
-		local pos = player:getpos()
+		local pos = player:get_pos()
 		local rounded_pos = vector.round(pos)
 		rounded_pos.y = rounded_pos.y + 1
 		local old_pos = player_positions[player_name]
@@ -113,7 +113,7 @@
 	drawtype = "glasslike",
 	tiles = {"technic_light.png"},
 	paramtype = "light",
-	groups = {not_in_creative_inventory=1},
+	groups = {not_in_creative_inventory = 1},
 	drop = "",
 	walkable = false,
 	buildable_to = true,
diff --git a/technic/tools/mining_lasers.lua b/technic/tools/mining_lasers.lua
index ba5a726..208b719 100644
--- a/technic/tools/mining_lasers.lua
+++ b/technic/tools/mining_lasers.lua
@@ -59,7 +59,7 @@
 end
 
 local function laser_shoot(player, range, particle_texture, sound)
-	local player_pos = player:getpos()
+	local player_pos = player:get_pos()
 	local player_name = player:get_player_name()
 	local dir = player:get_look_dir()
 
diff --git a/technic/tools/prospector.lua b/technic/tools/prospector.lua
index 12437a7..d76eb07 100644
--- a/technic/tools/prospector.lua
+++ b/technic/tools/prospector.lua
@@ -48,7 +48,7 @@
 		end
 		if math.random() < 0.02 then found = not found end
 		minetest.chat_send_player(user:get_player_name(), minetest.registered_nodes[toolmeta.target].description.." is "..(found and "present" or "absent").." in "..look_diameter.."x"..look_diameter.."x"..toolmeta.look_depth.." region")
-		minetest.sound_play("technic_prospector_"..(found and "hit" or "miss"), { pos = vector.add(user:getpos(), { x = 0, y = 1, z = 0 }), gain = 1.0, max_hear_distance = 10 })
+		minetest.sound_play("technic_prospector_"..(found and "hit" or "miss"), { pos = vector.add(user:get_pos(), { x = 0, y = 1, z = 0 }), gain = 1.0, max_hear_distance = 10 })
 		return toolstack
 	end,
 	on_place = function(toolstack, user, pointed_thing)
diff --git a/technic/tools/vacuum.lua b/technic/tools/vacuum.lua
index b5afcb5..86e6b64 100644
--- a/technic/tools/vacuum.lua
+++ b/technic/tools/vacuum.lua
@@ -24,7 +24,7 @@
 				gain = 0.4,
 			})
 		end
-		local pos = user:getpos()
+		local pos = user:get_pos()
 		local inv = user:get_inventory()
 		for _, object in ipairs(minetest.get_objects_inside_radius(pos, vacuum_range)) do
 			local luaentity = object:get_luaentity()
diff --git a/technic_chests/mod.conf b/technic_chests/mod.conf
index 9478b19..99048c3 100644
--- a/technic_chests/mod.conf
+++ b/technic_chests/mod.conf
@@ -1,3 +1,3 @@
-name=technic_chests
-depends=default,basic_materials
-optional_depends=moreblocks,moreores,pipeworks,intllib,tubelib
+name = technic_chests
+depends = default, basic_materials
+optional_depends = moreblocks, moreores, pipeworks, intllib, tubelib
diff --git a/technic_cnc/mod.conf b/technic_cnc/mod.conf
new file mode 100644
index 0000000..4e0f940
--- /dev/null
+++ b/technic_cnc/mod.conf
@@ -0,0 +1,3 @@
+name = technic_cnc
+depends = default, basic_materials
+optional_depends = technic
diff --git a/technic_worldgen/mod.conf b/technic_worldgen/mod.conf
new file mode 100644
index 0000000..49988f5
--- /dev/null
+++ b/technic_worldgen/mod.conf
@@ -0,0 +1,3 @@
+name = technic_worldgen
+depends = default, basic_materials
+optional_depends = intllib, mg, doors, farming, glooptest, mesecons_doors, vessels
diff --git a/wrench/mod.conf b/wrench/mod.conf
new file mode 100644
index 0000000..a18b4f7
--- /dev/null
+++ b/wrench/mod.conf
@@ -0,0 +1,3 @@
+name = wrench
+depends = default
+optional_depends = technic, technic_chests, technic_worldgen, intllib

--
Gitblit v1.8.0