mirror of
https://github.com/mt-mods/moretrees.git
synced 2025-07-26 03:30:21 +02:00
Compare commits
11 Commits
2019-06-18
...
f3108af2e3
Author | SHA1 | Date | |
---|---|---|---|
f3108af2e3 | |||
d335eceecc | |||
89bffdecaf | |||
114e47966b | |||
6fd3729669 | |||
25250e6eea | |||
9bc0bc1b68 | |||
d097fd6044 | |||
157f53def0 | |||
26f1ec49d2 | |||
aebc7a41b0 |
@ -125,7 +125,10 @@ moretrees.willow_biome = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
moretrees.rubber_tree_biome = {
|
moretrees.rubber_tree_biome = {
|
||||||
surface = "default:dirt_with_grass",
|
surface = {
|
||||||
|
"default:dirt_with_grass",
|
||||||
|
"default:sand",
|
||||||
|
},
|
||||||
avoid_nodes = moretrees.avoidnodes,
|
avoid_nodes = moretrees.avoidnodes,
|
||||||
avoid_radius = 10,
|
avoid_radius = 10,
|
||||||
seed_diff = 338,
|
seed_diff = 338,
|
||||||
|
31
crafts.lua
31
crafts.lua
@ -117,10 +117,39 @@ for i in ipairs(moretrees.cutting_tools) do
|
|||||||
},
|
},
|
||||||
replacements = {
|
replacements = {
|
||||||
{ "moretrees:coconut", "moretrees:raw_coconut" },
|
{ "moretrees:coconut", "moretrees:raw_coconut" },
|
||||||
{ tool, tool }
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
-- give tool back with wear preserved
|
||||||
|
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||||
|
if (itemstack:get_name() == "moretrees:coconut_milk") then
|
||||||
|
for i, j in pairs(old_craft_grid) do
|
||||||
|
-- find tool used to do the craft
|
||||||
|
local ocg_name = j:get_name()
|
||||||
|
if ((ocg_name ~= "") and (ocg_name ~= "moretrees:coconut") and (ocg_name ~= "vessels:drinking_glass")) then
|
||||||
|
-- create a new tool and set wear
|
||||||
|
local t = ItemStack(ocg_name)
|
||||||
|
local w = j:get_wear()
|
||||||
|
-- works if tool used is an axe
|
||||||
|
local uses = j:get_tool_capabilities().groupcaps.choppy.uses or 0
|
||||||
|
if (w == 0 and uses ~= 0) then
|
||||||
|
-- tool has never been used
|
||||||
|
-- use tool once
|
||||||
|
t:set_wear(65535/(9*(uses - 1)))
|
||||||
|
else
|
||||||
|
-- set wear back
|
||||||
|
t:set_wear(w)
|
||||||
|
-- use tool once
|
||||||
|
if (uses ~= 0) then
|
||||||
|
t:add_wear(65535/(9*(uses - 1)))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- add to craft inventory
|
||||||
|
craft_inv:add_item("craft", t)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
|
@ -25,12 +25,16 @@ moretrees.enable_beech = false
|
|||||||
moretrees.spawn_saplings = true
|
moretrees.spawn_saplings = true
|
||||||
|
|
||||||
-- Set this to true to allow defining stairs/slabs/etc. If Moreblocks is
|
-- Set this to true to allow defining stairs/slabs/etc. If Moreblocks is
|
||||||
-- installed, this will use that mod's Stairs Plus component. Otherwise, it
|
-- installed, this will use that mod's Stairs Plus component. Otherwise, it
|
||||||
-- will use the default stairs mod in minetest_game, if present
|
-- will use the default stairs mod in minetest_game, if present
|
||||||
|
|
||||||
moretrees.enable_stairs = true
|
moretrees.enable_stairs = true
|
||||||
|
|
||||||
-- Set this to true if you want the plantlike drawtype for leaves, which
|
-- If this variable is set to true, register fences for moretrees wood
|
||||||
|
|
||||||
|
moretrees.enable_fences = false
|
||||||
|
|
||||||
|
-- Set this to true if you want the plantlike drawtype for leaves, which
|
||||||
-- improves some peoples' framerates without resorting to making leaf nodes opaque.
|
-- improves some peoples' framerates without resorting to making leaf nodes opaque.
|
||||||
-- Affects default leaves and default jungle leaves also.
|
-- Affects default leaves and default jungle leaves also.
|
||||||
|
|
||||||
|
2
mod.conf
2
mod.conf
@ -1 +1,3 @@
|
|||||||
name = moretrees
|
name = moretrees
|
||||||
|
depends = default, biome_lib, vessels
|
||||||
|
optional_depends = doors stairs, moreblocks, intllib, farming
|
||||||
|
@ -209,6 +209,41 @@ for i in ipairs(moretrees.treelist) do
|
|||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if moretrees.enable_fences then
|
||||||
|
local planks_name = "moretrees:" .. treename .. "_planks"
|
||||||
|
local planks_tile = "moretrees_" .. treename .. "_wood.png"
|
||||||
|
default.register_fence("moretrees:" .. treename .. "_fence", {
|
||||||
|
description = S(treedesc.." Fence"),
|
||||||
|
texture = planks_tile,
|
||||||
|
inventory_image = "default_fence_overlay.png^" .. planks_tile ..
|
||||||
|
"^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
wield_image = "default_fence_overlay.png^" .. planks_tile ..
|
||||||
|
"^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
material = planks_name,
|
||||||
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||||
|
sounds = default.node_sound_wood_defaults()
|
||||||
|
})
|
||||||
|
default.register_fence_rail("moretrees:" .. treename .. "_fence_rail", {
|
||||||
|
description = S(treedesc.." Fence Rail"),
|
||||||
|
texture = planks_tile,
|
||||||
|
inventory_image = "default_fence_rail_overlay.png^" .. planks_tile ..
|
||||||
|
"^default_fence_rail_overlay.png^[makealpha:255,126,126",
|
||||||
|
wield_image = "default_fence_rail_overlay.png^" .. planks_tile ..
|
||||||
|
"^default_fence_rail_overlay.png^[makealpha:255,126,126",
|
||||||
|
material = planks_name,
|
||||||
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
||||||
|
sounds = default.node_sound_wood_defaults()
|
||||||
|
})
|
||||||
|
if minetest.global_exists("doors") then
|
||||||
|
doors.register_fencegate("moretrees:" .. treename .. "_gate", {
|
||||||
|
description = S(treedesc .. " Fence Gate"),
|
||||||
|
texture = planks_tile,
|
||||||
|
material = planks_name,
|
||||||
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
||||||
@ -360,6 +395,8 @@ end
|
|||||||
-- we need our own copy of that node, which moretrees will match against.
|
-- we need our own copy of that node, which moretrees will match against.
|
||||||
|
|
||||||
local jungle_tree = table.copy(minetest.registered_nodes["default:jungletree"])
|
local jungle_tree = table.copy(minetest.registered_nodes["default:jungletree"])
|
||||||
|
jungle_tree.drop = jungle_tree.drop or { items = {} }
|
||||||
|
table.insert(jungle_tree.drop.items, { items = {"default:jungletree"}})
|
||||||
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
|
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
|
||||||
|
|
||||||
default.register_leafdecay({
|
default.register_leafdecay({
|
||||||
|
Reference in New Issue
Block a user