diff --git a/.gitignore b/.gitignore index 0667445..a3dd7b9 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,5 @@ luac.out *.x86_64 *.hex - +# Krita +*~ diff --git a/.luacheckrc b/.luacheckrc index 45f3046..d999c36 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -3,6 +3,8 @@ allow_defined_top = true globals = { "minetest", + "ebiometrees", + "eaction" } read_globals = { diff --git a/mods/eaction/init.lua b/mods/eaction/init.lua new file mode 100644 index 0000000..ea906b2 --- /dev/null +++ b/mods/eaction/init.lua @@ -0,0 +1,2 @@ +eaction = {} +dofile(minetest.get_modpath("eaction") .. "/place.lua") diff --git a/mods/eaction/place.lua b/mods/eaction/place.lua new file mode 100644 index 0000000..a11168a --- /dev/null +++ b/mods/eaction/place.lua @@ -0,0 +1,3 @@ +function eaction.place_handler(itemname, func) + return +end diff --git a/mods/ebiome/biomes/grasslands.lua b/mods/ebiome/biomes/grasslands.lua index 0fa0791..6b9d83c 100644 --- a/mods/ebiome/biomes/grasslands.lua +++ b/mods/ebiome/biomes/grasslands.lua @@ -10,6 +10,52 @@ minetest.register_biome({ heat_point = 50, humidity_point = 50, }) +minetest.register_node("ebiome:oak_sapling", { + description = S("Oak tree sapling"), + drawtype = "plantlike", + tiles = { "ebiome_oak_sapling.png" }, + paramtype = "light", + on_timer = ebiometrees.get_sapling_grower("ebiome:oak_sprout"), + sunlight_propagates = true, + walkable = false, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + on_construct = function(pos) + minetest.get_node_timer(pos):start(3) + end +}) +minetest.register_node("ebiome:oak_sprout", { + description = S("Oak tree sprout"), + drawtype = "plantlike", + visual_scale = 1.4, + tiles = { "ebiome_oak_sprout.png" }, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = ebiometrees.get_sprout_grower("ebiome:oak_trunk_normal", "ebiome:oak_trunk_growing"), + groups = {snappy = 3, dig_immediate = 3, flammable = 2, + attached_node = 1}, + on_construct = function(pos) + minetest.get_node_timer(pos):start(3) + end +}) +minetest.register_node("ebiome:oak_trunk_growing", { + description = S("Oak tree trunk"), + tiles = { "ebiome_oak_trunk_growing.png", + "ebiome_oak_trunk_slice_normal.png", + "ebiome_oak_trunk_growing.png" + }, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, flammable = 2}, + on_place = minetest.rotate_node, + on_timer = function(pos) + return true + end, + on_construct = function(pos) + minetest.get_node_timer(pos):start(3) + end +}) minetest.register_node("ebiome:oak_trunk_normal", { description = S("Oak tree trunk"), tiles = { "ebiome_oak_trunk_slice_normal.png", "ebiome_oak_trunk_slice_normal.png","ebiome_oak_trunk_normal.png"}, @@ -33,16 +79,6 @@ minetest.register_node("ebiome:oak_trunk_normal_corner", { groups = {tree = 1, choppy = 2, flammable = 2}, on_place = minetest.rotate_node }) -minetest.register_node("ebiome:oak_sapling", { - description = S("Oak tree sapling"), - drawtype = "plantlike", - tiles = { "ebiome_oak_sapling.png" }, - paramtype = "light", - sunlight_propagates = true, - walkable = false, - groups = {snappy = 2, dig_immediate = 3, flammable = 2, - attached_node = 1, sapling = 1} -}) minetest.register_node("ebiome:grass", { description = S("Grass"), tiles = {"ebiome_grass.png"}, diff --git a/mods/ebiome/mod.conf b/mods/ebiome/mod.conf new file mode 100644 index 0000000..1cbd7da --- /dev/null +++ b/mods/ebiome/mod.conf @@ -0,0 +1,3 @@ +depends = ebiometrees +description = biome mod +name = ebiome diff --git a/mods/ebiome/textures/ebiome_grass.png~ b/mods/ebiome/textures/ebiome_grass.png~ deleted file mode 100644 index b40d9e5..0000000 Binary files a/mods/ebiome/textures/ebiome_grass.png~ and /dev/null differ diff --git a/mods/ebiome/textures/ebiome_oak_sapling.png b/mods/ebiome/textures/ebiome_oak_sapling.png index 6b80a29..592b56f 100644 Binary files a/mods/ebiome/textures/ebiome_oak_sapling.png and b/mods/ebiome/textures/ebiome_oak_sapling.png differ diff --git a/mods/ebiome/textures/ebiome_oak_sprout.png b/mods/ebiome/textures/ebiome_oak_sprout.png new file mode 100644 index 0000000..f8f3275 Binary files /dev/null and b/mods/ebiome/textures/ebiome_oak_sprout.png differ diff --git a/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png~ b/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png~ deleted file mode 100644 index 00627c0..0000000 Binary files a/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png~ and /dev/null differ diff --git a/mods/ebiome/textures/ebiome_oak_trunk_growing.png b/mods/ebiome/textures/ebiome_oak_trunk_growing.png new file mode 100644 index 0000000..8f2b5e8 Binary files /dev/null and b/mods/ebiome/textures/ebiome_oak_trunk_growing.png differ diff --git a/mods/ebiome/textures/ebiome_oak_trunk_normal.png~ b/mods/ebiome/textures/ebiome_oak_trunk_normal.png~ deleted file mode 100644 index 6c936eb..0000000 Binary files a/mods/ebiome/textures/ebiome_oak_trunk_normal.png~ and /dev/null differ diff --git a/mods/ebiometrees/init.lua b/mods/ebiometrees/init.lua new file mode 100644 index 0000000..831ba60 --- /dev/null +++ b/mods/ebiometrees/init.lua @@ -0,0 +1 @@ +dofile(minetest.get_modpath("ebiometrees").."/sapling.lua") diff --git a/mods/ebiometrees/sapling.lua b/mods/ebiometrees/sapling.lua new file mode 100644 index 0000000..cbaf2ce --- /dev/null +++ b/mods/ebiometrees/sapling.lua @@ -0,0 +1,28 @@ +ebiometrees = {} + +function ebiometrees.get_sapling_grower(sprout_name) + local function rooter(pos) + minetest.set_node(pos, {name=sprout_name}) + end + return rooter +end + +function ebiometrees.get_sprout_grower(trunk_name, apex_name) + local function grower(pos) + minetest.set_node(pos, {name=trunk_name}) + local upper = {x=pos.x, y=pos.y+1, z=pos.z} + minetest.set_node(upper, {name=apex_name}) + end + return grower +end + +function ebiometrees.root_sapling(pos) + minetest.set_node(pos, {name="ebiome:oak_sprout"}) + return false +end + +function ebiometrees.set_rooting_sapling(itemstack, placer, pointed_thing) + itemstack = minetest.item_place(itemstack, placer, pointed_thing) + minetest.get_node_timer(pointed_thing.above):start(3) + return itemstack +end