diff --git a/cloudgen.lua b/cloudgen.lua index 559509d..f0f6c44 100644 --- a/cloudgen.lua +++ b/cloudgen.lua @@ -5,21 +5,29 @@ local rand = math.random local min = math.min local floor = math.floor local ceil = math.ceil -local abs = math.ceil -local map_max = 31000 +local abs = math.abs +local max_depth = 31000 -local cloud_noise_1 = {offset = 10, scale = 10, seed = 3721, spread = {x = 120, y = 120, z = 120}, octaves = 3, persist = 1, lacunarity = 2} +local cloud_noise_1 = {offset = 10, scale = 10, seed = 4877, spread = {x = 120, y = 120, z = 120}, octaves = 3, persist = 1, lacunarity = 2} +local cloud_noise_2 = {offset = 0, scale = 1, seed = 5748, spread = {x = 40, y = 10, z = 40}, octaves = 3, persist = 1, lacunarity = 2} +local plant_noise = {offset = 0.0, scale = 1.0, spread = {x = 200, y = 200, z = 200}, seed = -2525, octaves = 3, persist = 0.7, lacunarity = 2.0} +local biome_noise = {offset = 0.0, scale = 1.0, spread = {x = 400, y = 400, z = 400}, seed = -1471, octaves = 3, persist = 0.5, lacunarity = 2.0} -fun_caves.cloudgen = function(minp, maxp, data, area, node) - local clouds = ceil(minp.y / floor(map_max / 7)) - if abs(clouds * floor(map_max / 7) - minp.y) > 80 then +fun_caves.cloudgen = function(minp, maxp, data, p2data, area, node) + local clouds = ceil(minp.y / floor(max_depth / 7)) + if abs(clouds * floor(max_depth / 7) - minp.y) > 80 then return end local csize = vector.add(vector.subtract(maxp, minp), 1) + local map_max = {x = csize.x, y = csize.y, z = csize.z} + local map_min = {x = minp.x, y = minp.y, z = minp.z} local cloud_1 = minetest.get_perlin_map(cloud_noise_1, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z}) + local cloud_2 = minetest.get_perlin_map(cloud_noise_2, map_max):get3dMap_flat(map_min) + local plant_n = minetest.get_perlin_map(plant_noise, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z}) + local biome_n = minetest.get_perlin_map(biome_noise, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z}) local write = false @@ -28,25 +36,43 @@ fun_caves.cloudgen = function(minp, maxp, data, area, node) for z = minp.z, maxp.z do for x = minp.x, maxp.x do index = index + 1 - --index3d = noise_area:index(x, minp.y-1, z) - index3d = (z - minp.z) * (csize.y + 2) * csize.x + (x - minp.x) + 1 - --local height = cloud_1[index] + minp.y + 32 - local ivm = area:index(x, minp.y-1, z) + index3d = (z - minp.z) * (csize.y) * csize.x + (x - minp.x) + 1 + local ivm = area:index(x, minp.y, z) + local cloud + if biome_n[index] < 0 then + cloud = 'storm_cloud' + else + cloud = 'cloud' + end + + cloud_1[index] = floor(cloud_1[index] + 0.5) if cloud_1[index] > 0 then for y = minp.y, maxp.y do local dy = y - minp.y - if dy > 32 and cloud_1[index] > 15 then - if dy < 47 then - if dy < 47 - (cloud_1[index] - 15) then - data[ivm] = node['fun_caves:cloud'] - else - data[ivm] = node['default:water_source'] - end + if dy > 32 and cloud_1[index] > 15 and dy < 47 then + if dy < 47 - (cloud_1[index] - 15) then + data[ivm] = node['fun_caves:'..cloud] + else + data[ivm] = node['default:water_source'] write = true end - elseif dy >= 32 - cloud_1[index] and dy <= 32 + cloud_1[index] then - data[ivm] = node['fun_caves:cloud'] + elseif (dy <= 32 or cloud_1[index] <= 15) and dy >= 32 - cloud_1[index] and dy <= 32 + cloud_1[index] then + data[ivm] = node['fun_caves:'..cloud] + write = true + elseif data[ivm - area.ystride] == node['fun_caves:'..cloud] and data[ivm] == node['air'] then + if rand(30) == 1 and plant_n[index] > 0.5 then + data[ivm] = node['fun_caves:moon_weed'] + write = true + elseif rand(60) == 1 and plant_n[index] > 0.5 then + fun_caves.place_schematic(minp, maxp, data, p2data, area, node, {x=x,y=y-1,z=z}, fun_caves.schematics['lumin_tree'], true) + write = true + elseif rand(10) == 1 then + data[ivm] = node['default:grass_'..rand(4)] + write = true + end + elseif data[ivm] == node['air'] and (dy < 29 - cloud_1[index] or dy > 35 + cloud_1[index]) and cloud_2[index3d] > abs((dy - 40) / 20) then + data[ivm] = node['fun_caves:wispy_cloud'] write = true end @@ -57,5 +83,33 @@ fun_caves.cloudgen = function(minp, maxp, data, area, node) end end + local index = 0 + local index3d = 0 + for z = minp.z, maxp.z do + for x = minp.x, maxp.x do + index = index + 1 + local ivm = area:index(x, minp.y, z) + + local cloud + if biome_n[index] < 0 then + cloud = 'storm_cloud' + else + cloud = 'cloud' + end + + cloud_1[index] = floor(cloud_1[index] + 0.5) + if cloud_1[index] > 0 then + for y = minp.y, maxp.y do + local dy = y - minp.y + if data[ivm] == node['fun_caves:'..cloud] and data[ivm + area.ystride] == node['default:water_source'] and rand(30) == 1 and fun_caves.surround(node, data, area, ivm) then + data[ivm] = node['fun_caves:water_plant_1_water_'..cloud] + end + + ivm = ivm + area.ystride + end + end + end + end + return write end diff --git a/deco.lua b/deco.lua index 56f99b3..ced67cd 100644 --- a/deco.lua +++ b/deco.lua @@ -182,6 +182,47 @@ do fun_caves.schematics['decaying_tree'] = s end +do + local w, h, d = 5, 8, 5 + local s = fun_caves.schematic_array(w, h, d) + + for y = 0, math.floor(h/2)-1 do + s.data[2*d*h + y*d + 2 + 1].name = 'fun_caves:lumin_tree' + s.data[2*d*h + y*d + 2 + 1].param1 = 255 + end + + for z = 0, d-1 do + for y = math.floor(h/2), h-1 do + for x = 0, w-1 do + if y < h - 1 or (x ~= 0 and x ~= w-1 and z ~= 0 and z ~= d-1) then + s.data[z*d*h + y*d + x + 1].name = 'fun_caves:leaves_lumin' + + if y == h-1 or x == 0 or x == w-1 or z == 0 or z == d-1 then + s.data[z*d*h + y*d + x + 1].param1 = 150 + else + s.data[z*d*h + y*d + x + 1].param1 = 225 + end + end + end + end + end + + for z = math.floor(d/2)-1, math.floor(d/2)+1, 2 do + for x = math.floor(w/2)-1, math.floor(w/2)+1, 2 do + s.data[z*d*h + math.floor(h/2)*d + x + 1].name = 'fun_caves:lumin_tree' + s.data[z*d*h + math.floor(h/2)*d + x + 1].param1 = 150 + end + end + + for y = 0, h-1 do + if y / 3 == math.floor(y / 3) then + s.yslice_prob[#s.yslice_prob+1] = {ypos=y,prob=170} + end + end + + fun_caves.schematics['lumin_tree'] = s +end + dofile(fun_caves.path .. "/deco_caves.lua") --dofile(fun_caves.path.."/deco_dirt.lua") diff --git a/deco_clouds.lua b/deco_clouds.lua index efc6dff..37abb10 100644 --- a/deco_clouds.lua +++ b/deco_clouds.lua @@ -1,6 +1,90 @@ local newnode = fun_caves.clone_node("default:dirt") newnode.description = "Cloud" -newnode.tiles = {'fun_caves_storm_cloud.png'} +newnode.tiles = {'fun_caves_cloud.png'} newnode.sunlight_propagates = true minetest.register_node("fun_caves:cloud", newnode) + +newnode = fun_caves.clone_node("default:dirt") +newnode.description = "Storm Cloud" +newnode.tiles = {'fun_caves_storm_cloud.png'} +--newnode.sunlight_propagates = true +minetest.register_node("fun_caves:storm_cloud", newnode) + +newnode = fun_caves.clone_node("default:dirt") +newnode.description = "Wispy Cloud" +newnode.tiles = {'fun_caves_wisp.png'} +newnode.sunlight_propagates = true +newnode.use_texture_alpha = true +newnode.walkable = false +newnode.buildable_to = true +newnode.pointable = false +minetest.register_node("fun_caves:wispy_cloud", newnode) + +minetest.register_node("fun_caves:moon_weed", { + description = "Moon Weed", + drawtype = "plantlike", + tiles = {"fun_caves_moon_weed.png"}, + inventory_image = "fun_caves_moon_weed.png", + waving = false, + sunlight_propagates = true, + paramtype = "light", + light_source = 8, + walkable = false, + groups = {snappy=3,flammable=2,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, +}) + +minetest.register_node("fun_caves:leaves_lumin", { + description = "Leaves", + drawtype = "allfaces_optional", + waving = 1, + visual_scale = 1.3, + tiles = {"default_leaves.png^[colorize:#FFDF00:150"}, + special_tiles = {"default_leaves_simple.png^[colorize:#FFDF00:150"}, + paramtype = "light", + is_ground_content = false, + light_source = 8, + groups = {snappy = 3, leafdecay = 4, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + --{ + -- -- player will get sapling with 1/20 chance + -- items = {'default:sapling'}, + -- rarity = 20, + --}, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {'fun_caves:leaves_lumin'}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("fun_caves:lumin_tree", { + description = "Lumin Tree", + tiles = { + "default_tree_top.png", "default_tree_top.png", "fun_caves_lumin_tree.png" + }, + paramtype = "light", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}, } + }, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + + on_place = minetest.rotate_node +}) diff --git a/deco_plants.lua b/deco_plants.lua index 17f7c60..a0c5913 100644 --- a/deco_plants.lua +++ b/deco_plants.lua @@ -134,6 +134,14 @@ for _, plant in ipairs(fun_caves.plantlist) do def2.tiles = { "default_dirt.png", "fun_caves_"..plant.name..".png",} def2.drop = {max_items=2, items={{items={"fun_caves:"..plant.name}, rarity=1}, {items={"default:dirt"}, rarity=1}}} minetest.register_node("fun_caves:"..plant.name.."_water_soil", def2) + def2 = table.copy(def) + def2.tiles = { "fun_caves_cloud.png", "fun_caves_"..plant.name..".png",} + def2.drop = {max_items=2, items={{items={"fun_caves:"..plant.name}, rarity=1}, {items={"fun_caves:cloud"}, rarity=1}}} + minetest.register_node("fun_caves:"..plant.name.."_water_cloud", def2) + def2 = table.copy(def) + def2.tiles = { "fun_caves_storm_cloud.png", "fun_caves_"..plant.name..".png",} + def2.drop = {max_items=2, items={{items={"fun_caves:"..plant.name}, rarity=1}, {items={"fun_caves:storm_cloud"}, rarity=1}}} + minetest.register_node("fun_caves:"..plant.name.."_water_storm_cloud", def2) end end @@ -199,9 +207,17 @@ do local water_plant_1_def_soil = table.copy(water_plant_1_def_sand) water_plant_1_def_soil.place_on = {"group:soil"} water_plant_1_def_soil.decoration = {"fun_caves:water_plant_1_water_soil",} + local water_plant_1_def_cloud = table.copy(water_plant_1_def_sand) + water_plant_1_def_cloud.place_on = {"group:cloud"} + water_plant_1_def_cloud.decoration = {"fun_caves:water_plant_1_water_cloud",} + local water_plant_1_def_storm_cloud = table.copy(water_plant_1_def_sand) + water_plant_1_def_storm_cloud.place_on = {"group:cloud"} + water_plant_1_def_storm_cloud.decoration = {"fun_caves:water_plant_1_water_storm_cloud",} register_water_plant(water_plant_1_def_sand) register_water_plant(water_plant_1_def_soil) + register_water_plant(water_plant_1_def_cloud) + register_water_plant(water_plant_1_def_storm_cloud) end diff --git a/decogen.lua b/decogen.lua index 998cd95..4119e98 100644 --- a/decogen.lua +++ b/decogen.lua @@ -26,79 +26,6 @@ local csize local node_match_cache = {} -local function place_schematic(minp, maxp, data, p2data, area, node, pos, schem, center) - local rot = rand(4) - 1 - local yslice = {} - if schem.yslice_prob then - for _, ys in pairs(schem.yslice_prob) do - yslice[ys.ypos] = ys.prob - end - end - - if center then - pos.x = pos.x - floor(schem.size.x / 2) - pos.z = pos.z - floor(schem.size.z / 2) - end - - for z1 = 0, schem.size.z - 1 do - for x1 = 0, schem.size.x - 1 do - local x, z - if rot == 0 then - x, z = x1, z1 - elseif rot == 1 then - x, z = schem.size.z - z1 - 1, x1 - elseif rot == 2 then - x, z = schem.size.x - x1 - 1, schem.size.z - z1 - 1 - elseif rot == 3 then - x, z = z1, schem.size.x - x1 - 1 - end - local dz = pos.z - minp.z + z - local dx = pos.x - minp.x + x - if pos.x + x > minp.x and pos.x + x < maxp.x and pos.z + z > minp.z and pos.z + z < maxp.z then - local ivm = area:index(pos.x + x, pos.y, pos.z + z) - local isch = z1 * schem.size.y * schem.size.x + x1 + 1 - for y = 0, schem.size.y - 1 do - local dy = pos.y - minp.y + y - --if math.min(dx, csize.x - dx) + math.min(dy, csize.y - dy) + math.min(dz, csize.z - dz) > bevel then - if yslice[y] or 255 >= rand(255) then - local prob = schem.data[isch].prob or schem.data[isch].param1 or 255 - if prob >= rand(255) and schem.data[isch].name ~= "air" then - data[ivm] = node[schem.data[isch].name] - end - local param2 = schem.data[isch].param2 or 0 - p2data[ivm] = param2 - end - --end - - ivm = ivm + area.ystride - isch = isch + schem.size.x - end - end - end - end -end - -local function surround(node, data, area, ivm) - -- Check to make sure that a plant root is fully surrounded. - -- This is due to the kludgy way you have to make water plants - -- in minetest, to avoid bubbles. - for x1 = -1,1,2 do - local n = data[ivm+x1] - if n == node["default:river_water_source"] or n == node["default:water_source"] or n == node["air"] then - return false - end - end - for z1 = -area.zstride,area.zstride,2*area.zstride do - local n = data[ivm+z1] - if n == node["default:river_water_source"] or n == node["default:water_source"] or n == node["air"] then - return false - end - end - - return true -end - - local biome_noise = {offset = 0.0, scale = 1.0, spread = {x = 400, y = 400, z = 400}, seed = 903, octaves = 3, persist = 0.5, lacunarity = 2.0} local plant_noise = {offset = 0.0, scale = 1.0, spread = {x = 200, y = 200, z = 200}, seed = 33, octaves = 3, persist = 0.7, lacunarity = 2.0} @@ -308,7 +235,7 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi end end if air_count > 6 then - place_schematic(minp, maxp, data, p2data, area, node, {x=x,y=y,z=z}, fun_caves.schematics['decaying_tree'], true) + fun_caves.place_schematic(minp, maxp, data, p2data, area, node, {x=x,y=y,z=z}, fun_caves.schematics['decaying_tree'], true) end end elseif node_below == node["default:dirt"] and biome and biome.fungi then @@ -380,7 +307,7 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi local node_below = data[ivm - area.ystride] local node_above = data[ivm + area.ystride] - if y < water_level and data[ivm] == node["default:sand"] and node_above == node["default:water_source"] and data[ivm + area.ystride * 2] == node["default:water_source"] and coral_biomes[biome] and pn < -0.1 and rand(5) == 1 and surround(node, data, area, ivm) then + if y < water_level and data[ivm] == node["default:sand"] and node_above == node["default:water_source"] and data[ivm + area.ystride * 2] == node["default:water_source"] and coral_biomes[biome] and pn < -0.1 and rand(5) == 1 and fun_caves.surround(node, data, area, ivm) then if rand(100) == 1 then data[ivm] = node["fun_caves:precious_coral_water_sand"] else @@ -404,7 +331,7 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi end elseif x < maxp.x and y < maxp.y and z < maxp.z and x > minp.x and y > minp.y and z > minp.z and (node_above == node["default:water_source"] or node_above == node["default:river_water_source"]) and (data[ivm] == node["default:sand"] or data[ivm] == node["default:dirt"]) then -- Check the biomes and plant water plants, if called for. - if not surround(node, data, area, ivm) then + if not fun_caves.surround(node, data, area, ivm) then break end diff --git a/mapgen.lua b/mapgen.lua index 838d3af..e3d1822 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -74,6 +74,78 @@ fun_caves.is_fortress = function(pos, cs, debug) return false end +fun_caves.place_schematic = function(minp, maxp, data, p2data, area, node, pos, schem, center) + local rot = rand(4) - 1 + local yslice = {} + if schem.yslice_prob then + for _, ys in pairs(schem.yslice_prob) do + yslice[ys.ypos] = ys.prob + end + end + + if center then + pos.x = pos.x - floor(schem.size.x / 2) + pos.z = pos.z - floor(schem.size.z / 2) + end + + for z1 = 0, schem.size.z - 1 do + for x1 = 0, schem.size.x - 1 do + local x, z + if rot == 0 then + x, z = x1, z1 + elseif rot == 1 then + x, z = schem.size.z - z1 - 1, x1 + elseif rot == 2 then + x, z = schem.size.x - x1 - 1, schem.size.z - z1 - 1 + elseif rot == 3 then + x, z = z1, schem.size.x - x1 - 1 + end + local dz = pos.z - minp.z + z + local dx = pos.x - minp.x + x + if pos.x + x > minp.x and pos.x + x < maxp.x and pos.z + z > minp.z and pos.z + z < maxp.z then + local ivm = area:index(pos.x + x, pos.y, pos.z + z) + local isch = z1 * schem.size.y * schem.size.x + x1 + 1 + for y = 0, schem.size.y - 1 do + local dy = pos.y - minp.y + y + --if math.min(dx, csize.x - dx) + math.min(dy, csize.y - dy) + math.min(dz, csize.z - dz) > bevel then + if yslice[y] or 255 >= rand(255) then + local prob = schem.data[isch].prob or schem.data[isch].param1 or 255 + if prob >= rand(255) and schem.data[isch].name ~= "air" then + data[ivm] = node[schem.data[isch].name] + end + local param2 = schem.data[isch].param2 or 0 + p2data[ivm] = param2 + end + --end + + ivm = ivm + area.ystride + isch = isch + schem.size.x + end + end + end + end +end + +fun_caves.surround = function(node, data, area, ivm) + -- Check to make sure that a plant root is fully surrounded. + -- This is due to the kludgy way you have to make water plants + -- in minetest, to avoid bubbles. + for x1 = -1,1,2 do + local n = data[ivm+x1] + if n == node["default:river_water_source"] or n == node["default:water_source"] or n == node["air"] then + return false + end + end + for z1 = -area.zstride,area.zstride,2*area.zstride do + local n = data[ivm+z1] + if n == node["default:river_water_source"] or n == node["default:water_source"] or n == node["air"] then + return false + end + end + + return true +end + fun_caves.underzones = { Caina = { @@ -303,7 +375,7 @@ local function generate(p_minp, p_maxp, seed) end if minp.y > 3000 then - write = fun_caves.cloudgen(minp, maxp, data, area, node) + write = fun_caves.cloudgen(minp, maxp, data, p2data, area, node) elseif not underzone and fun_caves.is_fortress(minp, csize) then --if not underzone then fun_caves.fortress(minp, maxp, data, area, node) diff --git a/mobs.lua b/mobs.lua index f109be9..4700583 100644 --- a/mobs.lua +++ b/mobs.lua @@ -75,6 +75,28 @@ fun_caves.custom_ready = function(self) end +if minetest.registered_entities["kpgmobs:wolf"] then + local m = table.copy(minetest.registered_entities["kpgmobs:wolf"]) + m.textures = { {"fun_caves_white_wolf.png"}, } + m.base_texture = m.textures[1] + + minetest.registered_entities["fun_caves:white_wolf"] = m + mobs.spawning_mobs["fun_caves:white_wolf"] = true + + mobs:register_spawn("fun_caves:white_wolf", {"default:dirt_with_snow", "fun_caves:cloud", "fun_caves:storm_cloud"}, 20, -1, 11000, 3, 31000) + mobs:register_egg("fun_caves:white_wolf", "White Wolf", "wool_white.png", 1) +end + +if minetest.registered_entities["kpgmobs:horse2"] then + mobs:register_spawn("kpgmobs:horse2", {"fun_caves:cloud", "fun_caves:storm_cloud"}, 20, 8, 11000, 1, 31000) +end + +if minetest.registered_entities["mobs_fish:clownfish"] then + --local l_spawn_near = {"default:sand","default:dirt","group:seaplants","group:seacoral"} + mobs:spawn_specific("mobs_fish:clownfish", {"default:water_source", "default:water_flowing"}, {"default:sand","default:dirt", "fun_caves:cloud", "fun_caves:storm_cloud","group:seaplants","group:seacoral"}, 5, 20, 30, 10000, 1, 4000, 31000) + mobs:spawn_specific("mobs_fish:tropical", {"default:water_source", "default:water_flowing"}, {"default:sand","default:dirt", "fun_caves:cloud", "fun_caves:storm_cloud","group:seaplants","group:seacoral"}, 5, 20, 30, 10000, 1, 4000, 31000) +end + if minetest.registered_entities["mobs_monster:spider"] then -- Deep spider local m = table.copy(minetest.registered_entities["mobs_monster:spider"]) diff --git a/nodes.lua b/nodes.lua index 8d69383..bafd191 100644 --- a/nodes.lua +++ b/nodes.lua @@ -1,6 +1,6 @@ local get_node_or_nil = minetest.get_node_or_nil local get_item_group = minetest.get_item_group -local map_max = 31000 +local max_depth = 31000 local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) @@ -143,7 +143,7 @@ local function teleporter(user, area, power) else local newpos if area == 'overworld' then - newpos = {x=(math.random(2)*2-3)*(math.random(math.floor(map_max/6))+power*math.floor(map_max/6)), y=120, z=(math.random(2)*2-3)*(math.random(math.floor(map_max/6))+power*math.floor(map_max/6))} + newpos = {x=(math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6)), y=120, z=(math.random(2)*2-3)*(math.random(math.floor(max_depth/6))+power*math.floor(max_depth/6))} elseif area == 'hell' then newpos = {x=pos.x, y=fun_caves.underzones[({'Caina','Phlegethos','Dis','Minauros','Styx'})[power+1]].ceiling-30, z=pos.z} else @@ -467,7 +467,7 @@ newnode.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local meta = minetest.get_meta(pos) local ready = meta:get_string('formspec') if ready == '' then - local level = math.max(6, math.ceil(pos.y / math.floor(map_max / 6))) + local level = math.max(6, math.ceil(pos.y / math.floor(max_depth / 6))) local big_item = treasures[level][math.random(#treasures[level])] meta:set_string("formspec", chest_formspec) local inv = meta:get_inventory() diff --git a/textures/fun_caves_cloud.png b/textures/fun_caves_cloud.png new file mode 100644 index 0000000..1e4124d Binary files /dev/null and b/textures/fun_caves_cloud.png differ diff --git a/textures/fun_caves_moon_weed.png b/textures/fun_caves_moon_weed.png new file mode 100644 index 0000000..8445b7f Binary files /dev/null and b/textures/fun_caves_moon_weed.png differ diff --git a/textures/fun_caves_white_wolf.png b/textures/fun_caves_white_wolf.png new file mode 100644 index 0000000..b659f19 Binary files /dev/null and b/textures/fun_caves_white_wolf.png differ diff --git a/textures/fun_caves_wisp.png b/textures/fun_caves_wisp.png new file mode 100644 index 0000000..d67a1d6 Binary files /dev/null and b/textures/fun_caves_wisp.png differ diff --git a/textures/vmg_moon_weed.png b/textures/vmg_moon_weed.png deleted file mode 100644 index ea67943..0000000 Binary files a/textures/vmg_moon_weed.png and /dev/null differ