Fix bugs introduced by Minetest 5.0

This commit is contained in:
rubenwardy 2019-01-08 21:24:35 +00:00
parent 5daefadc7e
commit 947715fbe8
120 changed files with 3874 additions and 1011 deletions

@ -1 +1 @@
Subproject commit 9e2581925aed31e5572507a0aba8120c18f41fa0
Subproject commit 99bac967d656014ee44201936e4c1884a21f3ada

View file

@ -4,14 +4,20 @@ See license.txt for license information.
Authors of source code
----------------------
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
Various Minetest developers and contributors (LGPL 2.1)
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPLv2.1+)
Various Minetest developers and contributors (LGPLv2.1+)
Authors of media (textures, models and sounds)
----------------------------------------------
The torch code was derived by sofar from the 'torches' mod by
BlockMen (LGPLv2.1+)
Authors of media (textures, sounds, models and schematics)
----------------------------------------------------------
Everything not listed in here:
celeron55, Perttu Ahola <celeron55@gmail.com> (CC BY-SA 3.0)
Textures
--------
Cisoun's texture pack (CC BY-SA 3.0):
default_jungletree.png
default_lava.png
@ -23,25 +29,15 @@ Cisoun's texture pack (CC BY-SA 3.0):
default_tree_top.png
default_water.png
Cisoun's conifers mod (CC BY-SA 3.0):
default_pine_needles.png
Originating from G4JC's Almost MC Texture Pack (CC BY-SA 3.0):
default_torch.png
default_torch_on_ceiling.png
default_torch_on_floor.png
VanessaE's animated torches (CC BY-SA 3.0):
default_torch_animated.png
default_torch_on_ceiling_animated.png
default_torch_on_floor_animated.png
default_torch_on_floor.png
RealBadAngel's animated water (CC BY-SA 3.0):
default_water_source_animated.png
default_water_flowing_animated.png
VanessaE (CC BY-SA 3.0):
default_torch_animated.png
default_torch_on_ceiling_animated.png
default_torch_on_floor_animated.png
default_torch_on_floor.png
default_desert_sand.png
default_desert_stone.png
default_sand.png
@ -52,13 +48,6 @@ Calinou (CC BY-SA 3.0):
default_brick.png
default_papyrus.png
default_mineral_copper.png
default_glass_detail.png
MirceaKitsune (CC BY-SA 3.0):
character.x
Jordach (CC BY-SA 3.0):
character.png
PilzAdam (CC BY-SA 3.0):
default_jungleleaves.png
@ -75,6 +64,7 @@ InfinityProject (CC BY-SA 3.0):
Splizard (CC BY-SA 3.0):
default_pine_sapling.png
default_pine_needles.png
Zeg9 (CC BY-SA 3.0):
default_coal_block.png
@ -88,11 +78,13 @@ paramat (CC BY-SA 3.0):
default_acacia_leaves_simple.png
default_acacia_sapling.png
default_acacia_bush_sapling.png
default_pine_bush_sapling.png
default_acacia_tree.png
default_acacia_tree_top.png
default_acacia_wood.png
default_acacia_bush_stem.png
default_bush_stem.png
default_pine_bush_stem.png
default_junglewood.png
default_jungletree_top.png
default_sandstone_brick.png
@ -119,9 +111,23 @@ paramat (CC BY-SA 3.0):
default_silver_sandstone.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0)
default_silver_sandstone_brick.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0)
default_silver_sandstone_block.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0)
default_bookshelf_slot.png -- Derived from a texture by Gambit (CC-BY-SA 3.0)
default_marram_grass_*.png -- Derived from textures by TumeniNodes (CC-BY-SA 3.0)
default_emergent_jungle_sapling.png
default_permafrost.png -- Derived from a texture by Neuromancer (CC BY-SA 3.0)
default_stones.png -- Derived from a texture by sofar (CC0 1.0)
default_moss.png
default_moss_side.png
default_fence_rail_acacia_wood
default_fence_rail_aspen_wood -- Derived from a texture by sofar (CC BY-SA 3.0)
default_fence_rail_junglewood
default_fence_rail_pine_wood
default_fence_rail_wood -- Derived from a texture by BlockMen (CC BY-SA 3.0)
brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
TumeniNodes (CC BY-SA 3.0):
default_desert_cobble.png -- Derived from a texture by brunob.santos (CC BY-SA 3.0)
default_coniferous_litter.png
default_coniferous_litter_side.png
BlockMen (CC BY-SA 3.0):
default_aspen_leaves.png -- Derived from Sofar's texture
@ -131,7 +137,6 @@ BlockMen (CC BY-SA 3.0):
default_gold_ingot.png
default_tool_steelsword.png
default_diamond.png
default_book.png
default_tool_*.png
default_lava_source_animated.png
default_lava_flowing_animated.png
@ -145,26 +150,19 @@ BlockMen (CC BY-SA 3.0):
bubble.png
gui_*.png
Wuzzy (CC BY-SA 3.0):
default_bookshelf_slot.png (based on default_book.png)
sofar (CC BY-SA 3.0):
default_book_written.png, based on default_book.png
default_aspen_sapling
default_aspen_tree
default_aspen_tree_top, derived from default_pine_tree_top (by paramat)
default_aspen_wood, derived from default_pine_wood (by paramat)
default_chest_inside
sofar (WTFPL):
sofar (CC0 1.0):
default_gravel.png -- Derived from Gambit's PixelBOX texture pack light gravel
Neuromancer (CC BY-SA 2.0):
Neuromancer (CC BY-SA 3.0):
default_cobble.png, based on texture by Brane praefect
default_mossycobble.png, based on texture by Brane praefect
Neuromancer (CC BY-SA 3.0):
default_dirt.png
default_furnace_*.png
Gambit (CC BY-SA 3.0):
@ -186,11 +184,12 @@ Gambit (CC BY-SA 3.0):
default_snowball.png
default_key.png
default_key_skeleton.png
default_book.png
asl97 (CC BY-SA 3.0):
default_ice.png
KevDoy (CC BY-SA 3.0)
KevDoy (CC BY-SA 3.0):
heart.png
Pithydon (CC BY-SA 3.0)
@ -198,11 +197,10 @@ Pithydon (CC BY-SA 3.0)
default_coral_orange.png
default_coral_skeleton.png
Ferk (CC0 1.0)
Ferk (CC0 1.0):
default_item_smoke.png
default_item_smoke.ogg, based on sound by http://opengameart.org/users/bart
npx (CC BY-SA 3.0)
npx (CC BY-SA 3.0):
default_rainforest_litter.png
default_rainforest_litter_side.png
@ -221,15 +219,42 @@ kilbith (CC BY-SA 3.0):
default_tin_ingot.png
default_tin_lump.png
tobyplowy (CC BY-SA 3.0):
default_kelp.png
CloudyProton (CC BY-SA 3.0):
default_book_written.png, based on default_book.png by Gambit
Mossmanikin (CC BY-SA 3.0):
default_fern_*.png
random-geek (CC BY-SA 3.0):
default_blueberries.png
default_blueberry_overlay.png
default_blueberry_bush_leaves.png, derived from default_bush_leaves (by paramat)
default_blueberry_bush_sapling.png
default_dirt.png -- Derived from a texture by Neuromancer (CC BY-SA 3.0)
Krock (CC0 1.0):
default_glass.png
default_glass_detail.png
Topywo (CC BY-SA 3.0)
default_coral_cyan.png
default_coral_green.png
default_coral_pink.png
Extex101 (CC BY-SA 3.0)
default_large_cactus_seedling.png
Sounds
------
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/
3: http://www.freesound.org/people/lsprice/sounds/88808/
sonictechtonic (CC BY 3.0):
https://www.freesound.org/people/sonictechtonic/sounds/241872/
player_damage.ogg
Mito551 (sounds) (CC BY-SA 3.0):
default_dig_choppy.ogg
default_dig_cracky.ogg
@ -252,8 +277,6 @@ Mito551 (sounds) (CC BY-SA 3.0):
default_place_node.3.ogg
default_place_node_hard.1.ogg
default_place_node_hard.2.ogg
default_snow_footstep.1.ogg
default_snow_footstep.2.ogg
default_hard_footstep.1.ogg
default_hard_footstep.2.ogg
default_hard_footstep.3.ogg
@ -278,14 +301,14 @@ Metal sounds:
Tool breaking sounds added by sofar: CC-BY-3.0
default_tool_breaks.* - http://www.freesound.org/people/HerbertBoland/sounds/33206/
AGFX (CC BY 3.0)
AGFX (CC BY 3.0):
https://www.freesound.org/people/AGFX/packs/1253/
default_water_footstep.1.ogg
default_water_footstep.2.ogg
default_water_footstep.3.ogg
(default_water_footstep.4.ogg is silent)
blukotek (CC0 1.0)
blukotek (CC0 1.0):
https://www.freesound.org/people/blukotek/sounds/251660/
default_dig_snappy.ogg
@ -298,3 +321,59 @@ Chests sounds added by sofar, derived of several files mixed together:
- http://www.freesound.org/people/bulbastre/sounds/126887/ CC-BY-3.0
- http://www.freesound.org/people/Yoyodaman234/sounds/183541/ CC0
Ryding (CC0 1.0):
http://freesound.org/people/Ryding/sounds/94337/
default_snow_footstep.*.ogg
Ferk (CC0 1.0):
default_item_smoke.ogg, based on a sound by http://opengameart.org/users/bart
Models
------
sofar (CC BY-SA 3.0):
chest_open.obj
torch_ceiling.obj
torch_floor.obj
torch_wall.obj
Schematics
----------
paramat (CC BY-SA 3.0):
acacia_bush.mts
acacia_tree.mts
acacia_tree_from_sapling.mts
apple_tree.mts
apple_tree_from_sapling.mts
aspen_tree.mts
aspen_tree_from_sapling.mts
bush.mts
emergent_jungle_tree.mts
emergent_jungle_tree_from_sapling.mts
jungle_tree.mts
jungle_tree_from_sapling.mts
large_cactus.mts
papyrus.mts
pine_tree.mts
pine_tree_from_sapling.mts
snowy_pine_tree_from_sapling.mts
small_pine_tree.mts
small_pine_tree_from_sapling.mts
snowy_small_pine_tree_from_sapling.mts
Shara RedCat (CC BY-SA 3.0):
acacia_log.mts
apple_log.mts
aspen_log.mts
jungle_log.mts
pine_log.mts
sofar (CC BY-SA 3.0):
corals.mts
TumeniNodes (CC BY-SA 3.0):
pine_bush.mts
random-geek (CC BY-SA 3.0):
blueberry_bush.mts

View file

@ -1,5 +1,16 @@
-- mods/default/crafting.lua
--
-- Crafting (tool repair)
--
minetest.register_craft({
type = "toolrepair",
additional_wear = -0.02,
})
--
-- Cooking recipes
--
@ -10,6 +21,12 @@ minetest.register_craft({
recipe = "group:sand",
})
minetest.register_craft({
type = "cooking",
output = "default:obsidian_glass",
recipe = "default:obsidian_shard",
})
minetest.register_craft({
type = "cooking",
output = "default:stone",
@ -46,17 +63,38 @@ minetest.register_craft({
recipe = "default:tin_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:gold_ingot",
recipe = "default:gold_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:clay_brick",
recipe = "default:clay_lump",
})
minetest.register_craft({
type = 'cooking',
output = 'default:gold_ingot',
recipe = 'default:skeleton_key',
cooktime = 5,
})
minetest.register_craft({
type = 'cooking',
output = 'default:gold_ingot',
recipe = 'default:key',
cooktime = 5,
})
--
-- Fuels
--
-- Support use of group:tree
-- Support use of group:tree, includes default:tree which has the same burn time
minetest.register_craft({
type = "fuel",
recipe = "group:tree",
@ -79,12 +117,6 @@ minetest.register_craft({
burntime = 26,
})
minetest.register_craft({
type = "fuel",
recipe = "default:tree",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:acacia_tree",
@ -98,7 +130,7 @@ minetest.register_craft({
})
-- Support use of group:wood
-- Support use of group:wood, includes default:wood which has the same burn time
minetest.register_craft({
type = "fuel",
recipe = "group:wood",
@ -117,12 +149,6 @@ minetest.register_craft({
burntime = 6,
})
minetest.register_craft({
type = "fuel",
recipe = "default:wood",
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "default:acacia_wood",
@ -136,53 +162,59 @@ minetest.register_craft({
})
-- Support use of group:sapling
-- Support use of group:sapling, includes default:sapling which has the same burn time
minetest.register_craft({
type = "fuel",
recipe = "group:sapling",
burntime = 10,
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:bush_sapling",
burntime = 6,
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "default:acacia_bush_sapling",
burntime = 7,
burntime = 4,
})
minetest.register_craft({
type = "fuel",
recipe = "default:pine_bush_sapling",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "default:aspen_sapling",
burntime = 8,
burntime = 4,
})
minetest.register_craft({
type = "fuel",
recipe = "default:pine_sapling",
burntime = 9,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sapling",
burntime = 10,
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:acacia_sapling",
burntime = 11,
burntime = 6,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglesapling",
burntime = 12,
burntime = 6,
})
minetest.register_craft({
type = "fuel",
recipe = "default:emergent_jungle_sapling",
burntime = 7,
})
@ -217,6 +249,37 @@ minetest.register_craft({
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_rail_aspen_wood",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_rail_pine_wood",
burntime = 4,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_rail_wood",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_rail_acacia_wood",
burntime = 6,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_rail_junglewood",
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "default:bush_stem",
@ -229,16 +292,22 @@ minetest.register_craft({
burntime = 8,
})
minetest.register_craft({
type = "fuel",
recipe = "default:pine_bush_stem",
burntime = 6,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglegrass",
burntime = 2,
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "group:leaves",
burntime = 1,
burntime = 4,
})
minetest.register_craft({
@ -247,10 +316,16 @@ minetest.register_craft({
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:large_cactus_seedling",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "default:papyrus",
burntime = 1,
burntime = 3,
})
minetest.register_craft({
@ -262,7 +337,7 @@ minetest.register_craft({
minetest.register_craft({
type = "fuel",
recipe = "default:ladder_wood",
burntime = 2,
burntime = 7,
})
minetest.register_craft({
@ -295,12 +370,6 @@ minetest.register_craft({
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:apple",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "default:coal_lump",
@ -325,6 +394,36 @@ minetest.register_craft({
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fern_1",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "default:marram_grass_1",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "default:paper",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:book",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "default:book_written",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "default:dry_shrub",

View file

@ -32,6 +32,11 @@ minetest.register_craftitem("default:mese_crystal", {
inventory_image = "default_mese_crystal.png",
})
minetest.register_craftitem("default:gold_lump", {
description = "Gold Lump",
inventory_image = "default_gold_lump.png",
})
minetest.register_craftitem("default:diamond", {
description = "Diamond",
inventory_image = "default_diamond.png",
@ -62,6 +67,11 @@ minetest.register_craftitem("default:bronze_ingot", {
inventory_image = "default_bronze_ingot.png",
})
minetest.register_craftitem("default:gold_ingot", {
description = "Gold Ingot",
inventory_image = "default_gold_ingot.png"
})
minetest.register_craftitem("default:mese_crystal_fragment", {
description = "Mese Crystal Fragment",
inventory_image = "default_mese_crystal_fragment.png",
@ -71,3 +81,13 @@ minetest.register_craftitem("default:clay_brick", {
description = "Clay Brick",
inventory_image = "default_clay_brick.png",
})
minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png",
})
minetest.register_craftitem("default:flint", {
description = "Flint",
inventory_image = "default_flint.png"
})

View file

@ -0,0 +1 @@
player_api?

View file

@ -1,5 +1,3 @@
-- mods/default/functions.lua
--
-- Sounds
--
@ -117,30 +115,38 @@ function default.node_sound_water_defaults(table)
return table
end
function default.node_sound_snow_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_snow_footstep", gain = 0.2}
table.dig = table.dig or
{name = "default_snow_footstep", gain = 0.3}
table.dug = table.dug or
{name = "default_snow_footstep", gain = 0.3}
table.place = table.place or
{name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table)
return table
end
--
-- Lavacooling
--
default.cool_lava = function(pos, node)
if node.name == "default:lava_source" then
minetest.set_node(pos, {name = "default:obsidian"})
else -- Lava flowing
minetest.set_node(pos, {name = "default:stone"})
end
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
if minetest.settings:get_bool("enable_lavacooling") ~= false then
minetest.register_abm({
label = "Lava cooling",
nodenames = {"default:lava_source", "default:lava_flowing"},
neighbors = {"group:cools_lava", "group:water"},
interval = 1,
chance = 2,
catch_up = false,
action = default.cool_lava,
})
end
--
-- optimized helper to put all items in an inventory into a drops list
-- Optimized helper to put all items in an inventory into a drops list
--
function default.get_inventory_drops(pos, inventory, drops)
@ -155,11 +161,12 @@ function default.get_inventory_drops(pos, inventory, drops)
end
end
--
-- Papyrus and cactus growing
--
-- wrapping the functions in abm action is necessary to make overriding them possible
-- Wrapping the functions in ABM action is necessary to make overriding them possible
function default.grow_cactus(pos, node)
if node.param2 >= 4 then
@ -213,7 +220,7 @@ function default.grow_papyrus(pos, node)
end
--
-- dig upwards
-- Dig upwards
--
function default.dig_up(pos, node, digger)
@ -259,7 +266,7 @@ function default.register_fence(name, def)
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
},
connects_to = {"group:fence", "group:wood", "group:tree"},
connects_to = {"group:fence", "group:wood", "group:tree", "group:wall"},
inventory_image = fence_texture,
wield_image = fence_texture,
tiles = {def.texture},
@ -268,7 +275,72 @@ function default.register_fence(name, def)
groups = {},
}
for k, v in pairs(default_fields) do
if not def[k] then
if def[k] == nil then
def[k] = v
end
end
-- Always add to the fence group, even if no group provided
def.groups.fence = 1
def.texture = nil
def.material = nil
minetest.register_node(name, def)
end
--
-- Fence rail registration helper
--
function default.register_fence_rail(name, def)
minetest.register_craft({
output = name .. " 16",
recipe = {
{ def.material, def.material },
{ "", ""},
{ def.material, def.material },
}
})
local fence_rail_texture = "default_fence_rail_overlay.png^" .. def.texture ..
"^default_fence_rail_overlay.png^[makealpha:255,126,126"
-- Allow almost everything to be overridden
local default_fields = {
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "connected",
fixed = {
{-1/16, 3/16, -1/16, 1/16, 5/16, 1/16},
{-1/16, -3/16, -1/16, 1/16, -5/16, 1/16}
},
-- connect_top =
-- connect_bottom =
connect_front = {
{-1/16, 3/16, -1/2, 1/16, 5/16, -1/16},
{-1/16, -5/16, -1/2, 1/16, -3/16, -1/16}},
connect_left = {
{-1/2, 3/16, -1/16, -1/16, 5/16, 1/16},
{-1/2, -5/16, -1/16, -1/16, -3/16, 1/16}},
connect_back = {
{-1/16, 3/16, 1/16, 1/16, 5/16, 1/2},
{-1/16, -5/16, 1/16, 1/16, -3/16, 1/2}},
connect_right = {
{1/16, 3/16, -1/16, 1/2, 5/16, 1/16},
{1/16, -5/16, -1/16, 1/2, -3/16, 1/16}},
},
connects_to = {"group:fence", "group:wall"},
inventory_image = fence_rail_texture,
wield_image = fence_rail_texture,
tiles = {def.texture},
sunlight_propagates = true,
is_ground_content = false,
groups = {},
}
for k, v in pairs(default_fields) do
if def[k] == nil then
def[k] = v
end
end
@ -290,7 +362,7 @@ end
-- Prevent decay of placed leaves
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
if placer and not placer:get_player_control().sneak then
if placer and placer:is_player() and not placer:get_player_control().sneak then
local node = minetest.get_node(pos)
node.param2 = 1
minetest.set_node(pos, node)
@ -358,52 +430,7 @@ function default.register_leafdecay(def)
end
--
-- Convert dirt to something that fits the environment
--
-- SNIP
--
-- Checks if specified volume intersects a protected volume
--
function default.intersects_protection(minp, maxp, player_name, interval)
-- 'interval' is the largest allowed interval for the 3D lattice of checks
-- Compute the optimal float step 'd' for each axis so that all corners and
-- borders are checked. 'd' will be smaller or equal to 'interval'.
-- Subtracting 1e-4 ensures that the max co-ordinate will be reached by the
-- for loop (which might otherwise not be the case due to rounding errors).
local d = {}
for _, c in pairs({"x", "y", "z"}) do
if maxp[c] > minp[c] then
d[c] = (maxp[c] - minp[c]) / math.ceil((maxp[c] - minp[c]) / interval) - 1e-4
elseif maxp[c] == minp[c] then
d[c] = 1 -- Any value larger than 0 to avoid division by zero
else -- maxp[c] < minp[c], print error and treat as protection intersected
minetest.log("error", "maxp < minp in 'default.intersects_protection()'")
return true
end
end
for zf = minp.z, maxp.z, d.z do
local z = math.floor(zf + 0.5)
for yf = minp.y, maxp.y, d.y do
local y = math.floor(yf + 0.5)
for xf = minp.x, maxp.x, d.x do
local x = math.floor(xf + 0.5)
if minetest.is_protected({x = x, y = y, z = z}, player_name) then
return true
end
end
end
end
return false
end
--
-- NOTICE: This method is not an official part of the API yet!
-- NOTICE: This method is not an official part of the API yet.
-- This method may change in future.
--
@ -423,7 +450,7 @@ function default.can_interact_with_node(player, pos)
return true
end
-- is player wielding the right key?
-- Is player wielding the right key?
local item = player:get_wielded_item()
if item:get_name() == "default:key" then
local key_meta = item:get_meta()

View file

@ -9,9 +9,12 @@ default = {}
default.LIGHT_MAX = 14
-- GUI related stuff
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
minetest.register_on_joinplayer(function(player)
player:set_formspec_prepend([[
bgcolor[#080808BB;true]
background[5,5;1,1;gui_formbg.png;true]
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]])
end)
function default.get_hotbar_bg(x,y)
local out = ""
@ -22,9 +25,6 @@ function default.get_hotbar_bg(x,y)
end
default.gui_survival_form = "size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"list[current_player;craft;1.75,0.5;3,3;]"..
@ -46,6 +46,5 @@ dofile(default_path.."/item_entity.lua")
dofile(default_path.."/craftitems.lua")
dofile(default_path.."/crafting.lua")
dofile(default_path.."/mapgen.lua")
dofile(default_path.."/player.lua")
dofile(default_path.."/aliases.lua")
dofile(default_path.."/legacy.lua")

View file

@ -16,7 +16,7 @@ local item = {
burn_up = function(self)
-- disappear in a smoke puff
self.object:remove()
local p = self.object:getpos()
local p = self.object:get_pos()
minetest.sound_play("default_item_smoke", {
pos = p,
max_hear_distance = 8,
@ -48,7 +48,7 @@ local item = {
if self.ignite_timer > 10 then
self.ignite_timer = 0
local node = minetest.get_node_or_nil(self.object:getpos())
local node = minetest.get_node_or_nil(self.object:get_pos())
if not node then
return
end

View file

@ -7,12 +7,12 @@ function default.register_falling_node(nodename, texture)
minetest.log("error", debug.traceback())
minetest.log('error', "WARNING: default.register_falling_node is deprecated")
if minetest.registered_nodes[nodename] then
-- minetest.registered_nodes[nodename].groups.falling_node = 1
minetest.registered_nodes[nodename].groups.falling_node = 1
end
end
function default.spawn_falling_node(p, nodename)
-- spawn_falling_node(p, nodename)
spawn_falling_node(p, nodename)
end
-- Liquids
@ -23,3 +23,24 @@ LIGHT_MAX = default.LIGHT_MAX
-- Formspecs
default.gui_suvival_form = default.gui_survival_form
default.gui_bg = ""
default.gui_bg_img = ""
default.gui_slots = ""
-- Players
if minetest.get_modpath("player_api") then
default.registered_player_models = player_api.registered_models
default.player_register_model = player_api.register_model
default.player_attached = player_api.player_attached
default.player_get_animation = player_api.get_animation
default.player_set_model = player_api.set_model
default.player_set_textures = player_api.set_textures
default.player_set_animation = player_api.set_animation
end
-- Check for a volume intersecting protection
function default.intersects_protection(minp, maxp, player_name, interval)
minetest.log("warning", "default.intersects_protection() is " ..
"deprecated, use minetest.is_area_protected() instead.")
minetest.is_area_protected(minp, maxp, player_name, interval)
end

View file

@ -2,8 +2,8 @@ License of source code
----------------------
GNU Lesser General Public License, version 2.1
Copyright (C) 2011-2016 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2011-2016 Various Minetest developers and contributors
Copyright (C) 2011-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2011-2018 Various Minetest developers and contributors
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software Foundation;
@ -19,7 +19,8 @@ Licenses of media (textures, models and sounds)
-----------------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2010-2016:
Copyright (C) 2010-2018:
celeron55, Perttu Ahola <celeron55@gmail.com>
Cisoun
G4JC
@ -44,6 +45,12 @@ Copyright (C) 2010-2016:
GreenXenith
kaeza
kilbith
tobyplowy
CloudyProton
TumeniNodes
Mossmanikin
random-geek
Extex101
You are free to:
Share — copy and redistribute the material in any medium or format.
@ -75,74 +82,8 @@ http://creativecommons.org/licenses/by-sa/3.0/
-----------------------
Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
Copyright (C) 2014-2016 brunob.santos
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/4.0/
-----------------------
Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0)
Copyright (C) 2014-2016 Neuromancer
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/2.0/
-----------------------
Attribution 3.0 Unported (CC BY 3.0)
Copyright (C) 2009 cmusounddesign
Copyright (C) 2010 Tomlija
Copyright (C) 2010 lsprice
@ -175,3 +116,41 @@ rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by/3.0/
-----------------------
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Iwan Gabovitch
Ottomaani138
Ogrebane
blukotek
Sevin7
Yoyodaman234
Ryding
No Copyright
The person who associated a work with this deed has dedicated the work to the
public domain by waiving all of his or her rights to the work worldwide under
copyright law, including all related and neighboring rights, to the extent
allowed by law.
You can copy, modify, distribute and perform the work, even for commercial
purposes, all without asking permission. See Other Information below.
Other Information:
In no way are the patent or trademark rights of any person affected by CC0, nor
are the rights that other persons may have in the work or in how the work is
used, such as publicity or privacy rights.
Unless expressly stated otherwise, the person who associated a work with this
deed makes no warranties about the work, and disclaims liability for all uses
of the work, to the fullest extent permitted by applicable law.
When using or citing the work, you should not imply endorsement by the author
or the affirmer.
For more details:
https://creativecommons.org/publicdomain/zero/1.0/

1786
mods/mtg/default/mapgen.lua Executable file → Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -50,6 +50,20 @@ minetest.register_tool("default:pick_stone", {
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:pick_bronze", {
description = "Bronze Pickaxe",
inventory_image = "default_tool_bronzepick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky = {times={[1]=4.50, [2]=1.80, [3]=0.90}, uses=20, maxlevel=2},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:pick_steel", {
description = "Steel Pickaxe",
inventory_image = "default_tool_steelpick.png",
@ -64,20 +78,6 @@ minetest.register_tool("default:pick_steel", {
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:pick_bronze", {
description = "Bronze Pickaxe",
inventory_image = "default_tool_bronzepick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:pick_mese", {
description = "Mese Pickaxe",
inventory_image = "default_tool_mesepick.png",
@ -141,6 +141,21 @@ minetest.register_tool("default:shovel_stone", {
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:shovel_bronze", {
description = "Bronze Shovel",
inventory_image = "default_tool_bronzeshovel.png",
wield_image = "default_tool_bronzeshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.65, [2]=1.05, [3]=0.45}, uses=25, maxlevel=2},
},
damage_groups = {fleshy=3},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:shovel_steel", {
description = "Steel Shovel",
inventory_image = "default_tool_steelshovel.png",
@ -156,21 +171,6 @@ minetest.register_tool("default:shovel_steel", {
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:shovel_bronze", {
description = "Bronze Shovel",
inventory_image = "default_tool_bronzeshovel.png",
wield_image = "default_tool_bronzeshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=40, maxlevel=2},
},
damage_groups = {fleshy=3},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:shovel_mese", {
description = "Mese Shovel",
inventory_image = "default_tool_meseshovel.png",
@ -234,6 +234,20 @@ minetest.register_tool("default:axe_stone", {
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:axe_bronze", {
description = "Bronze Axe",
inventory_image = "default_tool_bronzeaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.75, [2]=1.70, [3]=1.15}, uses=20, maxlevel=2},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:axe_steel", {
description = "Steel Axe",
inventory_image = "default_tool_steelaxe.png",
@ -248,20 +262,6 @@ minetest.register_tool("default:axe_steel", {
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:axe_bronze", {
description = "Bronze Axe",
inventory_image = "default_tool_bronzeaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:axe_mese", {
description = "Mese Axe",
inventory_image = "default_tool_meseaxe.png",
@ -283,7 +283,7 @@ minetest.register_tool("default:axe_diamond", {
full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2},
choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=7},
},
@ -323,6 +323,20 @@ minetest.register_tool("default:sword_stone", {
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:sword_bronze", {
description = "Bronze Sword",
inventory_image = "default_tool_bronzesword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.75, [2]=1.30, [3]=0.375}, uses=25, maxlevel=2},
},
damage_groups = {fleshy=6},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:sword_steel", {
description = "Steel Sword",
inventory_image = "default_tool_steelsword.png",
@ -337,20 +351,6 @@ minetest.register_tool("default:sword_steel", {
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:sword_bronze", {
description = "Bronze Sword",
inventory_image = "default_tool_bronzesword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2},
},
damage_groups = {fleshy=6},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:sword_mese", {
description = "Mese Sword",
inventory_image = "default_tool_mesesword.png",
@ -378,3 +378,43 @@ minetest.register_tool("default:sword_diamond", {
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("default:key", {
description = "Key",
inventory_image = "default_key.png",
groups = {key = 1, not_in_creative_inventory = 1},
stack_max = 1,
on_place = function(itemstack, placer, pointed_thing)
local under = pointed_thing.under
local node = minetest.get_node(under)
local def = minetest.registered_nodes[node.name]
if def and def.on_rightclick and
not (placer and placer:is_player() and
placer:get_player_control().sneak) then
return def.on_rightclick(under, node, placer, itemstack,
pointed_thing) or itemstack
end
if pointed_thing.type ~= "node" then
return itemstack
end
local pos = pointed_thing.under
node = minetest.get_node(pos)
if not node or node.name == "ignore" then
return itemstack
end
local ndef = minetest.registered_nodes[node.name]
if not ndef then
return itemstack
end
local on_key_use = ndef.on_key_use
if on_key_use then
on_key_use(pos, placer)
end
return nil
end
})

Some files were not shown because too many files have changed in this diff Show more