LeMagnesium 2015-12-30 17:55:37 +01:00
parent d55b90a857
commit 85d6b14791
18 changed files with 169 additions and 99 deletions

2
mods/nether/LICENSE.txt Normal file
View File

@ -0,0 +1,2 @@
GPLv3 (lkloel's version)
WTFPL for the changes

21
mods/nether/README.md Normal file
View File

@ -0,0 +1,21 @@
[Mod] nether-pack [nether-pack]
This is a modified version of lkjoel's nether mod.
Look here if you want to see the differences:
https://github.com/HybridDog/minetest-nether/compare/lkjoel:master...master
Sadly lkjoel's one disappeared…
**Depends:** see [depends.txt](https://raw.githubusercontent.com/HybridDog/nether-pack/master/nether/depends.txt)
**License:** see [LICENSE.txt](https://raw.githubusercontent.com/HybridDog/nether-pack/master/LICENSE.txt)
**Download:** [zip](https://github.com/HybridDog/nether-pack/archive/master.zip), [tar.gz](https://github.com/HybridDog/nether-pack/tarball/master)
this happens really selden to me
![I'm a screenshot!](http://i.imgur.com/pMZYqt9.png)
If you got ideas or found bugs, please tell them to me.
[How to install a mod?](http://wiki.minetest.net/Installing_Mods)
TODO:
— find a way to get the perlin noise inside [-1; 1] or use another noise

View File

@ -137,6 +137,14 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "nether:torch",
recipe = {
{"nether:bark"},
{"group:stick"},
}
})
minetest.register_craft({
output = "nether:forest_wood",
recipe = {
@ -162,36 +170,38 @@ minetest.register_craft({
local sound_allowed = true
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
if itemstack:get_name() == "nether:forest_planks"
and itemstack:get_count() == 7 then
local tree
for i = 1,9 do
if old_craft_grid[i]:get_name() == "nether:tree" then
tree = i
break
end
end
if not tree then -- do nth if theres no tree
return
end
local rdif = math.random(-1,1) -- add a bit randomness
local barkstack = ItemStack("nether:bark "..4-rdif)
local inv = player:get_inventory()
if not inv:room_for_item("main", barkstack) then -- disallow crafting if there's not enough free space
craft_inv:set_list("craft", old_craft_grid)
itemstack:set_name("")
return
end
itemstack:set_count(7+rdif)
inv:add_item("main", barkstack)
if sound_allowed then
minetest.sound_play("default_wood_footstep", {pos=player:getpos(), gain=0.25})
sound_allowed = false
minetest.after(0, function()
sound_allowed = true
end)
if itemstack:get_name() ~= "nether:forest_planks"
or itemstack:get_count() ~= 7 then
return
end
local tree
for i = 1,9 do
if old_craft_grid[i]:get_name() == "nether:tree" then
tree = i
break
end
end
if not tree then -- do nth if theres no tree
return
end
local rdif = math.random(-1,1) -- add a bit randomness
local barkstack = ItemStack("nether:bark "..4-rdif)
local inv = player:get_inventory()
if not inv:room_for_item("main", barkstack) then -- disallow crafting if there's not enough free space
craft_inv:set_list("craft", old_craft_grid)
itemstack:set_name("")
return
end
itemstack:set_count(7+rdif)
inv:add_item("main", barkstack)
if not sound_allowed then -- avoid playing the sound multiple times, e.g. when middle mouse click
return
end
minetest.sound_play("default_wood_footstep", {pos=player:getpos(), gain=0.25})
sound_allowed = false
minetest.after(0, function()
sound_allowed = true
end)
end)
minetest.register_craft({

View File

@ -2,4 +2,5 @@ default
glow
riesenpilz
stairs
fence_registration?
watershed?

View File

@ -11,6 +11,8 @@
-- godkiller447 (ideas)
-- If I didn't list you, please let me know!
local load_time_start = os.clock()
if not rawget(_G, "nether") then
nether = {}
end
@ -1029,4 +1031,11 @@ dofile(path.."/crafting.lua")
dofile(path.."/portal.lua")
dofile(path.."/guide.lua")
nether:inform("loaded!", 1)
local time = math.floor(tonumber(os.clock()-load_time_start)*100+0.5)/100
local msg = "[nether] loaded after ca. "..time
if time > 0.05 then
minetest.log("warning", msg)
else
minetest.log("info", msg)
end

View File

@ -4,46 +4,55 @@ local nether_sound = default.node_sound_stone_defaults({
footstep = {name="nether_footstep", gain=0.4}
})
local function add_stair_and_slab(name)
local add_fence = minetest.register_fence
local function add_more_nodes(name)
local nd = "nether:"..name
if not string.find(name, "nether") then
name = "nether_"..name
end
local data = minetest.registered_nodes[nd]
stairs.register_stair_and_slab(name, nd,
data.groups,
data.tiles,
data.description.." Stair",
data.description.." Slab",
data.sounds
data.groups,
data.tiles,
data.description.." Stair",
data.description.." Slab",
data.sounds
)
if add_fence then
add_fence({fence_of = nd})
end
end
--[[
local function add_fence(name)
local def = minetest.registered_nodes[name]
local fencedef = {}
for _,i in pairs({"walkable", "sunlike_propagates"}) do
if def[i] ~= nil then
fencedef[i] = def[i]
end
end
end
--]]
local function digging_allowed(player, v)
if not player then
return false
end
--[[local tool = minetest.registered_tools[player:get_wielded_item():get_name()]
if not tool then
local tool = minetest.registered_tools[player:get_wielded_item():get_name()]
if not tool
or not tool.tool_capabilities then
return false
end
local capabilities = tool.tool_capabilities
if not capabilities then
return false
end
local groups = capabilities.groupcaps
local groups = tool.tool_capabilities.groupcaps
if not groups then
return false
end
local nether = groups.nether
if not nether then
return false
end
if nether.times[v] then
if groups.nether
and groups.nether.times[v] then
return true
end
return false]]
return true
return false
end
-- Netherrack
@ -56,7 +65,7 @@ minetest.register_node("nether:netherrack", {
return digging_allowed(player, 2)
end,
})
add_stair_and_slab("netherrack")
add_more_nodes("netherrack")
minetest.register_node("nether:netherrack_tiled", {
description = "Tiled Netherrack",
@ -67,7 +76,7 @@ minetest.register_node("nether:netherrack_tiled", {
return digging_allowed(player, 2)
end,
})
add_stair_and_slab("netherrack_tiled")
add_more_nodes("netherrack_tiled")
minetest.register_node("nether:netherrack_soil", {
description = "Dirty Netherrack",
@ -88,7 +97,7 @@ minetest.register_node("nether:netherrack_black", {
return digging_allowed(player, 2)
end,
})
add_stair_and_slab("netherrack_black")
add_more_nodes("netherrack_black")
minetest.register_node("nether:netherrack_blue", {
description = "Blue Netherrack",
@ -99,7 +108,7 @@ minetest.register_node("nether:netherrack_blue", {
return digging_allowed(player, 1)
end,
})
add_stair_and_slab("netherrack_blue")
add_more_nodes("netherrack_blue")
-- Netherbrick
minetest.register_node("nether:netherrack_brick", {
@ -111,7 +120,7 @@ minetest.register_node("nether:netherrack_brick", {
return digging_allowed(player, 3)
end,
})
add_stair_and_slab("netherrack_brick")
add_more_nodes("netherrack_brick")
minetest.register_node("nether:netherrack_brick_blue", {
description = "Blue Netherrack Brick",
@ -122,7 +131,7 @@ minetest.register_node("nether:netherrack_brick_blue", {
return digging_allowed(player, 3)
end,
})
add_stair_and_slab("netherrack_brick_blue")
add_more_nodes("netherrack_brick_blue")
minetest.register_node("nether:netherrack_brick_black", {
description = "Black Netherrack Brick",
@ -133,7 +142,7 @@ minetest.register_node("nether:netherrack_brick_black", {
return digging_allowed(player, 3)
end,
})
add_stair_and_slab("netherrack_brick_black")
add_more_nodes("netherrack_brick_black")
minetest.register_node("nether:white", {
description = "Siwtonic block",
@ -144,7 +153,7 @@ minetest.register_node("nether:white", {
return digging_allowed(player, 1)
end,
})
add_stair_and_slab("white")
add_more_nodes("white")
-- Nether blood
@ -170,7 +179,7 @@ minetest.register_node("nether:blood", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=1},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("blood")
add_more_nodes("blood")
minetest.register_node("nether:blood_cooked", {
description = "Cooked Nether Blood",
@ -182,7 +191,7 @@ minetest.register_node("nether:blood_cooked", {
return digging_allowed(player, 3)
end,
})
add_stair_and_slab("blood_cooked")
add_more_nodes("blood_cooked")
minetest.register_node("nether:blood_empty", {
description = "Nether Blood Extracted",
@ -190,7 +199,7 @@ minetest.register_node("nether:blood_empty", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=1},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("blood_empty")
add_more_nodes("blood_empty")
minetest.register_node("nether:blood_top", {
@ -199,7 +208,7 @@ minetest.register_node("nether:blood_top", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=1},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("blood_top")
add_more_nodes("blood_top")
minetest.register_node("nether:blood_top_cooked", {
description = "Cooked Nether Blood Head",
@ -211,7 +220,7 @@ minetest.register_node("nether:blood_top_cooked", {
return digging_allowed(player, 3)
end,
})
add_stair_and_slab("blood_top_cooked")
add_more_nodes("blood_top_cooked")
minetest.register_node("nether:blood_top_empty", {
description = "Nether Blood Head Extracted",
@ -219,7 +228,7 @@ minetest.register_node("nether:blood_top_empty", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=1},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("blood_top_empty")
add_more_nodes("blood_top_empty")
minetest.register_node("nether:blood_stem", {
@ -228,7 +237,7 @@ minetest.register_node("nether:blood_stem", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=1},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("blood_stem")
add_more_nodes("blood_stem")
minetest.register_node("nether:blood_stem_cooked", {
description = "Cooked Nether Blood Stem",
@ -240,7 +249,7 @@ minetest.register_node("nether:blood_stem_cooked", {
return digging_allowed(player, 3)
end,
})
add_stair_and_slab("blood_stem_cooked")
add_more_nodes("blood_stem_cooked")
minetest.register_node("nether:blood_stem_empty", {
description = "Nether Blood Stem Extracted",
@ -248,7 +257,7 @@ minetest.register_node("nether:blood_stem_empty", {
groups = {tree=1, choppy=2, oddly_breakable_by_hand=1},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("blood_stem_empty")
add_more_nodes("blood_stem_empty")
minetest.register_node("nether:wood", {
@ -257,7 +266,7 @@ minetest.register_node("nether:wood", {
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("wood")
add_more_nodes("wood")
minetest.register_node("nether:wood_cooked", {
description = "Cooked Nether Blood Wood",
@ -269,7 +278,7 @@ minetest.register_node("nether:wood_cooked", {
return digging_allowed(player, 3)
end,
})
add_stair_and_slab("wood_cooked")
add_more_nodes("wood_cooked")
minetest.register_node("nether:wood_empty", {
description = "Nether Wood",
@ -277,7 +286,7 @@ minetest.register_node("nether:wood_empty", {
groups = {choppy=2, oddly_breakable_by_hand=2, wood=1},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("wood_empty")
add_more_nodes("wood_empty")
minetest.register_node("nether:extractor", {
description = "Nether Blood Extractor",
@ -297,7 +306,7 @@ minetest.register_node("nether:fruit_leaves", {
sounds = default.node_sound_defaults(),
furnace_burntime = 18,
})
add_stair_and_slab("fruit_leaves")
add_more_nodes("fruit_leaves")
local function room_for_items(inv)
local free_slots = 0
@ -368,6 +377,17 @@ minetest.register_node("nether:apple", {
return itemstack
end
local p_hunger = tonumber(hbhunger.hunger[user:get_player_name()])
if not p_hunger then
return
end
p_hunger = p_hunger + 9
if p_hunger > 30 then
p_hunger = 30
end
hbhunger.hunger[user:get_player_name()] = p_hunger
hbhunger.set_hunger(user)
local amount = math.random(4, 6)
inv:add_item("main", {name="nether:blood_extracted", count=math.floor(amount/3)})
user:set_hp(user:get_hp()-amount)
@ -508,7 +528,7 @@ minetest.register_node("nether:forest_wood", {
groups = {choppy=2,oddly_breakable_by_hand=2,wood=1},
sounds = default.node_sound_wood_defaults(),
})
add_stair_and_slab("forest_wood")
add_more_nodes("forest_wood")
minetest.register_node("nether:leaves", {
description = "Nether Leaves",
@ -545,7 +565,9 @@ minetest.register_node("nether:dirt", {
minetest.register_node("nether:dirt_top", {
description = "Nether Dirt Top",
tiles = {"nether_dirt_top.png", "nether_dirt.png", "nether_dirt.png^nether_dirt_top_side.png"},
tiles = {"nether_dirt_top.png", "nether_dirt.png",
{name="nether_dirt.png^nether_dirt_top_side.png", tileable_vertical = false}
},
groups = {crumbly=3,soil=1,nether_dirt=1},
drop = "nether:dirt",
sounds = default.node_sound_dirt_defaults({
@ -555,7 +577,9 @@ minetest.register_node("nether:dirt_top", {
minetest.register_node("nether:dirt_bottom", {
description = "Netherrack Dirt Transition",
tiles = {"nether_dirt.png", "nether_netherrack.png", "nether_netherrack.png^nether_dirt_transition.png"},
tiles = {"nether_dirt.png", "nether_netherrack.png",
{name="nether_netherrack.png^nether_dirt_transition.png", tileable_vertical = false}
},
groups = {nether=2},
drop = "nether:netherrack",
sounds = default.node_sound_dirt_defaults({
@ -596,7 +620,7 @@ minetest.register_node("nether:torch", {
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, attached_node=1, hot=2},
groups = {choppy=2, dig_immediate=3, attached_node=1, hot=3, igniter=1},
legacy_wallmounted = true,
sounds = default.node_sound_defaults(),
})

View File

@ -89,53 +89,42 @@ local function player_exists(name)
return false
end
-- Chatcommands removed
--[[ Chatcommands (edited) written by sss
minetest.register_chatcommand("to_hell", {
params = "",
params = "[<player_name>]",
description = "Send someone to hell",
func = function(name, pname)
if not minetest.get_player_privs(name).nether then
local self_player = minetest.get_player_by_name(name)
if self_player then
return false, "You can't send anyone to hell."
else
return false, "Something went wrong."
end
if not minetest.check_player_privs(name, {nether=true}) then
return false, "You need the nether priv to execute this chatcommand."
end
if not player_exists(pname) then
pname = name
end
local player = minetest.get_player_by_name(pname)
if not player then
minetest.chat_send_player(name, "Something went wrong.")
return false
return false, "Something went wrong."
end
minetest.chat_send_player(pname, "Go to hell !!!")
player_to_nether(player)
return true
return true, pname.." is now in the nether."
end
})
minetest.register_chatcommand("from_hell", {
params = "",
params = "[<player_name>]",
description = "Extract from hell",
func = function(name, pname)
if not minetest.get_player_privs(name).nether then
local self_player = minetest.get_player_by_name(name)
if self_player then
return false, "You can't extract anyone from hell"
else
return false, "Something went wrong."
end
if not minetest.check_player_privs(name, {nether=true}) then
return false, "You need the nether priv to execute this chatcommand."
end
if not player_exists(pname) then
pname = name
end
local player = minetest.get_player_by_name(pname)
if not player then
minetest.chat_send_player(name, "Something went wrong.")
return false
return false, "Something went wrong."
end
minetest.chat_send_player(pname, "You are free now")
player_from_nether(player)
@ -219,6 +208,7 @@ minetest.register_abm({
nodenames = {"nether:portal"},
interval = 1,
chance = 2,
catch_up = false,
action = function(pos, node)
if not abm_allowed then
return
@ -439,7 +429,6 @@ minetest.override_item("default:obsidian", {
minetest.after(0.1, function()
minetest.override_item("default:mese_crystal_fragment", {
on_place = function(stack, player, pt)
print("moo")
if pt.under
and minetest.get_node(pt.under).name == "default:obsidian" then
print("[nether] tries to enable a portal")
@ -520,11 +509,22 @@ local function netherport(pos)
return true
end
-- cache known portals
local known_portals_d = {}
local known_portals_u = {}
local function get_portal(t, z,x)
return t[z] and t[z][x]
end
local function set_portal(t, z,x, y)
t[z] = t[z] or {}
t[z][x] = y
end
function nether_port(player, pos)
if not player
or not pos
or not pos.x then
print("[nether] something failed.")
minetest.log("error", "[nether] nether_port: something failed.")
return
end
if not netherport(pos) then
@ -541,8 +541,11 @@ function nether_port(player, pos)
end
player:moveto(pos_togo)
else
player:moveto({x=pos.x, y=portal_target+math.random(4), z=pos.z})
nether.player_to_nether(player, true)
set_portal(known_portals_u, pos.z,pos.x, pos.y)
pos.y = get_portal(known_portals_d, pos.z,pos.x) or portal_target+math.random(4)
player:moveto(pos)
player_to_nether(player, true)
end
minetest.sound_play("nether_teleporter", {pos=pos})
return true
end

0
mods/nether/nether/rest/Nicht Leere Datei.lua Executable file → Normal file
View File

BIN
mods/nether/nether/rest/nether_fruit_leaves.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
mods/nether/nether/rest/nether_glowstone.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
mods/nether/nether/rest/nether_leaves.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 572 B

BIN
mods/nether/nether/rest/nether_netherrack.png1 Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
mods/nether/nether/rest/nether_portal_creator.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 762 B

BIN
mods/nether/nether/rest/nether_tree.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 574 B

BIN
mods/nether/nether/rest/nether_tree_top.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

After

Width:  |  Height:  |  Size: 612 B

0
mods/nether/nether/rest/temp.txt Executable file → Normal file
View File