-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure when the trees are placed it doesn't interfere with a protected area #26
Comments
one of the items on my wish-list is a way for mods to register the dimensions of trees in an abstract way. while this request isn't for such a feature, IMO it's a step in the right direction. |
I found the correct values for three saplings back when I was working on it. I might re-work this soon using this method unless there's a better way to do so. IIRC, these should be the correct values. There could be some minor issues, though, but here you go. :) ...
-- this code should be on the `on_place` callback of the sapling registration
if treename == "beech" then
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"moretrees:" ..treename.. "_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -3, y = 1, z = -4},
{x = 4, y = 9, z = 3},
-- maximum interval of interior volume check
4)
elseif treename == "apple_tree" then
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"moretrees:" ..treename.. "_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -9, y = 1, z = -9},
{x = 9, y = 9, z = 9},
-- maximum interval of interior volume check
4)
elseif treename == "oak" then
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"moretrees:" ..treename.. "_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -6, y = 1, z = -6},
{x = 8, y = 16, z = 6},
-- maximum interval of interior volume check
4) |
while i think this can be useful, it should be behind a setting (maybe off by default?) since checking the whole area probably will be expensive/some people might not care for it |
if we assume areas mod instead of |
Description
A few years back, I remember that I was working on this feature (when the mod was still available on GitLab), but I didn't fully finish it.
It appears the issue is still present. Would be great if this could be worked on (I could help a little bit if wanted).
moretrees/node_defs.lua
Lines 445 to 450 in 393840b
The text was updated successfully, but these errors were encountered: