Commit 7a619317 authored by TenPlus1's avatar TenPlus1
Browse files

Tweaked crystal shovel, bonemeal grows bushes, added toolranks support

parent 6c8ea9e5
......@@ -10,6 +10,12 @@ Ethereal Mapgen mod for Minetest (works on all except v6)
## Changelog
### 1.23
- Added bonemeal support for bush sapling and acacia bush sapling
- Added support for [toolranks] mod if found
- Reworked Crystal Shovel so it acts more like a normal shovel with soft touch
### 1.22
- Added coral and silver sand to mapgen (0.4.15 only)
......
......@@ -219,6 +219,11 @@ local function growth(pointed_thing)
elseif node.name == "default:aspen_sapling"
and enough_height(pos, 11) then
default.grow_new_aspen_tree(pos)
elseif node.name == "default:bush_sapling" then
default.grow_bush(pos)
elseif node.name == "default:acacia_bush_sapling" then
default.grow_acacia_bush(pos)
end
return
......
......@@ -166,51 +166,38 @@ minetest.register_craft({
}
})
-- Crystal Shovel (with Soft Touch so player can dig up dirt with grass intact)
minetest.register_tool("ethereal:shovel_crystal", {
description = S("Crystal (soft touch) Shovel"),
inventory_image = "crystal_shovel.png",
wield_image = "crystal_shovel.png^[transformR90",
sound = {breaks = "default_tool_breaks"},
on_use = function(itemstack, user, pointed_thing)
local old_handle_node_drops = minetest.handle_node_drops
if pointed_thing.type ~= "node" then
return
end
function minetest.handle_node_drops(pos, drops, digger)
-- Check if node protected
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
return
end
-- are we holding Crystal Shovel?
if digger:get_wielded_item():get_name() ~= "ethereal:shovel_crystal" then
return old_handle_node_drops(pos, drops, digger)
end
local pos = pointed_thing.under
local nn = minetest.get_node(pos).name
local nn = minetest.get_node(pos).name
-- Is node dirt, sand or gravel
if minetest.get_item_group(nn, "crumbly") > 0 then
if minetest.get_item_group(nn, "crumbly") == 0 then
return old_handle_node_drops(pos, drops, digger)
end
local inv = user:get_inventory()
return old_handle_node_drops(pos, {ItemStack(nn)}, digger)
end
minetest.remove_node(pointed_thing.under)
ethereal.check_falling(pos)
if minetest.setting_getbool("creative_mode") then
if not inv:contains_item("main", {name = nn}) then
inv:add_item("main", {name = nn})
end
else
inv:add_item("main", {name = nn})
itemstack:add_wear(65535 / 100) -- 111 uses
end
minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.4})
return itemstack
end
end,
minetest.register_tool("ethereal:shovel_crystal", {
description = "Crystal Shovel",
inventory_image = "crystal_shovel.png",
wield_image = "crystal_shovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_craft({
......@@ -244,3 +231,22 @@ minetest.register_craft({
"ethereal:crystal_ingot"
},
})
-- Add [toolranks] mod support if found
if minetest.get_modpath("toolranks") then
minetest.override_item("ethereal:pick_crystal", {
original_description = "Crystal Pickaxe",
description = toolranks.create_description("Crystal Pickaxe", 0, 1),
after_use = toolranks.new_afteruse})
minetest.override_item("ethereal:axe_crystal", {
original_description = "Crystal Axe",
description = toolranks.create_description("Crystal Axe", 0, 1),
after_use = toolranks.new_afteruse})
minetest.override_item("ethereal:shovel_crystal", {
original_description = "Crystal Shovel",
description = toolranks.create_description("Crystal Shovel", 0, 1),
after_use = toolranks.new_afteruse})
end
......@@ -7,3 +7,4 @@ bakedclay?
moreblocks?
intllib?
lucky_block?
toolranks?
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment