This commit is contained in:
root 2021-05-22 19:45:55 +02:00
parent a8d9bba4b3
commit b13487c26c
14 changed files with 105 additions and 64 deletions

View file

@ -7,6 +7,7 @@ minetest.override_item("default:water_flowing", { sounds = {} })
minetest.override_item("default:river_water_source", { sounds = {} })
minetest.override_item("default:river_water_flowing", { sounds = {} })
-- settings
local SOUNDVOLUME = 1.0
local MUSICVOLUME = 1.0
@ -19,8 +20,6 @@ local sound_set_order = {} -- needed because pairs loops randomly through tables
local set_nodes = {} -- all the nodes needed for sets
-- global functions
-- add set to list
ambience.add_set = function(set_name, def)
@ -73,10 +72,7 @@ end
-- return set from list using name
ambience.get_set = function(set_name)
if sound_sets[set_name] then
return sound_sets[set_name]
end
end
@ -100,11 +96,22 @@ ambience.del_set = function(set_name)
end
-- setup table when player joins
minetest.register_on_joinplayer(function(player)
playing[player:get_player_name()] = {}
end)
-- remove table when player leaves
minetest.register_on_leaveplayer(function(player)
playing[player:get_player_name()] = nil
end)
-- plays music and selects sound set
local get_ambience = function(player, tod, name)
-- play server or local music if available
if play_music and playing[name] then
if play_music then
-- play at midnight
if tod >= 0.0 and tod <= 0.01 then
@ -112,7 +119,7 @@ local get_ambience = function(player, tod, name)
if not playing[name].music then
playing[name].music = minetest.sound_play("ambience_music", {
to_player = player:get_player_name(),
to_player = name,
gain = MUSICVOLUME
})
end
@ -123,7 +130,6 @@ local get_ambience = function(player, tod, name)
end
end
-- get foot and head level nodes at player position
local pos = player:get_pos() ; if not pos then return end
@ -168,6 +174,8 @@ local get_ambience = function(player, tod, name)
end
end
end
return nil, nil -- ADDED
end
@ -198,11 +206,10 @@ minetest.register_globalstep(function(dtime)
--print(string.format("elapsed time: %.4f\n", os.clock() - t1))
ok = true -- everything starts off ok
ok = playing[player_name] -- everything starts off ok if player around
-- are we playing something already?
if playing[player_name]
and playing[player_name].handler then
if ok and playing[player_name].handler then
-- stop current sound if another set active or gain changed
if playing[player_name].set ~= set_name
@ -213,8 +220,8 @@ minetest.register_globalstep(function(dtime)
minetest.sound_stop(playing[player_name].handler)
playing[player_name].set = nil
playing[player_name].handler = nil
playing[player_name].gain = nil
playing[player_name].handler = nil
else
ok = false -- sound set still playing, skip new sound
end
@ -246,9 +253,9 @@ minetest.register_globalstep(function(dtime)
--print("-- current handler", handler)
-- set what player is currently listening to
playing[player_name] = {
set = set_name, gain = MORE_GAIN, handler = handler
}
playing[player_name].set = set_name
playing[player_name].gain = MORE_GAIN
playing[player_name].handler = handler
-- set timer to stop sound
minetest.after(ambience.length, function()
@ -264,10 +271,10 @@ minetest.register_globalstep(function(dtime)
minetest.sound_stop(handler)
-- reset player variables and backup handler
playing[player_name] = {
set = nil, gain = nil, handler = nil
}
-- reset player variables
playing[player_name].set = nil
playing[player_name].gain = nil
playing[player_name].handler = nil
end
end)
end
@ -290,7 +297,7 @@ minetest.register_chatcommand("svol", {
if SOUNDVOLUME > 1.0 then SOUNDVOLUME = 1.0 end
return true, "Sound volume set to " .. SOUNDVOLUME
end,
end
})
@ -313,7 +320,7 @@ minetest.register_chatcommand("mvol", {
if MUSICVOLUME > 1.0 then MUSICVOLUME = 1.0 end
return true, "Music volume set to " .. MUSICVOLUME
end,
end
})

View file

@ -32,7 +32,7 @@ ambience.add_set("splash", {
frequency = 1000,
sounds = {
{name = "swim_splashing", length = 3},
{name = "swim_splashing", length = 3}
},
sound_check = function(def)

View file

@ -14,6 +14,7 @@ minetest.register_node("home_workshop_misc:tool_cabinet", {
"home_workshop_common_generic_metal_bright.png",
"home_workshop_misc_tool_cabinet_misc.png",
},
paramtype = "light",
paramtype2="facedir",
inventory_image = "home_workshop_misc_tool_cabinet_inv.png",
on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil,
@ -33,6 +34,7 @@ minetest.register_node("home_workshop_misc:beer_tap", {
{ name = "home_workshop_common_generic_metal.png", color = 0xff303030 }
},
inventory_image = "home_workshop_misc_beertap_inv.png",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy=3 },
walkable = false,
@ -70,6 +72,7 @@ minetest.register_node("home_workshop_misc:beer_mug", {
mesh = "home_workshop_misc_beer_mug.obj",
tiles = { "home_workshop_misc_beer_mug.png" },
inventory_image = "home_workshop_misc_beer_mug_inv.png",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy=3, oddly_breakable_by_hand=3 },
walkable = false,
@ -93,6 +96,7 @@ minetest.register_node("home_workshop_misc:soda_machine", {
drawtype = "mesh",
mesh = "home_workshop_misc_soda_machine.obj",
tiles = {"home_workshop_misc_soda_machine.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
selection_box = svm_cbox,

View file

@ -570,7 +570,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = "homedecor:kitchen_cabinet",
output = "homedecor:kitchen_cabinet_colorable",
recipe = {
{"group:wood", "group:stick", "group:wood", },
{"group:wood", "group:stick", "group:wood", },
@ -579,53 +579,53 @@ minetest.register_craft({
})
minetest.register_craft({
output = "homedecor:kitchen_cabinet_steel",
output = "homedecor:kitchen_cabinet_colorable_steel",
recipe = {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"", "homedecor:kitchen_cabinet", ""},
{"", "homedecor:kitchen_cabinet_colorable", ""},
}
})
minetest.register_craft({
output = "homedecor:kitchen_cabinet_steel",
output = "homedecor:kitchen_cabinet_colorable_steel",
recipe = {
{"moreblocks:slab_steelblock_1"},
{ "homedecor:kitchen_cabinet" },
{ "homedecor:kitchen_cabinet_colorable" },
}
})
minetest.register_craft({
output = "homedecor:kitchen_cabinet_marble",
output = "homedecor:kitchen_cabinet_colorable_marble",
recipe = {
{"building_blocks:slab_marble"},
{"homedecor:kitchen_cabinet"},
{"homedecor:kitchen_cabinet_colorable"},
}
})
minetest.register_craft({
output = "homedecor:kitchen_cabinet_marble",
output = "homedecor:kitchen_cabinet_colorable_marble",
recipe = {
{"technic:slab_marble_1"},
{"homedecor:kitchen_cabinet"},
{"homedecor:kitchen_cabinet_colorable"},
}
})
minetest.register_craft({
output = "homedecor:kitchen_cabinet_granite",
output = "homedecor:kitchen_cabinet_colorable_granite",
recipe = {
{"technic:slab_granite_1"},
{"homedecor:kitchen_cabinet"},
{"homedecor:kitchen_cabinet_colorable"},
}
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:kitchen_cabinet_half 2",
recipe = { "homedecor:kitchen_cabinet" }
output = "homedecor:kitchen_cabinet_colorable_half 2",
recipe = { "homedecor:kitchen_cabinet_colorable" }
})
minetest.register_craft({
output = "homedecor:kitchen_cabinet_with_sink",
output = "homedecor:kitchen_cabinet_colorable_with_sink",
recipe = {
{"group:wood", "default:steel_ingot", "group:wood", },
{"group:wood", "default:steel_ingot", "group:wood", },

View file

@ -12,7 +12,7 @@ if minetest.get_modpath("lucky_block") then
{"spw", "mobs:chicken", 5},
{"dro", {"mobs:egg"}, 5},
{"spw", "mobs:cow", 5},
{"dro", {"mobs:bucket_milk"}, 8},
{"dro", {"mobs:bucket_milk", "bucket:bucket_water"}, 8},
{"spw", "mobs:kitten", 2},
{"exp"},
{"dro", {"mobs:hairball"}, 3},

View file

@ -387,6 +387,8 @@ function mobs.fly(entity, _, speed, shoots, arrow, moving_anim, stand_anim)
local dir = entity.driver:get_look_dir()
local yaw = entity.driver:get_look_horizontal() + 1.57 -- offset fix between old and new commands
if not ctrl or not velo then return end
if ctrl.up then
entity.object:set_velocity({
x = dir.x * speed,

View file

@ -0,0 +1,3 @@
Iron Man MK. 7
Jordach
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
character_mumbo_0
Sam_0
CC BY 4.0

View file

@ -0,0 +1,3 @@
character_sam_v4
Sam_0
CC BY 4.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -8,6 +8,21 @@ ts_furniture.kneeling_bench = minetest.settings:get_bool("ts_furniture.kneeling_
-- Used for localization
local S = minetest.get_translator("ts_furniture")
-- Get texture by node name
local T = function (node_name)
local def = minetest.registered_nodes[node_name]
if not (def and def.tiles) then
return ""
end
local tile = def.tiles[5] or def.tiles[4] or def.tiles[3] or def.tiles[2] or def.tiles[1]
if type(tile) == "string" then
return tile
elseif type(tile) == "table" and tile.name then
return tile.name
end
return ""
end
-- The following code is from "Get Comfortable [cozy]" (by everamzah; published under WTFPL)
-- Thomas S. modified it, so that it can be used in this mod
if ts_furniture.enable_sitting then
@ -174,6 +189,10 @@ local ignore_groups = {
}
function ts_furniture.register_furniture(recipe, description, tiles)
if not tiles then
tiles = T(recipe)
end
local recipe_def = minetest.registered_items[recipe]
if not recipe_def then
return
@ -217,34 +236,34 @@ function ts_furniture.register_furniture(recipe, description, tiles)
end
end
ts_furniture.register_furniture("default:aspen_wood", "Aspen", "default_aspen_wood.png")
ts_furniture.register_furniture("default:pine_wood", "Pine", "default_pine_wood.png")
ts_furniture.register_furniture("default:acacia_wood", "Acacia", "default_acacia_wood.png")
ts_furniture.register_furniture("default:wood", "Wooden", "default_wood.png")
ts_furniture.register_furniture("default:junglewood", "Jungle Wood", "default_junglewood.png")
ts_furniture.register_furniture("default:aspen_wood", "Aspen")
ts_furniture.register_furniture("default:pine_wood", "Pine")
ts_furniture.register_furniture("default:acacia_wood", "Acacia")
ts_furniture.register_furniture("default:wood", "Wooden")
ts_furniture.register_furniture("default:junglewood", "Jungle Wood")
if (minetest.get_modpath("moretrees")) then
ts_furniture.register_furniture("moretrees:apple_tree_planks", "Apple Tree", "moretrees_apple_tree_wood.png")
ts_furniture.register_furniture("moretrees:beech_planks", "Beech", "moretrees_beech_wood.png")
ts_furniture.register_furniture("moretrees:birch_planks", "Birch", "moretrees_birch_wood.png")
ts_furniture.register_furniture("moretrees:fir_planks", "Fir", "moretrees_fir_wood.png")
ts_furniture.register_furniture("moretrees:oak_planks", "Oak", "moretrees_oak_wood.png")
ts_furniture.register_furniture("moretrees:palm_planks", "Palm", "moretrees_palm_wood.png")
ts_furniture.register_furniture("moretrees:rubber_tree_planks", "Rubber Tree", "moretrees_rubber_tree_wood.png")
ts_furniture.register_furniture("moretrees:sequoia_planks", "Sequoia", "moretrees_sequoia_wood.png")
ts_furniture.register_furniture("moretrees:spruce_planks", "Spruce", "moretrees_spruce_wood.png")
ts_furniture.register_furniture("moretrees:willow_planks", "Willow", "moretrees_willow_wood.png")
ts_furniture.register_furniture("moretrees:apple_tree_planks", "Apple Tree")
ts_furniture.register_furniture("moretrees:beech_planks", "Beech")
ts_furniture.register_furniture("moretrees:birch_planks", "Birch")
ts_furniture.register_furniture("moretrees:fir_planks", "Fir")
ts_furniture.register_furniture("moretrees:oak_planks", "Oak")
ts_furniture.register_furniture("moretrees:palm_planks", "Palm")
ts_furniture.register_furniture("moretrees:rubber_tree_planks", "Rubber Tree")
ts_furniture.register_furniture("moretrees:sequoia_planks", "Sequoia")
ts_furniture.register_furniture("moretrees:spruce_planks", "Spruce")
ts_furniture.register_furniture("moretrees:willow_planks", "Willow")
end
if minetest.get_modpath("ethereal") then
ts_furniture.register_furniture("ethereal:banana_wood", "Banana", "banana_wood.png")
ts_furniture.register_furniture("ethereal:birch_wood", "Birch", "moretrees_birch_wood.png")
ts_furniture.register_furniture("ethereal:frost_wood", "Frost", "frost_wood.png")
ts_furniture.register_furniture("ethereal:mushroom_trunk", "Mushroom", "mushroom_trunk.png")
ts_furniture.register_furniture("ethereal:palm_wood", "Palm", "moretrees_palm_wood.png")
ts_furniture.register_furniture("ethereal:redwood_wood", "Redwood", "redwood_wood.png")
ts_furniture.register_furniture("ethereal:sakura_wood", "Sakura", "ethereal_sakura_wood.png")
ts_furniture.register_furniture("ethereal:scorched_tree", "Scorched", "scorched_tree.png")
ts_furniture.register_furniture("ethereal:willow_wood", "Willow", "willow_wood.png")
ts_furniture.register_furniture("ethereal:yellow_wood", "Healing Tree", "yellow_wood.png")
ts_furniture.register_furniture("ethereal:banana_wood", "Banana")
ts_furniture.register_furniture("ethereal:birch_wood", "Birch")
ts_furniture.register_furniture("ethereal:frost_wood", "Frost")
ts_furniture.register_furniture("ethereal:mushroom_trunk", "Mushroom")
ts_furniture.register_furniture("ethereal:palm_wood", "Palm")
ts_furniture.register_furniture("ethereal:redwood_wood", "Redwood")
ts_furniture.register_furniture("ethereal:sakura_wood", "Sakura")
ts_furniture.register_furniture("ethereal:scorched_tree", "Scorched")
ts_furniture.register_furniture("ethereal:willow_wood", "Willow")
ts_furniture.register_furniture("ethereal:yellow_wood", "Healing Tree")
end

View file

@ -33,7 +33,7 @@ local function get_pos(pos, dir)
end
local function fdir(self, player)
local pitch = player:get_look_pitch()
local pitch = player:get_look_vertical()
if pitch > 1.0 and self.valid_dirs[6] then -- up?
return 6
elseif pitch < -1.0 and self.valid_dirs[5] then -- down?