From cfa8cbb2a0183feedc22f75b07b42e63f485f07e Mon Sep 17 00:00:00 2001 From: Joel Leclerc Date: Mon, 16 Apr 2012 15:27:29 -0600 Subject: [PATCH] Added nether mod --- nether/init.lua | 344 ++++++++++++++++++++ nether/init.lua~ | 344 ++++++++++++++++++++ nether/textures/nether_apple.png | Bin 0 -> 254 bytes nether/textures/nether_leaves.png | Bin 0 -> 453 bytes nether/textures/nether_netherrack.png | Bin 0 -> 2331 bytes nether/textures/nether_torch.png | Bin 0 -> 289 bytes nether/textures/nether_torch_on_ceiling.png | Bin 0 -> 251 bytes nether/textures/nether_torch_on_floor.png | Bin 0 -> 229 bytes nether/textures/nether_tree.png | Bin 0 -> 655 bytes nether/textures/nether_tree_top.png | Bin 0 -> 654 bytes 10 files changed, 688 insertions(+) create mode 100644 nether/init.lua create mode 100644 nether/init.lua~ create mode 100644 nether/textures/nether_apple.png create mode 100644 nether/textures/nether_leaves.png create mode 100644 nether/textures/nether_netherrack.png create mode 100644 nether/textures/nether_torch.png create mode 100644 nether/textures/nether_torch_on_ceiling.png create mode 100644 nether/textures/nether_torch_on_floor.png create mode 100644 nether/textures/nether_tree.png create mode 100644 nether/textures/nether_tree_top.png diff --git a/nether/init.lua b/nether/init.lua new file mode 100644 index 0000000..9b7fe33 --- /dev/null +++ b/nether/init.lua @@ -0,0 +1,344 @@ +-- Nether Mod (based on Nyanland) +-- lkjoel (nyanland by Jeija) + +--== EDITABLE OPTIONS ==-- + +-- Depth of the nether +NETHER_DEPTH = -100 +-- Height of the nether (bottom of the nether is NETHER_DEPTH - NETHER_HEIGHT) +NETHER_HEIGHT = 20 +-- Frequency of lava (higher is less frequent) +LAVA_FREQ = 500 +-- Maximum height of lava +LAVA_HEIGHT = 3 +-- Frequency of nether trees (higher is less frequent) +NETHER_TREE_FREQ = 350 +-- Height of nether trees +NETHER_TREESIZE = 2 +-- Frequency of apples in a nether tree (higher is less frequent) +NETHER_APPLE_FREQ = 5 +-- Frequency of healing apples in a nether tree (higher is less frequent) +NETHER_HEAL_APPLE_FREQ = 10 +-- Start position for the throne of Hades (y is relative to the bottom of the nether) +HADES_THRONE_STARTPOS = {x=0, y=1, z=0} +-- Throne of Hades +HADES_THRONE = { + -- Floor 1 + {pos={x=0,y=0,z=0}, block="nether:netherrack"}, + {pos={x=1,y=0,z=0}, block="nether:netherrack"}, + {pos={x=2,y=0,z=0}, block="nether:netherrack"}, + {pos={x=3,y=0,z=0}, block="nether:netherrack"}, + {pos={x=4,y=0,z=0}, block="nether:netherrack"}, + {pos={x=5,y=0,z=0}, block="nether:netherrack"}, + {pos={x=5,y=0,z=1}, block="nether:netherrack"}, + {pos={x=5,y=0,z=2}, block="nether:netherrack"}, + {pos={x=5,y=0,z=3}, block="nether:netherrack"}, + {pos={x=5,y=0,z=4}, block="nether:netherrack"}, + {pos={x=5,y=0,z=5}, block="nether:netherrack"}, + {pos={x=4,y=0,z=5}, block="nether:netherrack"}, + {pos={x=3,y=0,z=5}, block="nether:netherrack"}, + {pos={x=2,y=0,z=5}, block="nether:netherrack"}, + {pos={x=1,y=0,z=5}, block="nether:netherrack"}, + {pos={x=0,y=0,z=5}, block="nether:netherrack"}, + {pos={x=0,y=0,z=4}, block="nether:netherrack"}, + {pos={x=0,y=0,z=3}, block="nether:netherrack"}, + {pos={x=0,y=0,z=2}, block="nether:netherrack"}, + {pos={x=0,y=0,z=1}, block="nether:netherrack"}, + -- Floor 2 + {pos={x=0,y=1,z=0}, block="nether:netherrack"}, + {pos={x=1,y=1,z=0}, block="nether:netherrack"}, + {pos={x=2,y=1,z=0}, block="nether:netherrack"}, + {pos={x=3,y=1,z=0}, block="nether:netherrack"}, + {pos={x=4,y=1,z=0}, block="nether:netherrack"}, + {pos={x=5,y=1,z=0}, block="nether:netherrack"}, + {pos={x=5,y=1,z=1}, block="nether:netherrack"}, + {pos={x=5,y=1,z=2}, block="nether:netherrack"}, + {pos={x=5,y=1,z=3}, block="nether:netherrack"}, + {pos={x=5,y=1,z=4}, block="nether:netherrack"}, + {pos={x=5,y=1,z=5}, block="nether:netherrack"}, + {pos={x=4,y=1,z=5}, block="nether:netherrack"}, + {pos={x=3,y=1,z=5}, block="nether:netherrack"}, + {pos={x=2,y=1,z=5}, block="nether:netherrack"}, + {pos={x=1,y=1,z=5}, block="nether:netherrack"}, + {pos={x=0,y=1,z=5}, block="nether:netherrack"}, + {pos={x=0,y=1,z=4}, block="nether:netherrack"}, + {pos={x=1,y=1,z=3}, block="nether:netherrack"}, + {pos={x=1,y=1,z=2}, block="nether:netherrack"}, + {pos={x=0,y=1,z=1}, block="nether:netherrack"}, + {pos={x=1,y=1,z=1}, block="nether:netherrack"}, + {pos={x=1,y=1,z=4}, block="nether:netherrack"}, + -- Floor 3 + {pos={x=0,y=2,z=0}, block="nether:netherrack"}, + {pos={x=1,y=2,z=0}, block="nether:netherrack"}, + {pos={x=2,y=2,z=0}, block="nether:netherrack"}, + {pos={x=3,y=2,z=0}, block="nether:netherrack"}, + {pos={x=4,y=2,z=0}, block="nether:netherrack"}, + {pos={x=5,y=2,z=0}, block="nether:netherrack"}, + {pos={x=5,y=2,z=1}, block="nether:netherrack"}, + {pos={x=5,y=2,z=2}, block="nether:netherrack"}, + {pos={x=5,y=2,z=3}, block="nether:netherrack"}, + {pos={x=5,y=2,z=4}, block="nether:netherrack"}, + {pos={x=5,y=2,z=5}, block="nether:netherrack"}, + {pos={x=4,y=2,z=5}, block="nether:netherrack"}, + {pos={x=3,y=2,z=5}, block="nether:netherrack"}, + {pos={x=2,y=2,z=5}, block="nether:netherrack"}, + {pos={x=1,y=2,z=5}, block="nether:netherrack"}, + {pos={x=0,y=2,z=5}, block="nether:netherrack"}, + {pos={x=0,y=2,z=4}, block="nether:netherrack"}, + {pos={x=2,y=2,z=3}, block="nether:netherrack"}, + {pos={x=2,y=2,z=2}, block="nether:netherrack"}, + {pos={x=0,y=2,z=1}, block="nether:netherrack"}, + {pos={x=1,y=2,z=1}, block="nether:netherrack"}, + {pos={x=1,y=2,z=4}, block="nether:netherrack"}, + {pos={x=2,y=2,z=1}, block="nether:netherrack"}, + {pos={x=2,y=2,z=4}, block="nether:netherrack"}, + -- Floor 4 + {pos={x=0,y=3,z=0}, block="nether:netherrack"}, + {pos={x=1,y=3,z=0}, block="nether:netherrack"}, + {pos={x=2,y=3,z=0}, block="nether:netherrack"}, + {pos={x=3,y=3,z=0}, block="nether:netherrack"}, + {pos={x=4,y=3,z=0}, block="nether:netherrack"}, + {pos={x=5,y=3,z=0}, block="nether:netherrack"}, + {pos={x=5,y=3,z=1}, block="nether:netherrack"}, + {pos={x=5,y=3,z=2}, block="nether:netherrack"}, + {pos={x=5,y=3,z=3}, block="nether:netherrack"}, + {pos={x=5,y=3,z=4}, block="nether:netherrack"}, + {pos={x=5,y=3,z=5}, block="nether:netherrack"}, + {pos={x=4,y=3,z=5}, block="nether:netherrack"}, + {pos={x=3,y=3,z=5}, block="nether:netherrack"}, + {pos={x=2,y=3,z=5}, block="nether:netherrack"}, + {pos={x=1,y=3,z=5}, block="nether:netherrack"}, + {pos={x=0,y=3,z=5}, block="nether:netherrack"}, + {pos={x=0,y=3,z=4}, block="nether:netherrack"}, + {pos={x=3,y=3,z=3}, block="nether:netherrack"}, + {pos={x=3,y=3,z=2}, block="nether:netherrack"}, + {pos={x=0,y=3,z=1}, block="nether:netherrack"}, + {pos={x=1,y=3,z=1}, block="nether:netherrack"}, + {pos={x=1,y=3,z=4}, block="nether:netherrack"}, + {pos={x=2,y=3,z=1}, block="nether:netherrack"}, + {pos={x=2,y=3,z=4}, block="nether:netherrack"}, + {pos={x=3,y=3,z=1}, block="nether:netherrack"}, + {pos={x=3,y=3,z=4}, block="nether:netherrack"}, + {pos={x=4,y=3,z=1}, block="nether:netherrack"}, + {pos={x=4,y=3,z=4}, block="nether:netherrack"}, + {pos={x=4,y=3,z=2}, block="nether:netherrack"}, + {pos={x=5,y=3,z=2}, block="nether:netherrack"}, + {pos={x=4,y=3,z=3}, block="nether:netherrack"}, + {pos={x=5,y=3,z=3}, block="nether:netherrack"}, + -- Floor 5 + {pos={x=4,y=4,z=2}, block="nether:netherrack"}, + {pos={x=5,y=4,z=2}, block="nether:netherrack"}, + {pos={x=4,y=4,z=3}, block="nether:netherrack"}, + {pos={x=5,y=4,z=3}, block="nether:netherrack"}, + -- Torches on floor 5 + {pos={x=4,y=4,z=0}, block="nether:nether_torch_bottom"}, + {pos={x=4,y=4,z=1}, block="nether:nether_torch_bottom"}, + {pos={x=5,y=4,z=0}, block="nether:nether_torch_bottom"}, + {pos={x=5,y=4,z=1}, block="nether:nether_torch_bottom"}, + {pos={x=4,y=4,z=4}, block="nether:nether_torch_bottom"}, + {pos={x=4,y=4,z=5}, block="nether:nether_torch_bottom"}, + {pos={x=5,y=4,z=4}, block="nether:nether_torch_bottom"}, + {pos={x=5,y=4,z=5}, block="nether:nether_torch_bottom"}, + {pos={x=0,y=4,z=0}, block="nether:nether_torch_bottom"}, + {pos={x=0,y=4,z=1}, block="nether:nether_torch_bottom"}, + {pos={x=1,y=4,z=0}, block="nether:nether_torch_bottom"}, + {pos={x=1,y=4,z=1}, block="nether:nether_torch_bottom"}, + {pos={x=0,y=4,z=4}, block="nether:nether_torch_bottom"}, + {pos={x=0,y=4,z=5}, block="nether:nether_torch_bottom"}, + {pos={x=1,y=4,z=4}, block="nether:nether_torch_bottom"}, + {pos={x=1,y=4,z=5}, block="nether:nether_torch_bottom"}, + -- Floor 6 + {pos={x=6,y=5,z=2}, block="nether:netherrack"}, + {pos={x=6,y=5,z=3}, block="nether:netherrack"}, + -- Floor 7 + {pos={x=6,y=6,z=2}, block="nether:netherrack"}, + {pos={x=6,y=6,z=3}, block="nether:netherrack"}, +} + +--== END OF EDITABLE OPTIONS ==-- + +-- Generated variables +NETHER_BOTTOM = (NETHER_DEPTH - NETHER_HEIGHT) +HADES_THRONE_STARTPOS_ABS = {x=HADES_THRONE_STARTPOS.x, y=(NETHER_BOTTOM + HADES_THRONE_STARTPOS.y), z=HADES_THRONE_STARTPOS.z} +LAVA_Y = (NETHER_BOTTOM + LAVA_HEIGHT) +HADES_THRONE_ABS = {} +for i,v in ipairs(HADES_THRONE) do + v.pos.x = v.pos.x + HADES_THRONE_STARTPOS_ABS.x + v.pos.y = v.pos.y + HADES_THRONE_STARTPOS_ABS.y + v.pos.z = v.pos.z + HADES_THRONE_STARTPOS_ABS.z + HADES_THRONE_ABS[i] = v +end +local nether = {} + +-- Netherrack +minetest.register_node("nether:netherrack", { + description = "Netherrack", + tile_images = {"nether_netherrack.png"}, + is_ground_content = true, + groups = {cracky=3}, + drop = "nether_netherrack.png", + sounds = default.node_sound_stone_defaults(), +}) + +-- Nether tree +minetest.register_node("nether:nether_tree", { + description = "Nether Tree", + tile_images = {"nether_tree_top.png", "nether_tree_top.png", "nether_tree.png"}, + is_ground_content = true, + groups = {tree=1, snappy=2, choppy=2, oddly_breakable_by_hand=1}, + sounds = default.node_sound_wood_defaults(), +}) + +-- Nether leaves +minetest.register_node("nether:nether_leaves", { + description = "Nether Leaves", + drawtype = "allfaces_optional", + visual_scale = 1.3, + tile_images = {"nether_leaves.png"}, + paramtype = "light", + groups = {snappy=3, leafdecay=2}, + drop = "nether:nether_leaves", + sounds = default.node_sound_leaves_defaults(), +}) + +-- Nether apple +minetest.register_node("nether:nether_apple", { + description = "Nether Apple", + drawtype = "plantlike", + visual_scale = 1.0, + tile_images = {"nether_apple.png"}, + inventory_image = "nether_apple.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + groups = {fleshy=3, dig_immediate=3}, + on_use = minetest.item_eat(-4), + sounds = default.node_sound_defaults(), +}) + +-- Nether torch +minetest.register_node("nether:nether_torch", { + description = "Nether Torch", + drawtype = "torchlike", + tile_images = {"nether_torch_on_floor.png", "nether_torch_on_ceiling.png", "nether_torch.png"}, + inventory_image = "nether_torch_on_floor.png", + wield_image = "nether_torch_on_floor.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + light_source = LIGHT_MAX - 1, + selection_box = { + type = "wallmounted", + wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1}, + }, + groups = {choppy=2, dig_immediate=3}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), +}) + +-- Nether torch (only shows the bottom torch. This is a hack) +minetest.register_node("nether:nether_torch_bottom", { + description = "Nether Torch Bottom Side (you hacker!)", + drawtype = "torchlike", + tile_images = {"nether_torch_on_floor.png", "nether_torch_on_floor.png", "nether_torch_floor.png"}, + inventory_image = "nether_torch_on_floor.png", + wield_image = "nether_torch_on_floor.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + walkable = false, + light_source = LIGHT_MAX - 1, + drop = "nether:nether_torch", + selection_box = { + type = "wallmounted", + wall_top = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_side = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + }, + groups = {choppy=2, dig_immediate=3}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), +}) + +-- Create the Nether +minetest.register_on_generated(function(minp, maxp) + local addpos = {} + hadesthronecounter = 1 + print("minp:" .. minp.y .. ", maxp:" .. maxp.y) + if ((maxp.y >= NETHER_BOTTOM) and (minp.y <= NETHER_DEPTH)) then + -- Pass 1: Terrain generation + for x=minp.x, maxp.x, 1 do + for y=minp.y, maxp.y, 1 do + for z=minp.z, maxp.z, 1 do + addpos = {x=x, y=y, z=z} + if y == NETHER_DEPTH or y == NETHER_BOTTOM then + minetest.env:add_node(addpos, {name="nether:netherrack"}) + elseif y <= NETHER_DEPTH and y >= NETHER_BOTTOM then + minetest.env:add_node(addpos, {name="air"}) + end + end + end + end + -- Pass 2: Details + for x=minp.x, maxp.x, 1 do + for y=minp.y, maxp.y, 1 do + for z=minp.z, maxp.z, 1 do + addpos = {x=x, y=y, z=z} + if y < NETHER_DEPTH and y > NETHER_BOTTOM then + if math.random(NETHER_TREE_FREQ) == 1 and y == (NETHER_BOTTOM + 1) then + nether:grow_nethertree(addpos) + elseif math.random(LAVA_FREQ) == 1 and y <= LAVA_Y then + minetest.env:add_node(addpos, {name="default:lava_source"}) + end + end + end + end + end + -- Pass 3: Throne of Hades + for i,v in ipairs(HADES_THRONE_ABS) do + minetest.env:add_node(v.pos, {name=v.block}) + end + print("DONE") + end +end) + +-- Create a nether tree +function nether:grow_nethertree(pos) + --TRUNK + pos.y=pos.y+1 + local trunkpos={x=pos.x, z=pos.z} + for y=pos.y, pos.y+4+math.random(2) do + trunkpos.y=y + minetest.env:add_node(trunkpos, {name="nether:nether_tree"}) + end + --LEAVES + local leafpos={} + for x=(trunkpos.x-NETHER_TREESIZE), (trunkpos.x+NETHER_TREESIZE), 1 do + for y=(trunkpos.y-NETHER_TREESIZE), (trunkpos.y+NETHER_TREESIZE), 1 do + for z=(trunkpos.z-NETHER_TREESIZE), (trunkpos.z+NETHER_TREESIZE), 1 do + if (x-trunkpos.x)*(x-trunkpos.x) + +(y-trunkpos.y)*(y-trunkpos.y) + +(z-trunkpos.z)*(z-trunkpos.z) + <= NETHER_TREESIZE*NETHER_TREESIZE + NETHER_TREESIZE then + leafpos={x=x, y=y, z=z} + if minetest.env:get_node(leafpos).name=="air" then + if math.random(NETHER_APPLE_FREQ) == 1 then + if math.random(NETHER_HEAL_APPLE_FREQ) == 1 then + minetest.env:add_node(leafpos, {name="default:apple"}) + else + minetest.env:add_node(leafpos, {name="nether:nether_apple"}) + end + else + minetest.env:add_node(leafpos, {name="nether:nether_leaves"}) + end + end + end + end + end + end +end + +print("Nether mod loaded!") diff --git a/nether/init.lua~ b/nether/init.lua~ new file mode 100644 index 0000000..81e6b03 --- /dev/null +++ b/nether/init.lua~ @@ -0,0 +1,344 @@ +-- Nether Mod (based on Nyanland) +-- lkjoel (nyanland by Jeija) + +--== EDITABLE OPTIONS ==-- + +-- Depth of the nether +NETHER_DEPTH = -100 +-- Height of the nether (bottom of the nether is NETHER_DEPTH - NETHER_HEIGHT) +NETHER_HEIGHT = 20 +-- Frequency of lava (higher is less frequent) +LAVA_FREQ = 500 +-- Maximum height of lava +LAVA_HEIGHT = 3 +-- Frequency of nether trees (higher is less frequent) +NETHER_TREE_FREQ = 350 +-- Height of nether trees +NETHER_TREESIZE = 2 +-- Frequency of apples in a nether tree (higher is less frequent) +NETHER_APPLE_FREQ = 5 +-- Frequency of healing apples in a nether tree (higher is less frequent) +NETHER_HEAL_APPLE_FREQ = 10 +-- Start position for the throne of Hades (y is relative to the bottom of the nether) +HADES_THRONE_STARTPOS = {x=0, y=1, z=0} +-- Throne of Hades +HADES_THRONE = { + -- Floor 1 + {pos={x=0,y=0,z=0}, block="nether:netherrack"}, + {pos={x=1,y=0,z=0}, block="nether:netherrack"}, + {pos={x=2,y=0,z=0}, block="nether:netherrack"}, + {pos={x=3,y=0,z=0}, block="nether:netherrack"}, + {pos={x=4,y=0,z=0}, block="nether:netherrack"}, + {pos={x=5,y=0,z=0}, block="nether:netherrack"}, + {pos={x=5,y=0,z=1}, block="nether:netherrack"}, + {pos={x=5,y=0,z=2}, block="nether:netherrack"}, + {pos={x=5,y=0,z=3}, block="nether:netherrack"}, + {pos={x=5,y=0,z=4}, block="nether:netherrack"}, + {pos={x=5,y=0,z=5}, block="nether:netherrack"}, + {pos={x=4,y=0,z=5}, block="nether:netherrack"}, + {pos={x=3,y=0,z=5}, block="nether:netherrack"}, + {pos={x=2,y=0,z=5}, block="nether:netherrack"}, + {pos={x=1,y=0,z=5}, block="nether:netherrack"}, + {pos={x=0,y=0,z=5}, block="nether:netherrack"}, + {pos={x=0,y=0,z=4}, block="nether:netherrack"}, + {pos={x=0,y=0,z=3}, block="nether:netherrack"}, + {pos={x=0,y=0,z=2}, block="nether:netherrack"}, + {pos={x=0,y=0,z=1}, block="nether:netherrack"}, + -- Floor 2 + {pos={x=0,y=1,z=0}, block="nether:netherrack"}, + {pos={x=1,y=1,z=0}, block="nether:netherrack"}, + {pos={x=2,y=1,z=0}, block="nether:netherrack"}, + {pos={x=3,y=1,z=0}, block="nether:netherrack"}, + {pos={x=4,y=1,z=0}, block="nether:netherrack"}, + {pos={x=5,y=1,z=0}, block="nether:netherrack"}, + {pos={x=5,y=1,z=1}, block="nether:netherrack"}, + {pos={x=5,y=1,z=2}, block="nether:netherrack"}, + {pos={x=5,y=1,z=3}, block="nether:netherrack"}, + {pos={x=5,y=1,z=4}, block="nether:netherrack"}, + {pos={x=5,y=1,z=5}, block="nether:netherrack"}, + {pos={x=4,y=1,z=5}, block="nether:netherrack"}, + {pos={x=3,y=1,z=5}, block="nether:netherrack"}, + {pos={x=2,y=1,z=5}, block="nether:netherrack"}, + {pos={x=1,y=1,z=5}, block="nether:netherrack"}, + {pos={x=0,y=1,z=5}, block="nether:netherrack"}, + {pos={x=0,y=1,z=4}, block="nether:netherrack"}, + {pos={x=1,y=1,z=3}, block="nether:netherrack"}, + {pos={x=1,y=1,z=2}, block="nether:netherrack"}, + {pos={x=0,y=1,z=1}, block="nether:netherrack"}, + {pos={x=1,y=1,z=1}, block="nether:netherrack"}, + {pos={x=1,y=1,z=4}, block="nether:netherrack"}, + -- Floor 3 + {pos={x=0,y=2,z=0}, block="nether:netherrack"}, + {pos={x=1,y=2,z=0}, block="nether:netherrack"}, + {pos={x=2,y=2,z=0}, block="nether:netherrack"}, + {pos={x=3,y=2,z=0}, block="nether:netherrack"}, + {pos={x=4,y=2,z=0}, block="nether:netherrack"}, + {pos={x=5,y=2,z=0}, block="nether:netherrack"}, + {pos={x=5,y=2,z=1}, block="nether:netherrack"}, + {pos={x=5,y=2,z=2}, block="nether:netherrack"}, + {pos={x=5,y=2,z=3}, block="nether:netherrack"}, + {pos={x=5,y=2,z=4}, block="nether:netherrack"}, + {pos={x=5,y=2,z=5}, block="nether:netherrack"}, + {pos={x=4,y=2,z=5}, block="nether:netherrack"}, + {pos={x=3,y=2,z=5}, block="nether:netherrack"}, + {pos={x=2,y=2,z=5}, block="nether:netherrack"}, + {pos={x=1,y=2,z=5}, block="nether:netherrack"}, + {pos={x=0,y=2,z=5}, block="nether:netherrack"}, + {pos={x=0,y=2,z=4}, block="nether:netherrack"}, + {pos={x=2,y=2,z=3}, block="nether:netherrack"}, + {pos={x=2,y=2,z=2}, block="nether:netherrack"}, + {pos={x=0,y=2,z=1}, block="nether:netherrack"}, + {pos={x=1,y=2,z=1}, block="nether:netherrack"}, + {pos={x=1,y=2,z=4}, block="nether:netherrack"}, + {pos={x=2,y=2,z=1}, block="nether:netherrack"}, + {pos={x=2,y=2,z=4}, block="nether:netherrack"}, + -- Floor 4 + {pos={x=0,y=3,z=0}, block="nether:netherrack"}, + {pos={x=1,y=3,z=0}, block="nether:netherrack"}, + {pos={x=2,y=3,z=0}, block="nether:netherrack"}, + {pos={x=3,y=3,z=0}, block="nether:netherrack"}, + {pos={x=4,y=3,z=0}, block="nether:netherrack"}, + {pos={x=5,y=3,z=0}, block="nether:netherrack"}, + {pos={x=5,y=3,z=1}, block="nether:netherrack"}, + {pos={x=5,y=3,z=2}, block="nether:netherrack"}, + {pos={x=5,y=3,z=3}, block="nether:netherrack"}, + {pos={x=5,y=3,z=4}, block="nether:netherrack"}, + {pos={x=5,y=3,z=5}, block="nether:netherrack"}, + {pos={x=4,y=3,z=5}, block="nether:netherrack"}, + {pos={x=3,y=3,z=5}, block="nether:netherrack"}, + {pos={x=2,y=3,z=5}, block="nether:netherrack"}, + {pos={x=1,y=3,z=5}, block="nether:netherrack"}, + {pos={x=0,y=3,z=5}, block="nether:netherrack"}, + {pos={x=0,y=3,z=4}, block="nether:netherrack"}, + {pos={x=3,y=3,z=3}, block="nether:netherrack"}, + {pos={x=3,y=3,z=2}, block="nether:netherrack"}, + {pos={x=0,y=3,z=1}, block="nether:netherrack"}, + {pos={x=1,y=3,z=1}, block="nether:netherrack"}, + {pos={x=1,y=3,z=4}, block="nether:netherrack"}, + {pos={x=2,y=3,z=1}, block="nether:netherrack"}, + {pos={x=2,y=3,z=4}, block="nether:netherrack"}, + {pos={x=3,y=3,z=1}, block="nether:netherrack"}, + {pos={x=3,y=3,z=4}, block="nether:netherrack"}, + {pos={x=4,y=3,z=1}, block="nether:netherrack"}, + {pos={x=4,y=3,z=4}, block="nether:netherrack"}, + {pos={x=4,y=3,z=2}, block="nether:netherrack"}, + {pos={x=5,y=3,z=2}, block="nether:netherrack"}, + {pos={x=4,y=3,z=3}, block="nether:netherrack"}, + {pos={x=5,y=3,z=3}, block="nether:netherrack"}, + -- Floor 5 + {pos={x=4,y=4,z=2}, block="nether:netherrack"}, + {pos={x=5,y=4,z=2}, block="nether:netherrack"}, + {pos={x=4,y=4,z=3}, block="nether:netherrack"}, + {pos={x=5,y=4,z=3}, block="nether:netherrack"}, + -- Torches on floor 5 + {pos={x=4,y=4,z=0}, block="nether:nether_torch_bottom"}, + {pos={x=4,y=4,z=1}, block="nether:nether_torch_bottom"}, + {pos={x=5,y=4,z=0}, block="nether:nether_torch_bottom"}, + {pos={x=5,y=4,z=1}, block="nether:nether_torch_bottom"}, + {pos={x=4,y=4,z=4}, block="nether:nether_torch_bottom"}, + {pos={x=4,y=4,z=5}, block="nether:nether_torch_bottom"}, + {pos={x=5,y=4,z=4}, block="nether:nether_torch_bottom"}, + {pos={x=5,y=4,z=5}, block="nether:nether_torch_bottom"}, + {pos={x=0,y=4,z=0}, block="nether:nether_torch_bottom"}, + {pos={x=0,y=4,z=1}, block="nether:nether_torch_bottom"}, + {pos={x=1,y=4,z=0}, block="nether:nether_torch_bottom"}, + {pos={x=1,y=4,z=1}, block="nether:nether_torch_bottom"}, + {pos={x=0,y=4,z=4}, block="nether:nether_torch_bottom"}, + {pos={x=0,y=4,z=5}, block="nether:nether_torch_bottom"}, + {pos={x=1,y=4,z=4}, block="nether:nether_torch_bottom"}, + {pos={x=1,y=4,z=5}, block="nether:nether_torch_bottom"}, + -- Floor 6 + {pos={x=6,y=5,z=2}, block="nether:netherrack"}, + {pos={x=6,y=5,z=3}, block="nether:netherrack"}, + -- Floor 7 + {pos={x=6,y=6,z=2}, block="nether:netherrack"}, + {pos={x=6,y=6,z=3}, block="nether:netherrack"}, +} + +--== END OF EDITABLE OPTIONS ==-- + +-- Generated variables +NETHER_BOTTOM = (NETHER_DEPTH - NETHER_HEIGHT) +HADES_THRONE_STARTPOS_ABS = {x=HADES_THRONE_STARTPOS.x, y=(NETHER_BOTTOM + HADES_THRONE_STARTPOS.y), z=HADES_THRONE_STARTPOS.z} +LAVA_Y = (NETHER_BOTTOM + LAVA_HEIGHT) +HADES_THRONE_ABS = {} +for i,v in ipairs(HADES_THRONE) do + v.pos.x = v.pos.x + HADES_THRONE_STARTPOS_ABS.x + v.pos.y = v.pos.y + HADES_THRONE_STARTPOS_ABS.y + v.pos.z = v.pos.z + HADES_THRONE_STARTPOS_ABS.z + HADES_THRONE_ABS[i] = v +end +local nether = {} + +-- Netherrack +minetest.register_node("nether:netherrack", { + description = "Netherrack", + tile_images = {"nether_netherrack.png"}, + is_ground_content = true, + groups = {cracky=3}, + drop = "nether_netherrack.png", + sounds = default.node_sound_stone_defaults(), +}) + +-- Nether tree +minetest.register_node("nether:nether_tree", { + description = "Nether Tree", + tile_images = {"nether_tree_top.png", "nether_tree_top.png", "nether_tree.png"}, + is_ground_content = true, + groups = {tree=1, snappy=2, choppy=2, oddly_breakable_by_hand=1}, + sounds = default.node_sound_wood_defaults(), +}) + +-- Nether leaves +minetest.register_node("nether:nether_leaves", { + description = "Nether Leaves", + drawtype = "allfaces_optional", + visual_scale = 1.3, + tile_images = {"nether_leaves.png"}, + paramtype = "light", + groups = {snappy=3, leafdecay=2}, + drop = "nether:nether_leaves", + sounds = default.node_sound_leaves_defaults(), +}) + +-- Nether apple +minetest.register_node("nether:nether_apple", { + description = "Nether Apple", + drawtype = "plantlike", + visual_scale = 1.0, + tile_images = {"nether_apple.png"}, + inventory_image = "nether_apple.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + groups = {fleshy=3, dig_immediate=3}, + on_use = minetest.item_eat(-4), + sounds = default.node_sound_defaults(), +}) + +-- Nether torch +minetest.register_node("nether:nether_torch", { + description = "Nether Torch", + drawtype = "torchlike", + tile_images = {"nether_torch_on_floor.png", "nether_torch_on_ceiling.png", "nether_torch.png"}, + inventory_image = "nether_torch_on_floor.png", + wield_image = "nether_torch_on_floor.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + light_source = LIGHT_MAX - 1, + selection_box = { + type = "wallmounted", + wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1}, + }, + groups = {choppy=2, dig_immediate=3}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), +}) + +-- Nether torch (only shows the bottom torch. This is a hack) +minetest.register_node("nether:nether_torch_bottom", { + description = "Nether Torch Bottom Side (you hacker!)", + drawtype = "torchlike", + tile_images = {"nether_torch_on_floor.png", "nether_torch_on_floor.png", "nether_torch_floor.png"}, + inventory_image = "nether_torch_on_floor.png", + wield_image = "nether_torch_on_floor.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + light_source = LIGHT_MAX - 1, + drop = "nether:nether_torch", + selection_box = { + type = "wallmounted", + wall_top = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_side = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + }, + groups = {choppy=2, dig_immediate=3}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), +}) + +-- Create the Nether +minetest.register_on_generated(function(minp, maxp) + local addpos = {} + hadesthronecounter = 1 + print("minp:" .. minp.y .. ", maxp:" .. maxp.y) + if ((maxp.y >= NETHER_BOTTOM) and (minp.y <= NETHER_DEPTH)) then + -- Pass 1: Terrain generation + for x=minp.x, maxp.x, 1 do + for y=minp.y, maxp.y, 1 do + for z=minp.z, maxp.z, 1 do + addpos = {x=x, y=y, z=z} + if y == NETHER_DEPTH or y == NETHER_BOTTOM then + minetest.env:add_node(addpos, {name="nether:netherrack"}) + elseif y <= NETHER_DEPTH and y >= NETHER_BOTTOM then + minetest.env:add_node(addpos, {name="air"}) + end + end + end + end + -- Pass 2: Details + for x=minp.x, maxp.x, 1 do + for y=minp.y, maxp.y, 1 do + for z=minp.z, maxp.z, 1 do + addpos = {x=x, y=y, z=z} + if y < NETHER_DEPTH and y > NETHER_BOTTOM then + if math.random(NETHER_TREE_FREQ) == 1 and y == (NETHER_BOTTOM + 1) then + nether:grow_nethertree(addpos) + elseif math.random(LAVA_FREQ) == 1 and y <= LAVA_Y then + minetest.env:add_node(addpos, {name="default:lava_source"}) + end + end + end + end + end + -- Pass 3: Throne of Hades + for i,v in ipairs(HADES_THRONE_ABS) do + minetest.env:add_node(v.pos, {name=v.block}) + end + print("DONE") + end +end) + +-- Create a nether tree +function nether:grow_nethertree(pos) + --TRUNK + pos.y=pos.y+1 + local trunkpos={x=pos.x, z=pos.z} + for y=pos.y, pos.y+4+math.random(2) do + trunkpos.y=y + minetest.env:add_node(trunkpos, {name="nether:nether_tree"}) + end + --LEAVES + local leafpos={} + for x=(trunkpos.x-NETHER_TREESIZE), (trunkpos.x+NETHER_TREESIZE), 1 do + for y=(trunkpos.y-NETHER_TREESIZE), (trunkpos.y+NETHER_TREESIZE), 1 do + for z=(trunkpos.z-NETHER_TREESIZE), (trunkpos.z+NETHER_TREESIZE), 1 do + if (x-trunkpos.x)*(x-trunkpos.x) + +(y-trunkpos.y)*(y-trunkpos.y) + +(z-trunkpos.z)*(z-trunkpos.z) + <= NETHER_TREESIZE*NETHER_TREESIZE + NETHER_TREESIZE then + leafpos={x=x, y=y, z=z} + if minetest.env:get_node(leafpos).name=="air" then + if math.random(NETHER_APPLE_FREQ) == 1 then + if math.random(NETHER_HEAL_APPLE_FREQ) == 1 then + minetest.env:add_node(leafpos, {name="default:apple"}) + else + minetest.env:add_node(leafpos, {name="nether:nether_apple"}) + end + else + minetest.env:add_node(leafpos, {name="nether:nether_leaves"}) + end + end + end + end + end + end +end + +print("Nether mod loaded!") diff --git a/nether/textures/nether_apple.png b/nether/textures/nether_apple.png new file mode 100644 index 0000000000000000000000000000000000000000..d72e5a2ece85d5747918bf91e51a33d5dd4b4c85 GIT binary patch literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^LM& zEQYm@mRbTS&H|6fVg?4j!ywFfJby(BP>{XE)7O>#4vPSzxPy zk(9V+(^6n(Y+!KYaX|lRR-RiYd3g9GBqY`u7#PGHcFdgVhed!vMRB7+SuoHPS5Ftm5R22L z!3S408wkv4X%G|TT4=s7?oZ>qU+Vvg{Qotyx2JQ8goIR-++R9*`_{KHOwMIy#=8v} z3T!J63U61OvFpUq<(!9h9bA5ryZjtq#$nmJ7Lp7FzM);F-@d2Mx|_?v#wC)uD(F@L zJHwaHO?h*Cf~PVuh%v~0DtP{;Vb_VJE4^MGJK0j|9I^cdC&LLw2G&@6{f{fFH|&@{ z{fAU+h(6u7nQDXWl_czsXY z;a#rUPj(d=P3xL(bGeT%aPdm7PDLh%*e8e9ooQX9C0r@JSZ#}}*i~1(-yd!j{GZR% z=^wn{!#%Z!-&&4+ebQQ4b5pQVb6t1L7KQKg8SAp1l~njY-L7ZnoAmMP6W8v@zrvRB tdXwTLK0SZK@V9yHz1R5(=4@+?e=_?ANw;69Z`%cm08dvxmvv4FO#oI=x5EGc literal 0 HcmV?d00001 diff --git a/nether/textures/nether_netherrack.png b/nether/textures/nether_netherrack.png new file mode 100644 index 0000000000000000000000000000000000000000..66cccbe1aae02abd1ce6c0bdb99282f06f5c16ad GIT binary patch literal 2331 zcmV+$3FP*PP)Px#24YJ`L;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7h^^m%&PfT9V?GlRMKGv|5NJm;!!~nLUG?GA3#qk&@$yt?aOV(+WNZbXT;WAf<3a4@Air^qd zBJ3^sfbr9mMc_dOmr{XE)7O>#4vT;QuU1{tWCx(oLQfaR5R22v z2@A|;q$dBFuXOgi*!jQqr;q)xKcnDQ6#HP(yrUb^pP8_U1)1(%lD@FRaPp$cb7z0^ zF!8@L(3m;H=*>*a-aiIAwpYBXHx69*AEf)di(i79$W$W(1A__Ax!8b!+wkFkHYcY4 zk`fXUCyEXpamZ&&7G!Lj{Ic-B{XE)7O>#4vT;QzgY6^URR({wWo_?h{fsT zgagcTmLB=1{h{Fh@#SrujZO_$8+3f1{tv(P>VJBcma)d?LgSds)yH3Qxy1-Y&N}sf z?vf)CAn?t$`sf5v>B9?xub%LjvN=I7;OXO^>kl3O{NF43?|+aHDnE6-gC*BRw)VH% mFrT>Alf!XymixgDCWig14DHU|Zgc=TgTd3)&t;ucLK6UY!CnXe literal 0 HcmV?d00001 diff --git a/nether/textures/nether_torch_on_floor.png b/nether/textures/nether_torch_on_floor.png new file mode 100644 index 0000000000000000000000000000000000000000..16962dada862e25c5a54a75c9b11802c9b75b317 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^LM& zEQYm@mRbTS&H|6fVg?4j!ywFfJby(BP>{XE)7O>#4vT;QKj*v44I6+$sh%#5Ar_~T z6C_w!4(doh{x6bgCM^2Pf12Wvth7VwGZ(Ep@nF)t*6Y$fJ96e1f3|D(t`cJg0!Qb9 zs)zR;?R?V8xG9a>F!58eVx;fG|0lm#d}5v`alqwrNQQ#S2m46h#%*y746@<|w|)yG Rv;i$-@O1TaS?83{1OR?QO5y+j literal 0 HcmV?d00001 diff --git a/nether/textures/nether_tree.png b/nether/textures/nether_tree.png new file mode 100644 index 0000000000000000000000000000000000000000..5d55d20cb014bbfa87ba71d755f9d29ef1175bbb GIT binary patch literal 655 zcmV;A0&x9_P)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