Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion FIXME
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* Woodship schematic as MTS
* U-boat schematic as MTS
* ABMs: Conversion to LBMs or nodetimers where appropriate, especially shipwrecks
* Tree growth to nodetimers (according to MTG practice)
* Coral ABMs to nodetimers
* Shipwreck LBMs?
* Bonemeal support?
* Tree Schematics with no sapling:
* Small river oak (river_oak_small_tree)
Expand All @@ -23,6 +24,7 @@
* Reproduction of smaller plants like spinifex, mitchell grass
* Bonemeal addon?
* Cultivation item(s)?
* Internationalise strings

# Biomes testing coords
Mapgen is always carpathian. Teleportation is not safe unless you have fly!
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ All biomes are enabled by default. Currently, disabling the *Underground* biome

## Changelog

### 0.5.2
* Trees' growth rate is now scaled by their volume. Bigger trees grow slower
than smaller trees, at a bias for smaller trees.
* Internally, trees now use nodetimers instead of ABMs.

### 0.5.1
* Australian trees now finally support leaf decay.
* A new series of commands will let server operators spawn aus schematics.
Expand Down
8 changes: 4 additions & 4 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ aus.schematics = {}


-- Load files
dofile(aus.path .. "/tree_gen.lua")
dofile(aus.path .. "/nulda.lua")
dofile(aus.path .. "/schematics.lua")
dofile(aus.path .. "/schematics_commands.lua")
dofile(aus.path .. "/decorations.lua")
dofile(aus.path .. "/nulda.lua")
dofile(aus.path .. "/mapgen.lua")
dofile(aus.path .. "/saplings.lua")
dofile(aus.path .. "/nodes.lua")
dofile(aus.path .. "/noairblocks.lua")
dofile(aus.path .. "/craftitems.lua")
dofile(aus.path .. "/crafting.lua")
dofile(aus.path .. "/tree_gen.lua")
dofile(aus.path .. "/mapgen.lua")
dofile(aus.path .. "/saplings.lua")
--dofile(aus.path .. "/voxel.lua")

-- Clear schematic-generating objects that are no longer needed
Expand Down
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name = australia
title = Australia
description = Adds Australian map generation to Minetest Game, including many species of native flora.
depends = default, flowers
optional_depends = technic_worldgen, bucket, stairs
optional_depends = technic_worldgen, bucket, stairs, bonemeal
supported_games = minetest_game
49 changes: 41 additions & 8 deletions nodes/trees.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ aus.treelist = {
{"blue_gum", "Eucalyptus globulus: Blue Gum", 1.0, "eucalyptus", nil, nil, nil, nil, 3},
{"boab", "Adansonia gregorii: Boab", 1.0, "boab", nil, nil, nil, nil, 3},
{"bull_banksia", "Banksia grandis: Bull Banksia", 0.33, "banksia", nil, nil, nil, nil, 3},
{"celery_top_pine", "Phyllocladus aspleniifolius: Celery-top Pine", 1, "pine", nil, nil, nil, nil, vector.new(3,4,3)},
{"cherry", "Exocarpos cupressiformis: Australian Cherry", 0.5, "berry", "cherry", "Australian Cherries", 0.67, 1, 3},
{"celery_top_pine", "Phyllocladus aspleniifolius: Celery-top Pine", 1, "pine", nil, nil, nil, nil, vector.new(4,6,4)},
{"cherry", "Exocarpos cupressiformis: Australian Cherry", 0.5, "berry", "cherry", "Australian Cherries", 0.67, 1, vector.new(3,4,3)},
{"cloncurry_box", "Eucalyptus leucophylla: Cloncurry Box", 1.0, "eucalyptus", nil, nil, nil, nil, 3},
{"coast_banksia", "Banksia integrifolia: Coast Banksia", 1.0, "banksia", nil, nil, nil, nil, 3},
{"coolabah", "Eucalyptus coolabah: Coolabah", 1.0, "eucalyptus", nil, nil, nil, nil, 3},
Expand Down Expand Up @@ -124,13 +124,31 @@ for _, treedef in ipairs(aus.treelist) do
})

-- sapling
minetest.register_node("australia:"..treename.."_sapling", {
local saplingname = "australia:"..treename.."_sapling"
local sapling_texname = "aus_"..treesapling.."_sapling.png"
local sapling_schems = aus.saplings2schems[saplingname]
local sap_max_size_x = 0
local sap_max_size_y = 0
local sap_max_size_z = 0
for schemidx, schem in pairs(sapling_schems) do
sap_max_size_x = math.max(sap_max_size_x, schem.size.x)
sap_max_size_y = math.max(sap_max_size_y, schem.size.y)
sap_max_size_z = math.max(sap_max_size_z, schem.size.z)
end
-- Due to rotations, we have to always check the largest axis. They should
-- be equal anyway.
local sap_max_bounds_horiz = math.floor(math.max(sap_max_size_x, sap_max_size_z)/2)
local sap_size = vector.new(sap_max_size_x, sap_max_size_y, sap_max_size_z)
local sap_growthrate_a, sap_growthrate_b = aus.sapling_growthrate(
sapling_schems, saplingname, (treefruit and "australia:"..treefruit))

minetest.register_node(saplingname, {
description = treedesc.." Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"aus_"..treesapling.."_sapling.png"},
inventory_image = "aus_"..treesapling.."_sapling.png",
wield_image = "aus_"..treesapling.."_sapling.png",
tiles = {sapling_texname},
inventory_image = sapling_texname,
wield_image = sapling_texname,
paramtype = "light",
sunlight_propagates = true,
walkable = false,
Expand All @@ -139,14 +157,29 @@ for _, treedef in ipairs(aus.treelist) do
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
sounds = default.node_sound_leaves_defaults(),

on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(
sap_growthrate_a, sap_growthrate_b))
end,
on_timer = aus.grow_sapling,

on_place = function(itemstack, placer, pointed_thing)
return default.sapling_on_place(itemstack, placer, pointed_thing,
itemstack:get_name(),
vector.new(-sap_max_bounds_horiz, 1, -sap_max_bounds_horiz),
vector.new(sap_max_bounds_horiz, sap_max_size_y, sap_max_bounds_horiz),
4 -- kind of a magic number but meh
)
end
})

-- fruit, if applicable
local treefruit_name
if treefruit then
treefruit_name = "australia:"..treefruit..""
treefruit_name = "australia:"..treefruit
minetest.register_node(treefruit_name, {
description = treefruit_desc,
drawtype = "plantlike",
Expand Down
Loading