mirror of
https://github.com/minetest-mods/nether.git
synced 2025-08-01 07:50:20 +02:00
Compare commits
31 Commits
v3.6
...
96a7ac2977
Author | SHA1 | Date | |
---|---|---|---|
96a7ac2977 | |||
1df107ab94 | |||
69e8253193 | |||
0eb79653d8 | |||
23a6919a49 | |||
dc21f026f6 | |||
6f312d6999 | |||
e3e793d5be | |||
96ef16bf2a | |||
44f3912add | |||
4ff727909c | |||
7f5b4277dd | |||
733ac1690a | |||
3b3fb6d1dd | |||
3292146e3c | |||
e5e74c839f | |||
bd2e065ad9 | |||
776a8c95b0 | |||
4950143a00 | |||
ddd27690eb | |||
e0656eacae | |||
89db416d09 | |||
bfdd8d18b4 | |||
60d4f8c7df | |||
281d6fc07f | |||
97cf3250e4 | |||
c0481ea4ca | |||
3577fd1f5e | |||
9ab325fa8c | |||
9e3d5bf997 | |||
c5ef9136ec |
@ -27,12 +27,9 @@ read_globals = {
|
||||
"stairsplus",
|
||||
"string.split",
|
||||
table = { fields = { "copy", "getn" } },
|
||||
"technic",
|
||||
"toolranks",
|
||||
"vector",
|
||||
"VoxelArea",
|
||||
"VoxelManip",
|
||||
"walls",
|
||||
xpanes = { fields = { "register_pane" } },
|
||||
}
|
||||
|
||||
|
10
init.lua
10
init.lua
@ -57,8 +57,8 @@ nether.fogColor = { -- only used if climate_api is installed
|
||||
|
||||
|
||||
-- Settings
|
||||
nether.DEPTH_CEILING = -5000 -- The y location of the Nether's celing
|
||||
nether.DEPTH_FLOOR = -11000 -- The y location of the Nether's floor
|
||||
nether.DEPTH_CEILING = -25000 -- The y location of the Nether's celing
|
||||
nether.DEPTH_FLOOR = -31000 -- The y location of the Nether's floor
|
||||
nether.FASTTRAVEL_FACTOR = 8 -- 10 could be better value for Minetest, since there's no sprint, but ex-Minecraft players will be mathing for 8
|
||||
nether.PORTAL_BOOK_LOOT_WEIGHTING = 0.9 -- Likelyhood of finding the Book of Portals (guide) in dungeon chests. Set to 0 to disable.
|
||||
nether.NETHER_REALM_ENABLED = true -- Setting to false disables the Nether and Nether portal
|
||||
@ -144,9 +144,7 @@ if nether.NETHER_REALM_ENABLED then
|
||||
end
|
||||
end
|
||||
dofile(nether.path .. "/portal_examples.lua")
|
||||
if minetest.get_modpath("technic") then
|
||||
dofile(nether.path .. "/nether-compressor-recipe.lua")
|
||||
end
|
||||
|
||||
|
||||
-- Portals are ignited by right-clicking with a mese crystal fragment
|
||||
nether.register_portal_ignition_item(
|
||||
@ -347,4 +345,4 @@ minetest.register_on_dieplayer(
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
)
|
2
mod.conf
2
mod.conf
@ -1,4 +1,4 @@
|
||||
name = nether
|
||||
description = Adds a deep underground realm with different mapgen that you can reach with obsidian portals.
|
||||
depends = stairs, default
|
||||
optional_depends = toolranks, technic, moreblocks, mesecons, loot, dungeon_loot, doc_basics, fire, climate_api, ethereal, xpanes, walls
|
||||
optional_depends = moreblocks, mesecons, loot, dungeon_loot, doc_basics, fire, climate_api, ethereal, xpanes, walls
|
||||
|
@ -1,40 +0,0 @@
|
||||
local S = minetest.get_translator("nether")
|
||||
|
||||
technic.register_recipe_type("compressing", { description = S("Compressing") })
|
||||
|
||||
function register_compressor_recipe(data)
|
||||
data.time = data.time or 4
|
||||
technic.register_recipe("compressing", data)
|
||||
end
|
||||
|
||||
local recipes = {
|
||||
{"nether:rack", "nether:brick",},
|
||||
{"nether:rack_deep", "nether:brick_deep"},
|
||||
{"nether:brick 9", "nether:brick_compressed", 12},
|
||||
{"nether:brick_compressed 9", "nether:nether_lump", 12}
|
||||
|
||||
}
|
||||
-- clear craft recipe
|
||||
-- But allow brick blocks to be crafted like the other bricks from Minetest Game
|
||||
|
||||
minetest.clear_craft({
|
||||
recipe = {
|
||||
{"nether:brick","nether:brick","nether:brick"},
|
||||
{"nether:brick","nether:brick","nether:brick"},
|
||||
{"nether:brick","nether:brick","nether:brick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.clear_craft({
|
||||
recipe = {
|
||||
{"nether:brick_compressed","nether:brick_compressed","nether:brick_compressed"},
|
||||
{"nether:brick_compressed","nether:brick_compressed","nether:brick_compressed"},
|
||||
{"nether:brick_compressed","nether:brick_compressed","nether:brick_compressed"},
|
||||
}
|
||||
})
|
||||
|
||||
for _, data in pairs(recipes) do
|
||||
register_compressor_recipe({input = {data[1]}, output = data[2], time = data[3]})
|
||||
end
|
||||
|
||||
|
@ -2166,20 +2166,27 @@ function nether.unregister_portal(name)
|
||||
end
|
||||
|
||||
function nether.register_portal_ignition_item(item_name, ignition_failure_sound)
|
||||
local old_on_place = minetest.registered_items[item_name].on_place or minetest.item_place
|
||||
|
||||
minetest.override_item(item_name, {
|
||||
on_place = function(stack, placer, pt, ...)
|
||||
if pt.under and nether.is_frame_node[minetest.get_node(pt.under).name] then
|
||||
local done = ignite_portal(pt.under, placer:get_player_name())
|
||||
on_place = function(stack, placer, pt)
|
||||
local node = minetest.get_node(pt.under)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
local done = false
|
||||
|
||||
if pt.under and nether.is_frame_node[node.name] then
|
||||
done = ignite_portal(pt.under, placer:get_player_name())
|
||||
if done and not minetest.settings:get_bool("creative_mode") then
|
||||
stack:take_item()
|
||||
end
|
||||
if not done and ignition_failure_sound ~= nil then
|
||||
minetest.sound_play(ignition_failure_sound, {pos = pt.under, max_hear_distance = 10})
|
||||
end
|
||||
return stack
|
||||
elseif def and def.on_rightclick then
|
||||
def.on_rightclick(pt.under, node, placer, stack, pt)
|
||||
end
|
||||
return old_on_place(stack, placer, pt, ...)
|
||||
|
||||
if not done and ignition_failure_sound ~= nil then
|
||||
minetest.sound_play(ignition_failure_sound, {pos = pt.under, max_hear_distance = 10})
|
||||
end
|
||||
|
||||
return stack
|
||||
end,
|
||||
})
|
||||
|
||||
|
32
tools.lua
32
tools.lua
@ -153,38 +153,6 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
|
||||
if minetest.get_modpath("toolranks") then
|
||||
|
||||
local function add_toolranks(name)
|
||||
local nethertool_after_use = ItemStack(name):get_definition().after_use
|
||||
toolranks.add_tool(name)
|
||||
local toolranks_after_use = ItemStack(name):get_definition().after_use
|
||||
|
||||
if nethertool_after_use == nil or nethertool_after_use == toolranks_after_use then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.override_item(name, {
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
-- combine nethertool_after_use and toolranks_after_use by allowing
|
||||
-- nethertool_after_use() to calculate the wear...
|
||||
local initial_wear = itemstack:get_wear()
|
||||
itemstack = nethertool_after_use(itemstack, user, node, digparams)
|
||||
local wear = itemstack:get_wear() - initial_wear
|
||||
itemstack:set_wear(initial_wear) -- restore/undo the wear
|
||||
|
||||
-- ...and have toolranks_after_use() apply the wear.
|
||||
digparams.wear = wear
|
||||
return toolranks_after_use(itemstack, user, node, digparams)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
add_toolranks("nether:pick_nether")
|
||||
add_toolranks("nether:shovel_nether")
|
||||
add_toolranks("nether:axe_nether")
|
||||
add_toolranks("nether:sword_nether")
|
||||
end
|
||||
|
||||
|
||||
--===========================--
|
||||
|
Reference in New Issue
Block a user