Remove some of the unused mods
@ -1,13 +0,0 @@
|
||||
Minetest Game mod: bucket
|
||||
=========================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Kahrl <kahrl@gmx.net> (LGPLv2.1+)
|
||||
celeron55, Perttu Ahola <celeron55@gmail.com> (LGPLv2.1+)
|
||||
Various Minetest developers and contributors (LGPLv2.1+)
|
||||
|
||||
Authors of media (textures)
|
||||
---------------------------
|
||||
ElementW (CC BY-SA 3.0)
|
@ -1,240 +0,0 @@
|
||||
-- Minetest 0.4 mod: bucket
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("bucket")
|
||||
|
||||
|
||||
minetest.register_alias("bucket", "bucket:bucket_empty")
|
||||
minetest.register_alias("bucket_water", "bucket:bucket_water")
|
||||
minetest.register_alias("bucket_lava", "bucket:bucket_lava")
|
||||
|
||||
minetest.register_craft({
|
||||
output = "bucket:bucket_empty 1",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "", "default:steel_ingot"},
|
||||
{"", "default:steel_ingot", ""},
|
||||
}
|
||||
})
|
||||
|
||||
bucket = {}
|
||||
bucket.liquids = {}
|
||||
|
||||
local function check_protection(pos, name, text)
|
||||
if minetest.is_protected(pos, name) then
|
||||
minetest.log("action", (name ~= "" and name or "A mod")
|
||||
.. " tried to " .. text
|
||||
.. " at protected position "
|
||||
.. minetest.pos_to_string(pos)
|
||||
.. " with a bucket")
|
||||
minetest.record_protection_violation(pos, name)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Register a new liquid
|
||||
-- source = name of the source node
|
||||
-- flowing = name of the flowing node
|
||||
-- itemname = name of the new bucket item (or nil if liquid is not takeable)
|
||||
-- inventory_image = texture of the new bucket item (ignored if itemname == nil)
|
||||
-- name = text description of the bucket item
|
||||
-- groups = (optional) groups of the bucket item, for example {water_bucket = 1}
|
||||
-- force_renew = (optional) bool. Force the liquid source to renew if it has a
|
||||
-- source neighbour, even if defined as 'liquid_renewable = false'.
|
||||
-- Needed to avoid creating holes in sloping rivers.
|
||||
-- This function can be called from any mod (that depends on bucket).
|
||||
function bucket.register_liquid(source, flowing, itemname, inventory_image, name,
|
||||
groups, force_renew)
|
||||
bucket.liquids[source] = {
|
||||
source = source,
|
||||
flowing = flowing,
|
||||
itemname = itemname,
|
||||
force_renew = force_renew,
|
||||
}
|
||||
bucket.liquids[flowing] = bucket.liquids[source]
|
||||
|
||||
if itemname ~= nil then
|
||||
minetest.register_craftitem(itemname, {
|
||||
description = name,
|
||||
inventory_image = inventory_image,
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
groups = groups,
|
||||
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
-- Must be pointing to node
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.get_node_or_nil(pointed_thing.under)
|
||||
local ndef = node and minetest.registered_nodes[node.name]
|
||||
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
if ndef and ndef.on_rightclick and
|
||||
not (user and user:is_player() and
|
||||
user:get_player_control().sneak) then
|
||||
return ndef.on_rightclick(
|
||||
pointed_thing.under,
|
||||
node, user,
|
||||
itemstack)
|
||||
end
|
||||
|
||||
local lpos
|
||||
|
||||
-- Check if pointing to a buildable node
|
||||
if ndef and ndef.buildable_to then
|
||||
-- buildable; replace the node
|
||||
lpos = pointed_thing.under
|
||||
else
|
||||
-- not buildable to; place the liquid above
|
||||
-- check if the node above can be replaced
|
||||
|
||||
lpos = pointed_thing.above
|
||||
node = minetest.get_node_or_nil(lpos)
|
||||
local above_ndef = node and minetest.registered_nodes[node.name]
|
||||
|
||||
if not above_ndef or not above_ndef.buildable_to then
|
||||
-- do not remove the bucket with the liquid
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
||||
if check_protection(lpos, user
|
||||
and user:get_player_name()
|
||||
or "", "place "..source) then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.set_node(lpos, {name = source})
|
||||
return ItemStack("bucket:bucket_empty")
|
||||
end
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_craftitem("bucket:bucket_empty", {
|
||||
description = S("Empty Bucket"),
|
||||
inventory_image = "bucket.png",
|
||||
groups = {tool = 1},
|
||||
liquids_pointable = true,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
if pointed_thing.type == "object" then
|
||||
pointed_thing.ref:punch(user, 1.0, { full_punch_interval=1.0 }, nil)
|
||||
return user:get_wielded_item()
|
||||
elseif pointed_thing.type ~= "node" then
|
||||
-- do nothing if it's neither object nor node
|
||||
return
|
||||
end
|
||||
-- Check if pointing to a liquid source
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local liquiddef = bucket.liquids[node.name]
|
||||
local item_count = user:get_wielded_item():get_count()
|
||||
|
||||
if liquiddef ~= nil
|
||||
and liquiddef.itemname ~= nil
|
||||
and node.name == liquiddef.source then
|
||||
if check_protection(pointed_thing.under,
|
||||
user:get_player_name(),
|
||||
"take ".. node.name) then
|
||||
return
|
||||
end
|
||||
|
||||
-- default set to return filled bucket
|
||||
local giving_back = liquiddef.itemname
|
||||
|
||||
-- check if holding more than 1 empty bucket
|
||||
if item_count > 1 then
|
||||
|
||||
-- if space in inventory add filled bucked, otherwise drop as item
|
||||
local inv = user:get_inventory()
|
||||
if inv:room_for_item("main", {name=liquiddef.itemname}) then
|
||||
inv:add_item("main", liquiddef.itemname)
|
||||
else
|
||||
local pos = user:get_pos()
|
||||
pos.y = math.floor(pos.y + 0.5)
|
||||
minetest.add_item(pos, liquiddef.itemname)
|
||||
end
|
||||
|
||||
-- set to return empty buckets minus 1
|
||||
giving_back = "bucket:bucket_empty "..tostring(item_count-1)
|
||||
|
||||
end
|
||||
|
||||
-- force_renew requires a source neighbour
|
||||
local source_neighbor = false
|
||||
if liquiddef.force_renew then
|
||||
source_neighbor =
|
||||
minetest.find_node_near(pointed_thing.under, 1, liquiddef.source)
|
||||
end
|
||||
if not (source_neighbor and liquiddef.force_renew) then
|
||||
minetest.add_node(pointed_thing.under, {name = "air"})
|
||||
end
|
||||
|
||||
return ItemStack(giving_back)
|
||||
else
|
||||
-- non-liquid nodes will have their on_punch triggered
|
||||
local node_def = minetest.registered_nodes[node.name]
|
||||
if node_def then
|
||||
node_def.on_punch(pointed_thing.under, node, user, pointed_thing)
|
||||
end
|
||||
return user:get_wielded_item()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
bucket.register_liquid(
|
||||
"default:water_source",
|
||||
"default:water_flowing",
|
||||
"bucket:bucket_water",
|
||||
"bucket_water.png",
|
||||
S("Water Bucket"),
|
||||
{tool = 1, water_bucket = 1}
|
||||
)
|
||||
|
||||
-- River water source is 'liquid_renewable = false' to avoid horizontal spread
|
||||
-- of water sources in sloping rivers that can cause water to overflow
|
||||
-- riverbanks and cause floods.
|
||||
-- River water source is instead made renewable by the 'force renew' option
|
||||
-- used here.
|
||||
|
||||
bucket.register_liquid(
|
||||
"default:river_water_source",
|
||||
"default:river_water_flowing",
|
||||
"bucket:bucket_river_water",
|
||||
"bucket_river_water.png",
|
||||
S("River Water Bucket"),
|
||||
{tool = 1, water_bucket = 1},
|
||||
true
|
||||
)
|
||||
|
||||
bucket.register_liquid(
|
||||
"default:lava_source",
|
||||
"default:lava_flowing",
|
||||
"bucket:bucket_lava",
|
||||
"bucket_lava.png",
|
||||
S("Lava Bucket"),
|
||||
{tool = 1}
|
||||
)
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "bucket:bucket_lava",
|
||||
burntime = 60,
|
||||
replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}},
|
||||
})
|
||||
|
||||
-- Register buckets as dungeon loot
|
||||
if minetest.global_exists("dungeon_loot") then
|
||||
dungeon_loot.register({
|
||||
{name = "bucket:bucket_empty", chance = 0.55},
|
||||
-- water in deserts/ice or above ground, lava otherwise
|
||||
{name = "bucket:bucket_water", chance = 0.45,
|
||||
types = {"sandstone", "desert", "ice"}},
|
||||
{name = "bucket:bucket_water", chance = 0.45, y = {0, 32768},
|
||||
types = {"normal"}},
|
||||
{name = "bucket:bucket_lava", chance = 0.45, y = {-32768, -1},
|
||||
types = {"normal"}},
|
||||
})
|
||||
end
|
@ -1,51 +0,0 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
GNU Lesser General Public License, version 2.1
|
||||
Copyright (C) 2011-2016 Kahrl <kahrl@gmx.net>
|
||||
Copyright (C) 2011-2016 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
Copyright (C) 2011-2016 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;
|
||||
either version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details:
|
||||
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
|
||||
Licenses of media (textures)
|
||||
----------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2015-2016 ElementW
|
||||
|
||||
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/3.0/
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Leerer Eimer
|
||||
Water Bucket=Wassereimer
|
||||
River Water Bucket=Flusswassereimer
|
||||
Lava Bucket=Lavaeimer
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Malplena Sitelo
|
||||
Water Bucket=Sitelo da Akvo
|
||||
River Water Bucket=Sitelo da Rivera Akvo
|
||||
Lava Bucket=Sitelo da Lafo
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Cubo vacío
|
||||
Water Bucket=Cubo con agua
|
||||
River Water Bucket=Cubo con agua de río
|
||||
Lava Bucket=Cubo con lava
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Seau vide
|
||||
Water Bucket=Seau d'eau
|
||||
River Water Bucket=Seau d'eau de rivière
|
||||
Lava Bucket=Seau de lave
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Ember Kosong
|
||||
Water Bucket=Ember Air
|
||||
River Water Bucket=Ember Air Sungai
|
||||
Lava Bucket=Ember Lava
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Secchio vuoto
|
||||
Water Bucket=Secchio d'acqua
|
||||
River Water Bucket=Secchio d'acqua di fiume
|
||||
Lava Bucket=Secchio di lava
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=空のバケツ
|
||||
Water Bucket=水入りバケツ
|
||||
River Water Bucket=川の水入りバケツ
|
||||
Lava Bucket=溶岩入りバケツ
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=lo baktu be no da
|
||||
Water Bucket=lo baktu be lo djacu
|
||||
River Water Bucket=lo baktu be lo rirxe djacu
|
||||
Lava Bucket=lo baktu be lo likro'i
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Baldi Kosong
|
||||
Water Bucket=Baldi Air
|
||||
River Water Bucket=Baldi Air Sungai
|
||||
Lava Bucket=Baldi Lava
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Puste wiadro
|
||||
Water Bucket=Wiadro z wodą
|
||||
River Water Bucket=Wiadro z rzeczną wodą
|
||||
Lava Bucket=Wiadro z lawą
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Balde Vazio
|
||||
Water Bucket=Balde de Água
|
||||
River Water Bucket=Balde de Água do Rio
|
||||
Lava Bucket=Balde de Lava
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Пустое Ведро
|
||||
Water Bucket=Ведро с Водой
|
||||
River Water Bucket=Ведро с Речной Водой
|
||||
Lava Bucket=Ведро с Лавой
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Prázdne vedro
|
||||
Water Bucket=Vedro s vodou
|
||||
River Water Bucket=Vedro s vodou z rieky
|
||||
Lava Bucket=Vedro s lávou
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Tom hink
|
||||
Water Bucket=Vattenhink
|
||||
River Water Bucket=Flodvattenshink
|
||||
Lava Bucket=Lavahink
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=Пусте Відро
|
||||
Water Bucket=Відро З Водою
|
||||
River Water Bucket=Відро З Річною Водою
|
||||
Lava Bucket=Відро З Лавою
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=空桶
|
||||
Water Bucket=水桶
|
||||
River Water Bucket=河水桶
|
||||
Lava Bucket=岩浆桶
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=空桶
|
||||
Water Bucket=水桶
|
||||
River Water Bucket=河水桶
|
||||
Lava Bucket=岩漿桶
|
@ -1,5 +0,0 @@
|
||||
# textdomain: bucket
|
||||
Empty Bucket=
|
||||
Water Bucket=
|
||||
River Water Bucket=
|
||||
Lava Bucket=
|
@ -1,4 +0,0 @@
|
||||
name = bucket
|
||||
description = Minetest Game mod: bucket
|
||||
depends = default
|
||||
optional_depends = dungeon_loot
|
Before Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 221 B |
Before Width: | Height: | Size: 221 B |
Before Width: | Height: | Size: 221 B |
@ -1,17 +0,0 @@
|
||||
Minetest Game mod: creative
|
||||
===========================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by Perttu Ahola (celeron55) <celeron55@gmail.com> (MIT)
|
||||
Jean-Patrick G. (kilbith) <jeanpatrick.guerrero@gmail.com> (MIT)
|
||||
|
||||
Author of media (textures)
|
||||
--------------------------
|
||||
paramat (CC BY-SA 3.0):
|
||||
* creative_prev_icon.png
|
||||
* creative_next_icon.png
|
||||
* creative_search_icon.png
|
||||
* creative_clear_icon.png
|
||||
* creative_trash_icon.png derived from a texture by kilbith (CC BY-SA 3.0)
|
@ -1,101 +0,0 @@
|
||||
-- creative/init.lua
|
||||
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("creative")
|
||||
|
||||
creative = {}
|
||||
creative.get_translator = S
|
||||
|
||||
local function update_sfinv(name)
|
||||
minetest.after(0, function()
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
if sfinv.get_page(player):sub(1, 9) == "creative:" then
|
||||
sfinv.set_page(player, sfinv.get_homepage_name(player))
|
||||
else
|
||||
sfinv.set_player_inventory_formspec(player)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
minetest.register_privilege("creative", {
|
||||
description = S("Allow player to use creative inventory"),
|
||||
give_to_singleplayer = false,
|
||||
give_to_admin = false,
|
||||
on_grant = update_sfinv,
|
||||
on_revoke = update_sfinv,
|
||||
})
|
||||
|
||||
-- Override the engine's creative mode function
|
||||
local old_is_creative_enabled = minetest.is_creative_enabled
|
||||
|
||||
function minetest.is_creative_enabled(name)
|
||||
if name == "" then
|
||||
return old_is_creative_enabled(name)
|
||||
end
|
||||
return minetest.check_player_privs(name, {creative = true}) or
|
||||
old_is_creative_enabled(name)
|
||||
end
|
||||
|
||||
-- For backwards compatibility:
|
||||
function creative.is_enabled_for(name)
|
||||
return minetest.is_creative_enabled(name)
|
||||
end
|
||||
|
||||
dofile(minetest.get_modpath("creative") .. "/inventory.lua")
|
||||
|
||||
if minetest.is_creative_enabled("") then
|
||||
-- Dig time is modified according to difference (leveldiff) between tool
|
||||
-- 'maxlevel' and node 'level'. Digtime is divided by the larger of
|
||||
-- leveldiff and 1.
|
||||
-- To speed up digging in creative, hand 'maxlevel' and 'digtime' have been
|
||||
-- increased such that nodes of differing levels have an insignificant
|
||||
-- effect on digtime.
|
||||
local digtime = 42
|
||||
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
|
||||
|
||||
-- Override the hand tool
|
||||
minetest.override_item("", {
|
||||
range = 10,
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.5,
|
||||
max_drop_level = 3,
|
||||
groupcaps = {
|
||||
crumbly = caps,
|
||||
cracky = caps,
|
||||
snappy = caps,
|
||||
choppy = caps,
|
||||
oddly_breakable_by_hand = caps,
|
||||
-- dig_immediate group doesn't use value 1. Value 3 is instant dig
|
||||
dig_immediate =
|
||||
{times = {[2] = digtime, [3] = 0}, uses = 0, maxlevel = 256},
|
||||
},
|
||||
damage_groups = {fleshy = 10},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Unlimited node placement
|
||||
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
|
||||
if placer and placer:is_player() then
|
||||
return minetest.is_creative_enabled(placer:get_player_name())
|
||||
end
|
||||
end)
|
||||
|
||||
-- Don't pick up if the item is already in the inventory
|
||||
local old_handle_node_drops = minetest.handle_node_drops
|
||||
function minetest.handle_node_drops(pos, drops, digger)
|
||||
if not digger or not digger:is_player() or
|
||||
not minetest.is_creative_enabled(digger:get_player_name()) then
|
||||
return old_handle_node_drops(pos, drops, digger)
|
||||
end
|
||||
local inv = digger:get_inventory()
|
||||
if inv then
|
||||
for _, item in ipairs(drops) do
|
||||
if not inv:contains_item("main", item, true) then
|
||||
inv:add_item("main", item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,256 +0,0 @@
|
||||
-- creative/inventory.lua
|
||||
|
||||
-- support for MT game translation.
|
||||
local S = creative.get_translator
|
||||
|
||||
local player_inventory = {}
|
||||
local inventory_cache = {}
|
||||
|
||||
local function init_creative_cache(items)
|
||||
inventory_cache[items] = {}
|
||||
local i_cache = inventory_cache[items]
|
||||
|
||||
for name, def in pairs(items) do
|
||||
if def.groups.not_in_creative_inventory ~= 1 and
|
||||
def.description and def.description ~= "" then
|
||||
i_cache[name] = def
|
||||
end
|
||||
end
|
||||
table.sort(i_cache)
|
||||
return i_cache
|
||||
end
|
||||
|
||||
function creative.init_creative_inventory(player)
|
||||
local player_name = player:get_player_name()
|
||||
player_inventory[player_name] = {
|
||||
size = 0,
|
||||
filter = "",
|
||||
start_i = 0,
|
||||
old_filter = nil, -- use only for caching in update_creative_inventory
|
||||
old_content = nil
|
||||
}
|
||||
|
||||
minetest.create_detached_inventory("creative_" .. player_name, {
|
||||
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player2)
|
||||
local name = player2 and player2:get_player_name() or ""
|
||||
if not minetest.is_creative_enabled(name) or
|
||||
to_list == "main" then
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_put = function(inv, listname, index, stack, player2)
|
||||
return 0
|
||||
end,
|
||||
allow_take = function(inv, listname, index, stack, player2)
|
||||
local name = player2 and player2:get_player_name() or ""
|
||||
if not minetest.is_creative_enabled(name) then
|
||||
return 0
|
||||
end
|
||||
return -1
|
||||
end,
|
||||
on_move = function(inv, from_list, from_index, to_list, to_index, count, player2)
|
||||
end,
|
||||
on_take = function(inv, listname, index, stack, player2)
|
||||
if stack and stack:get_count() > 0 then
|
||||
minetest.log("action", player_name .. " takes " .. stack:get_name().. " from creative inventory")
|
||||
end
|
||||
end,
|
||||
}, player_name)
|
||||
|
||||
return player_inventory[player_name]
|
||||
end
|
||||
|
||||
local NO_MATCH = 999
|
||||
local function match(s, filter)
|
||||
if filter == "" then
|
||||
return 0
|
||||
end
|
||||
if s:lower():find(filter, 1, true) then
|
||||
return #s - #filter
|
||||
end
|
||||
return NO_MATCH
|
||||
end
|
||||
|
||||
local function description(def, lang_code)
|
||||
local s = def.description
|
||||
if lang_code then
|
||||
s = minetest.get_translated_string(lang_code, s)
|
||||
end
|
||||
return s:gsub("\n.*", "") -- First line only
|
||||
end
|
||||
|
||||
function creative.update_creative_inventory(player_name, tab_content)
|
||||
local inv = player_inventory[player_name] or
|
||||
creative.init_creative_inventory(minetest.get_player_by_name(player_name))
|
||||
local player_inv = minetest.get_inventory({type = "detached", name = "creative_" .. player_name})
|
||||
|
||||
if inv.filter == inv.old_filter and tab_content == inv.old_content then
|
||||
return
|
||||
end
|
||||
inv.old_filter = inv.filter
|
||||
inv.old_content = tab_content
|
||||
|
||||
local items = inventory_cache[tab_content] or init_creative_cache(tab_content)
|
||||
|
||||
local lang
|
||||
local player_info = minetest.get_player_information(player_name)
|
||||
if player_info and player_info.lang_code ~= "" then
|
||||
lang = player_info.lang_code
|
||||
end
|
||||
|
||||
local creative_list = {}
|
||||
local order = {}
|
||||
for name, def in pairs(items) do
|
||||
local m = match(description(def), inv.filter)
|
||||
if m > 0 then
|
||||
m = math.min(m, match(description(def, lang), inv.filter))
|
||||
end
|
||||
if m > 0 then
|
||||
m = math.min(m, match(name, inv.filter))
|
||||
end
|
||||
|
||||
if m < NO_MATCH then
|
||||
creative_list[#creative_list+1] = name
|
||||
-- Sort by match value first so closer matches appear earlier
|
||||
order[name] = string.format("%02d", m) .. name
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(creative_list, function(a, b) return order[a] < order[b] end)
|
||||
|
||||
player_inv:set_size("main", #creative_list)
|
||||
player_inv:set_list("main", creative_list)
|
||||
inv.size = #creative_list
|
||||
end
|
||||
|
||||
-- Create the trash field
|
||||
local trash = minetest.create_detached_inventory("trash", {
|
||||
-- Allow the stack to be placed and remove it in on_put()
|
||||
-- This allows the creative inventory to restore the stack
|
||||
allow_put = function(inv, listname, index, stack, player)
|
||||
return stack:get_count()
|
||||
end,
|
||||
on_put = function(inv, listname)
|
||||
inv:set_list(listname, {})
|
||||
end,
|
||||
})
|
||||
trash:set_size("main", 1)
|
||||
|
||||
creative.formspec_add = ""
|
||||
|
||||
function creative.register_tab(name, title, items)
|
||||
sfinv.register_page("creative:" .. name, {
|
||||
title = title,
|
||||
is_in_nav = function(self, player, context)
|
||||
return minetest.is_creative_enabled(player:get_player_name())
|
||||
end,
|
||||
get = function(self, player, context)
|
||||
local player_name = player:get_player_name()
|
||||
creative.update_creative_inventory(player_name, items)
|
||||
local inv = player_inventory[player_name]
|
||||
local pagenum = math.floor(inv.start_i / (4*8) + 1)
|
||||
local pagemax = math.ceil(inv.size / (4*8))
|
||||
local esc = minetest.formspec_escape
|
||||
return sfinv.make_formspec(player, context,
|
||||
"label[5.8,4.15;" .. minetest.colorize("#FFFF00", tostring(pagenum)) .. " / " .. tostring(pagemax) .. "]" ..
|
||||
[[
|
||||
image[4.08,4.2;0.8,0.8;creative_trash_icon.png]
|
||||
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]
|
||||
list[detached:trash;main;4.02,4.1;1,1;]
|
||||
listring[]
|
||||
image_button[5,4.05;0.8,0.8;creative_prev_icon.png;creative_prev;]
|
||||
image_button[7.2,4.05;0.8,0.8;creative_next_icon.png;creative_next;]
|
||||
image_button[2.63,4.05;0.8,0.8;creative_search_icon.png;creative_search;]
|
||||
image_button[3.25,4.05;0.8,0.8;creative_clear_icon.png;creative_clear;]
|
||||
]] ..
|
||||
"tooltip[creative_search;" .. esc(S("Search")) .. "]" ..
|
||||
"tooltip[creative_clear;" .. esc(S("Reset")) .. "]" ..
|
||||
"tooltip[creative_prev;" .. esc(S("Previous page")) .. "]" ..
|
||||
"tooltip[creative_next;" .. esc(S("Next page")) .. "]" ..
|
||||
"listring[current_player;main]" ..
|
||||
"field_close_on_enter[creative_filter;false]" ..
|
||||
"field[0.3,4.2;2.8,1.2;creative_filter;;" .. esc(inv.filter) .. "]" ..
|
||||
"listring[detached:creative_" .. player_name .. ";main]" ..
|
||||
"list[detached:creative_" .. player_name .. ";main;0,0;8,4;" .. tostring(inv.start_i) .. "]" ..
|
||||
creative.formspec_add, true)
|
||||
end,
|
||||
on_enter = function(self, player, context)
|
||||
local player_name = player:get_player_name()
|
||||
local inv = player_inventory[player_name]
|
||||
if inv then
|
||||
inv.start_i = 0
|
||||
end
|
||||
end,
|
||||
on_player_receive_fields = function(self, player, context, fields)
|
||||
local player_name = player:get_player_name()
|
||||
local inv = player_inventory[player_name]
|
||||
assert(inv)
|
||||
|
||||
if fields.creative_clear then
|
||||
inv.start_i = 0
|
||||
inv.filter = ""
|
||||
sfinv.set_player_inventory_formspec(player, context)
|
||||
elseif fields.creative_search or
|
||||
fields.key_enter_field == "creative_filter" then
|
||||
inv.start_i = 0
|
||||
inv.filter = fields.creative_filter:lower()
|
||||
sfinv.set_player_inventory_formspec(player, context)
|
||||
elseif not fields.quit then
|
||||
local start_i = inv.start_i or 0
|
||||
|
||||
if fields.creative_prev then
|
||||
start_i = start_i - 4*8
|
||||
if start_i < 0 then
|
||||
start_i = inv.size - (inv.size % (4*8))
|
||||
if inv.size == start_i then
|
||||
start_i = math.max(0, inv.size - (4*8))
|
||||
end
|
||||
end
|
||||
elseif fields.creative_next then
|
||||
start_i = start_i + 4*8
|
||||
if start_i >= inv.size then
|
||||
start_i = 0
|
||||
end
|
||||
end
|
||||
|
||||
inv.start_i = start_i
|
||||
sfinv.set_player_inventory_formspec(player, context)
|
||||
end
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
-- Sort registered items
|
||||
local registered_nodes = {}
|
||||
local registered_tools = {}
|
||||
local registered_craftitems = {}
|
||||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
for name, def in pairs(minetest.registered_items) do
|
||||
local group = def.groups or {}
|
||||
|
||||
local nogroup = not (group.node or group.tool or group.craftitem)
|
||||
if group.node or (nogroup and minetest.registered_nodes[name]) then
|
||||
registered_nodes[name] = def
|
||||
elseif group.tool or (nogroup and minetest.registered_tools[name]) then
|
||||
registered_tools[name] = def
|
||||
elseif group.craftitem or (nogroup and minetest.registered_craftitems[name]) then
|
||||
registered_craftitems[name] = def
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
creative.register_tab("all", S("All"), minetest.registered_items)
|
||||
creative.register_tab("nodes", S("Nodes"), registered_nodes)
|
||||
creative.register_tab("tools", S("Tools"), registered_tools)
|
||||
creative.register_tab("craftitems", S("Items"), registered_craftitems)
|
||||
|
||||
local old_homepage_name = sfinv.get_homepage_name
|
||||
function sfinv.get_homepage_name(player)
|
||||
if minetest.is_creative_enabled(player:get_player_name()) then
|
||||
return "creative:all"
|
||||
else
|
||||
return old_homepage_name(player)
|
||||
end
|
||||
end
|
@ -1,61 +0,0 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2012-2016 Perttu Ahola (celeron55) <celeron55@gmail.com>
|
||||
Copyright (C) 2015-2016 Jean-Patrick G. (kilbith) <jeanpatrick.guerrero@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
Licenses of media (textures)
|
||||
----------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2016 Jean-Patrick G. (kilbith) <jeanpatrick.guerrero@gmail.com>
|
||||
Copyright (C) 2018 paramat
|
||||
|
||||
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/3.0/
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Spieler erlauben, das Kreativinventar zu benutzen
|
||||
Search=Suchen
|
||||
Reset=Zurücksetzen
|
||||
Previous page=Vorherige Seite
|
||||
Next page=Nächste Seite
|
||||
All=Alles
|
||||
Nodes=Blöcke
|
||||
Tools=Werkzeuge
|
||||
Items=Gegenstände
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Permesi ke la ludanto uzu la kreeman stokon
|
||||
Search=Serĉi
|
||||
Reset=Rekomencigi
|
||||
Previous page=Antaŭa paĝo
|
||||
Next page=Sekva paĝo
|
||||
All=Ĉio
|
||||
Nodes=Nodoj
|
||||
Tools=Iloj
|
||||
Items=Objektoj
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Permitir al jugador usar el inventario creativo
|
||||
Search=Buscar
|
||||
Reset=Resetear
|
||||
Previous page=Pág. siguiente
|
||||
Next page=Pág. anterior
|
||||
All=Todos
|
||||
Nodes=Nodos
|
||||
Tools=Herramientas
|
||||
Items=Objetos
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Permettre aux joueurs d'utiliser l'inventaire du mode créatif
|
||||
Search=Rechercher
|
||||
Reset=Réinitialiser
|
||||
Previous page=Page précédente
|
||||
Next page=Page suivante
|
||||
All=Tout
|
||||
Nodes=Nœuds
|
||||
Tools=Outils
|
||||
Items=Article
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Bolehkan pemain memakai inventaris kreatif
|
||||
Search=Cari
|
||||
Reset=Atur ulang
|
||||
Previous page=Halaman sebelumnya
|
||||
Next page=Halaman selanjutnya
|
||||
All=Semua
|
||||
Nodes=Nodus
|
||||
Tools=Perkakas
|
||||
Items=Barang
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Permette al giocatore di usare l'inventario creativo
|
||||
Search=Cerca
|
||||
Reset=Azzera
|
||||
Previous page=Pagina precedente
|
||||
Next page=Pagina successiva
|
||||
All=Tutto
|
||||
Nodes=Nodi
|
||||
Tools=Strumenti
|
||||
Items=Oggetti
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=プレーヤーにクリエイティブ インベントリーの使用を許可する
|
||||
Search=検索
|
||||
Reset=リセット
|
||||
Previous page=前のページ
|
||||
Next page=次のページ
|
||||
All=すべて
|
||||
Nodes=ブロック
|
||||
Tools=道具
|
||||
Items=アイテム
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=zifre le ka pilno le finti ke dacti liste
|
||||
Search=sisku
|
||||
Reset=kraga'igau
|
||||
Previous page=lidne
|
||||
Next page=selyli'e
|
||||
All=ro dacti
|
||||
Nodes=bliku
|
||||
Tools=tutci
|
||||
Items=dacti
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Benarkan pemain menggunakan inventori kreatif
|
||||
Search=Cari
|
||||
Reset=Set semula
|
||||
Previous page=Halaman sebelumnya
|
||||
Next page=Halaman seterusnya
|
||||
All=Semua
|
||||
Nodes=Nod
|
||||
Tools=Alatan
|
||||
Items=Item
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Zezwól graczom na używanie kreatywnego ekwipunku
|
||||
Search=Wyszukaj
|
||||
Reset=Zresetuj
|
||||
Previous page=Poprzednia strona
|
||||
Next page=Następna strona
|
||||
All=Wszystko
|
||||
Nodes=Bloki
|
||||
Tools=Narzędzia
|
||||
Items=Przedmioty
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Permitir o jogador usar o inventário criativo
|
||||
Search=Pesquisar
|
||||
Reset=Redefinir
|
||||
Previous page=Página anterior
|
||||
Next page=Próxima página
|
||||
All=Todos
|
||||
Nodes=Blocos
|
||||
Tools=Ferramentas
|
||||
Items=Itens
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Разрешить игроку использовать творческий инвентарь
|
||||
Search=Поиск
|
||||
Reset=Сброс
|
||||
Previous page=Предыдущая страница
|
||||
Next page=Следующая страница
|
||||
All=Всё
|
||||
Nodes=Ноды
|
||||
Tools=Инструменты
|
||||
Items=Предметы
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Povolí hráčovi použivať kreatívny inventár
|
||||
Search=Hľadaj
|
||||
Reset=Vrátiť späť
|
||||
Previous page=Predchádzajúca stránka
|
||||
Next page=Nasledujúca stránka
|
||||
All=Všetko
|
||||
Nodes=Kocky
|
||||
Tools=Nástroje
|
||||
Items=Veci
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Tillåt spelare att använda kreativa saker
|
||||
Search=Sök
|
||||
Reset=Återställ
|
||||
Previous page=Förra sida
|
||||
Next page=Nästa sida
|
||||
All=Alla
|
||||
Nodes=Noder
|
||||
Tools=Verktyg
|
||||
Items=Saker
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=Дозволити гравцеві використати творчий інвентар
|
||||
Search=Пошук
|
||||
Reset=Скинути
|
||||
Previous page=Попередня сторінка
|
||||
Next page=Наступна сторінка
|
||||
All=Все
|
||||
Nodes=Ноди
|
||||
Tools=Інструменти
|
||||
Items=Предмети
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=允许玩家使用创造模式物品栏
|
||||
Search=搜索
|
||||
Reset=重置
|
||||
Previous page=上一页
|
||||
Next page=下一页
|
||||
All=所有
|
||||
Nodes=节点
|
||||
Tools=工具
|
||||
Items=物品
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=允許玩家使用創造模式物品欄
|
||||
Search=搜索
|
||||
Reset=重置
|
||||
Previous page=上一頁
|
||||
Next page=下一頁
|
||||
All=所有
|
||||
Nodes=節點
|
||||
Tools=工具
|
||||
Items=物品
|
@ -1,10 +0,0 @@
|
||||
# textdomain: creative
|
||||
Allow player to use creative inventory=
|
||||
Search=
|
||||
Reset=
|
||||
Previous page=
|
||||
Next page=
|
||||
All=
|
||||
Nodes=
|
||||
Tools=
|
||||
Items=
|
@ -1,3 +0,0 @@
|
||||
name = creative
|
||||
description = Minetest Game mod: creative
|
||||
depends = default, sfinv
|
Before Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 578 B |
Before Width: | Height: | Size: 593 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 642 B |
@ -1,17 +0,0 @@
|
||||
Minetest Game mod: env_sounds
|
||||
=============================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
paramat (MIT)
|
||||
|
||||
Authors of media (sounds)
|
||||
-------------------------
|
||||
Yuval (CC0 1.0)
|
||||
https://freesound.org/people/Yuval/sounds/197023/
|
||||
env_sounds_water.*.ogg
|
||||
|
||||
Halion (CC0 1.0)
|
||||
https://freesound.org/people/Halion/sounds/17785/
|
||||
env_sounds_lava.*.ogg
|
@ -1,112 +0,0 @@
|
||||
-- Parameters
|
||||
|
||||
-- Node search radius around player
|
||||
local radius = 8
|
||||
|
||||
local allsounds = {
|
||||
["env_sounds_water"] = {
|
||||
trigger = {"default:water_flowing", "default:river_water_flowing"},
|
||||
base_volume = 0.04,
|
||||
max_volume = 0.4,
|
||||
per_node = 0.004,
|
||||
},
|
||||
["env_sounds_lava"] = {
|
||||
trigger = {"default:lava_source", "default:lava_flowing"},
|
||||
base_volume = 0,
|
||||
max_volume = 0.6,
|
||||
per_node = {
|
||||
["default:lava_source"] = 0.008,
|
||||
["default:lava_flowing"] = 0.002,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if minetest.settings:get_bool("river_source_sounds") then
|
||||
table.insert(allsounds["env_sounds_water"].trigger,
|
||||
"default:river_water_source")
|
||||
end
|
||||
|
||||
|
||||
-- Cache the union of all trigger nodes
|
||||
|
||||
local cache_triggers = {}
|
||||
|
||||
for sound, def in pairs(allsounds) do
|
||||
for _, name in ipairs(def.trigger) do
|
||||
table.insert(cache_triggers, name)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Update sound for player
|
||||
|
||||
local function update_sound(player)
|
||||
local player_name = player:get_player_name()
|
||||
local ppos = player:get_pos()
|
||||
ppos = vector.add(ppos, player:get_properties().eye_height)
|
||||
local areamin = vector.subtract(ppos, radius)
|
||||
local areamax = vector.add(ppos, radius)
|
||||
|
||||
local pos = minetest.find_nodes_in_area(areamin, areamax, cache_triggers, true)
|
||||
if next(pos) == nil then -- If table empty
|
||||
return
|
||||
end
|
||||
for sound, def in pairs(allsounds) do
|
||||
-- Find average position
|
||||
local posav = {0, 0, 0}
|
||||
local count = 0
|
||||
for _, name in ipairs(def.trigger) do
|
||||
if pos[name] then
|
||||
for _, p in ipairs(pos[name]) do
|
||||
posav[1] = posav[1] + p.x
|
||||
posav[2] = posav[2] + p.y
|
||||
posav[3] = posav[3] + p.z
|
||||
end
|
||||
count = count + #pos[name]
|
||||
end
|
||||
end
|
||||
|
||||
if count > 0 then
|
||||
posav = vector.new(posav[1] / count, posav[2] / count,
|
||||
posav[3] / count)
|
||||
|
||||
-- Calculate gain
|
||||
local gain = def.base_volume
|
||||
if type(def.per_node) == 'table' then
|
||||
for name, multiplier in pairs(def.per_node) do
|
||||
if pos[name] then
|
||||
gain = gain + #pos[name] * multiplier
|
||||
end
|
||||
end
|
||||
else
|
||||
gain = gain + count * def.per_node
|
||||
end
|
||||
gain = math.min(gain, def.max_volume)
|
||||
|
||||
minetest.sound_play(sound, {
|
||||
pos = posav,
|
||||
to_player = player_name,
|
||||
gain = gain,
|
||||
}, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Update sound when player joins
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
update_sound(player)
|
||||
end)
|
||||
|
||||
|
||||
-- Cyclic sound update
|
||||
|
||||
local function cyclic_update()
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
update_sound(player)
|
||||
end
|
||||
minetest.after(3.5, cyclic_update)
|
||||
end
|
||||
|
||||
minetest.after(0, cyclic_update)
|
@ -1,57 +0,0 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2019 paramat
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
Licenses of media (sounds)
|
||||
--------------------------
|
||||
|
||||
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
||||
Yuval
|
||||
|
||||
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/
|
@ -1,3 +0,0 @@
|
||||
name = env_sounds
|
||||
description = Minetest Game mod: env_sounds
|
||||
depends = default
|
@ -1,8 +0,0 @@
|
||||
Minetest Game mod: give_initial_stuff
|
||||
=====================================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Perttu Ahola (celeron55) <celeron55@gmail.com> (MIT)
|
||||
Various Minetest developers and contributors (MIT)
|
@ -1,46 +0,0 @@
|
||||
-- gave_initial_stuff/init.lua
|
||||
|
||||
local stuff_string = minetest.settings:get("initial_stuff") or
|
||||
"default:pick_steel,default:axe_steel,default:shovel_steel," ..
|
||||
"default:torch 99,default:cobble 99"
|
||||
|
||||
give_initial_stuff = {
|
||||
items = {}
|
||||
}
|
||||
|
||||
function give_initial_stuff.give(player)
|
||||
minetest.log("action",
|
||||
"Giving initial stuff to player " .. player:get_player_name())
|
||||
local inv = player:get_inventory()
|
||||
for _, stack in ipairs(give_initial_stuff.items) do
|
||||
inv:add_item("main", stack)
|
||||
end
|
||||
end
|
||||
|
||||
function give_initial_stuff.add(stack)
|
||||
give_initial_stuff.items[#give_initial_stuff.items + 1] = ItemStack(stack)
|
||||
end
|
||||
|
||||
function give_initial_stuff.clear()
|
||||
give_initial_stuff.items = {}
|
||||
end
|
||||
|
||||
function give_initial_stuff.add_from_csv(str)
|
||||
local items = str:split(",")
|
||||
for _, itemname in ipairs(items) do
|
||||
give_initial_stuff.add(itemname)
|
||||
end
|
||||
end
|
||||
|
||||
function give_initial_stuff.set_list(list)
|
||||
give_initial_stuff.items = list
|
||||
end
|
||||
|
||||
function give_initial_stuff.get_list()
|
||||
return give_initial_stuff.items
|
||||
end
|
||||
|
||||
give_initial_stuff.add_from_csv(stuff_string)
|
||||
if minetest.settings:get_bool("give_initial_stuff") then
|
||||
minetest.register_on_newplayer(give_initial_stuff.give)
|
||||
end
|
@ -1,25 +0,0 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2012-2016 Perttu Ahola (celeron55) <celeron55@gmail.com>
|
||||
Copyright (C) 2012-2016 Various Minetest developers and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
@ -1,3 +0,0 @@
|
||||
name = give_initial_stuff
|
||||
description = Minetest Game mod: give_initial_stuff
|
||||
depends = default
|
@ -1,2 +0,0 @@
|
||||
default
|
||||
streetsmod
|
@ -1,27 +0,0 @@
|
||||
--[[
|
||||
StreetsMod: Delineator
|
||||
]]
|
||||
minetest.register_node(":streets:delineator", {
|
||||
description = streets.S("Delineator"),
|
||||
tiles = {"streets_delineator_top.png","streets_delineator.png"},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
groups = {cracky=3, oddly_breakable_by_hand=2},
|
||||
light_source = 8,
|
||||
sunlight_propagates = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1, -0.5, -0.1, 0.1, 0.5, 0.1},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "streets:delineator 4",
|
||||
recipe = {
|
||||
{"","",""},
|
||||
{"","default:torch",""},
|
||||
{"","default:fence_wood",""}
|
||||
}
|
||||
})
|
@ -1,3 +1,3 @@
|
||||
default
|
||||
|
||||
streetsmod
|
||||
mesecons?
|
@ -1,7 +0,0 @@
|
||||
Minetest Game mod: spawn
|
||||
========================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
paramat (MIT)
|
@ -1,158 +0,0 @@
|
||||
-- spawn/init.lua
|
||||
|
||||
-- Disable by mapgen, setting or if 'static_spawnpoint' is set
|
||||
--------------------------------------------------------------
|
||||
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
if mg_name == "v6" or mg_name == "singlenode" or
|
||||
minetest.settings:get("static_spawnpoint") or
|
||||
minetest.settings:get_bool("engine_spawn") then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- Parameters
|
||||
-------------
|
||||
|
||||
-- Resolution of search grid in nodes.
|
||||
local res = 64
|
||||
-- Number of points checked in the square search grid (edge * edge).
|
||||
local checks = 128 * 128
|
||||
-- Starting point for biome checks. This also sets the y co-ordinate for all
|
||||
-- points checked, so the suitable biomes must be active at this y.
|
||||
local pos = {x = 0, y = 8, z = 0}
|
||||
|
||||
|
||||
-- Table of suitable biomes
|
||||
|
||||
local biome_ids = {
|
||||
minetest.get_biome_id("taiga"),
|
||||
minetest.get_biome_id("coniferous_forest"),
|
||||
minetest.get_biome_id("deciduous_forest"),
|
||||
minetest.get_biome_id("grassland"),
|
||||
minetest.get_biome_id("savanna"),
|
||||
}
|
||||
|
||||
-- End of parameters
|
||||
--------------------
|
||||
|
||||
|
||||
-- Direction table
|
||||
|
||||
local dirs = {
|
||||
{x = 0, y = 0, z = 1},
|
||||
{x = -1, y = 0, z = 0},
|
||||
{x = 0, y = 0, z = -1},
|
||||
{x = 1, y = 0, z = 0},
|
||||
}
|
||||
|
||||
|
||||
-- Initial variables
|
||||
|
||||
local edge_len = 1
|
||||
local edge_dist = 0
|
||||
local dir_step = 0
|
||||
local dir_ind = 1
|
||||
local searched = false
|
||||
local success = false
|
||||
local spawn_pos = {}
|
||||
|
||||
|
||||
-- Get world 'mapgen_limit' and 'chunksize' to calculate 'spawn_limit'.
|
||||
-- This accounts for how mapchunks are not generated if they or their shell exceed
|
||||
-- 'mapgen_limit'.
|
||||
|
||||
local mapgen_limit = tonumber(minetest.get_mapgen_setting("mapgen_limit"))
|
||||
local chunksize = tonumber(minetest.get_mapgen_setting("chunksize"))
|
||||
local spawn_limit = math.max(mapgen_limit - (chunksize + 1) * 16, 0)
|
||||
|
||||
|
||||
--Functions
|
||||
-----------
|
||||
|
||||
-- Get next position on square search spiral
|
||||
|
||||
local function next_pos()
|
||||
if edge_dist == edge_len then
|
||||
edge_dist = 0
|
||||
dir_ind = dir_ind + 1
|
||||
if dir_ind == 5 then
|
||||
dir_ind = 1
|
||||
end
|
||||
dir_step = dir_step + 1
|
||||
edge_len = math.floor(dir_step / 2) + 1
|
||||
end
|
||||
|
||||
local dir = dirs[dir_ind]
|
||||
local move = vector.multiply(dir, res)
|
||||
|
||||
edge_dist = edge_dist + 1
|
||||
|
||||
return vector.add(pos, move)
|
||||
end
|
||||
|
||||
|
||||
-- Spawn position search
|
||||
|
||||
local function search()
|
||||
for iter = 1, checks do
|
||||
local biome_data = minetest.get_biome_data(pos)
|
||||
-- Sometimes biome_data is nil
|
||||
local biome = biome_data and biome_data.biome
|
||||
for id_ind = 1, #biome_ids do
|
||||
local biome_id = biome_ids[id_ind]
|
||||
if biome == biome_id then
|
||||
local spawn_y = minetest.get_spawn_level(pos.x, pos.z)
|
||||
if spawn_y then
|
||||
spawn_pos = {x = pos.x, y = spawn_y, z = pos.z}
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
pos = next_pos()
|
||||
-- Check for position being outside world edge
|
||||
if math.abs(pos.x) > spawn_limit or math.abs(pos.z) > spawn_limit then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
-- On new player spawn and player respawn
|
||||
|
||||
-- Search for spawn position once per server session. If successful, store
|
||||
-- position and reposition players, otherwise leave them at engine spawn
|
||||
-- position.
|
||||
|
||||
local function on_spawn(player)
|
||||
if not searched then
|
||||
success = search()
|
||||
searched = true
|
||||
end
|
||||
if success then
|
||||
player:set_pos(spawn_pos)
|
||||
end
|
||||
return success
|
||||
end
|
||||
|
||||
minetest.register_on_newplayer(function(player)
|
||||
on_spawn(player)
|
||||
end)
|
||||
|
||||
local enable_bed_respawn = minetest.settings:get_bool("enable_bed_respawn")
|
||||
if enable_bed_respawn == nil then
|
||||
enable_bed_respawn = true
|
||||
end
|
||||
|
||||
minetest.register_on_respawnplayer(function(player)
|
||||
-- Avoid respawn conflict with beds mod
|
||||
if beds and enable_bed_respawn and
|
||||
beds.spawn[player:get_player_name()] then
|
||||
return
|
||||
end
|
||||
|
||||
return on_spawn(player)
|
||||
end)
|
@ -1,24 +0,0 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2018 paramat
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
@ -1,4 +0,0 @@
|
||||
name = spawn
|
||||
description = Minetest Game mod: spawn
|
||||
depends = default
|
||||
optional_depends = beds
|