summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@mirzakhani.gpcf.eu>2018-05-01 20:09:15 +0200
committerroot <root@mirzakhani.gpcf.eu>2018-05-01 20:09:15 +0200
commit13bd0be9ac03ef45228a87bb8ae8564d703dcf2b (patch)
treefb48bd3325beec6f828b25dbf3767ea682615fa2
parent2462530981a61bbc83085cc3f1f5122310f94f3c (diff)
parent3bad50c8835cf462014bed42b7b79f807ee39cc9 (diff)
Merge https://github.com/h-v-smacker/technic
-rw-r--r--extranodes/lox.lua53
-rw-r--r--technic/machines/LV/cnc_nodes.lua8
-rw-r--r--technic/textures/technic_walking_tractor.pngbin621 -> 378 bytes
-rw-r--r--technic/tools/chainsaw.lua8
-rw-r--r--technic/tools/walking_tractor.lua11
5 files changed, 50 insertions, 30 deletions
diff --git a/extranodes/lox.lua b/extranodes/lox.lua
index a4831a6..3aaadee 100644
--- a/extranodes/lox.lua
+++ b/extranodes/lox.lua
@@ -16,23 +16,19 @@ local freezing_rules = {
["ethereal:mushroom_dirt"] = "default:dirt_with_snow",
}
-local function freeze(user, pos, radius, itemstack)
+local function freeze(user, pos, radius)
- -- itemstack is true if the function is used in a tool callback
- -- if so, user is a playerref
- -- if itemstack is false, it's a node using the function, and the
- -- user name is plain text string
+ -- if the function is used by a node: user is a string
+ -- if it's called by an item, user is a PlayerRef
- if (itemstack) then
-
- if minetest.is_protected(pos, user:get_player_name()) then
- minetest.record_protection_violation(pos, user:get_player_name())
+ if type(user) == 'string' then
+ if minetest.is_protected(pos, user) then
+ minetest.record_protection_violation(pos, user)
return
end
-
else
- if minetest.is_protected(pos, user) then
- minetest.record_protection_violation(pos, user)
+ if minetest.is_protected(pos, user:get_player_name()) then
+ minetest.record_protection_violation(pos, user:get_player_name())
return
end
end
@@ -66,22 +62,7 @@ local function freeze(user, pos, radius, itemstack)
minetest.sound_play("default_cool_lava", {gain = 1, pos = pos})
end
- if (itemstack) then
-
- itemstack:take_item()
- local uinv = user:get_inventory()
- if uinv:room_for_item("main", "vessels:steel_bottle 1") then
- uinv:add_item("main", "vessels:steel_bottle 1")
- else
- minetest.item_drop(ItemStack("vessels:steel_bottle 1"), user, user:getpos())
- end
-
- user:set_hp(user:get_hp() - 1)
-
- return itemstack
- else
- return true
- end
+ return true
end
@@ -104,7 +85,21 @@ minetest.register_craftitem(":technic:lox", {
if pointed_thing.type ~= "node" then
return itemstack
end
- freeze(user, pointed_thing.under, 2, itemstack)
+
+ itemstack:take_item()
+
+ freeze(user, pointed_thing.under, 2)
+
+ local uinv = user:get_inventory()
+ if uinv:room_for_item("main", "vessels:steel_bottle 1") then
+ uinv:add_item("main", "vessels:steel_bottle 1")
+ else
+ minetest.item_drop(ItemStack("vessels:steel_bottle 1"), user, user:getpos())
+ end
+
+ user:set_hp(user:get_hp() - 1)
+
+ return itemstack
end
})
diff --git a/technic/machines/LV/cnc_nodes.lua b/technic/machines/LV/cnc_nodes.lua
index 6463c62..d17ceab 100644
--- a/technic/machines/LV/cnc_nodes.lua
+++ b/technic/machines/LV/cnc_nodes.lua
@@ -386,3 +386,11 @@ if minetest.get_modpath("moreblocks") then
S("Grey Clay"))
end
+
+
+if minetest.get_modpath("maple") then
+ technic.cnc.register_all("maple:maple_wood",
+ {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
+ {"maple_wood.png"},
+ S("Maple"))
+end \ No newline at end of file
diff --git a/technic/textures/technic_walking_tractor.png b/technic/textures/technic_walking_tractor.png
index c55cb42..23fcd6c 100644
--- a/technic/textures/technic_walking_tractor.png
+++ b/technic/textures/technic_walking_tractor.png
Binary files differ
diff --git a/technic/tools/chainsaw.lua b/technic/tools/chainsaw.lua
index eb33b9a..3928c56 100644
--- a/technic/tools/chainsaw.lua
+++ b/technic/tools/chainsaw.lua
@@ -155,6 +155,14 @@ if minetest.get_modpath("ethereal") then
end
end
+-- Support maple
+if minetest.get_modpath("maple") then
+ timber_nodenames["maple:maple_tree"] = true
+ if chainsaw_leaves then
+ timber_nodenames["maple:maple_leaves"] = true
+ end
+end
+
-- Support farming_plus
if minetest.get_modpath("farming_plus") then
if chainsaw_leaves then
diff --git a/technic/tools/walking_tractor.lua b/technic/tools/walking_tractor.lua
index 01d3ae1..e78375f 100644
--- a/technic/tools/walking_tractor.lua
+++ b/technic/tools/walking_tractor.lua
@@ -53,6 +53,15 @@ local ripe_for_harvest = {
"farming:wheat_8",
"ethereal:onion_5",
"ethereal:strawberry_8",
+ -- also doubles as a snow-plough
+ "default:snowblock",
+ "stairs:slab_snowblock",
+}
+
+local compatible_soils = {
+ "group:soil",
+ "default:dirt_with_snow",
+ "ethereal:dry_dirt"
}
local node_removed
@@ -167,7 +176,7 @@ local function work_on_soil(itemstack, user, pointed_thing)
if meta.mode <= 3 then
-- tilling
- local found_obj = minetest.find_nodes_in_area(start_pos, end_pos, {"group:soil"})
+ local found_obj = minetest.find_nodes_in_area(start_pos, end_pos, compatible_soils)
for _, f in ipairs(found_obj) do
-- unfortunately, there is no callback to track the node change without
-- digging it first