Commit 5bd9eac0 authored by ClaudiusMinimus's avatar ClaudiusMinimus
Browse files

merged in master

parents e695ad8c 4cb83e53
Pipeline #345 failed with stage
[submodule "mods/boats"]
path = mods/boats
url = https://git.tchncs.de/Illuna-Minetest/boats.git
[submodule "mods/illuna"]
path = mods/illuna
url = https://git.tchncs.de/Illuna-Minetest/illuna.git
......@@ -16,9 +13,6 @@
[submodule "mods/mobs_animal"]
path = mods/mobs_animal
url = https://git.tchncs.de/Illuna-Minetest/mobs_animal.git
[submodule "mods/farming"]
path = mods/farming
url = https://git.tchncs.de/Illuna-Minetest/farming.git
[submodule "mods/worldedit"]
path = mods/worldedit
url = https://github.com/Uberi/Minetest-WorldEdit
......@@ -65,9 +59,22 @@
[submodule "mods/pkarcs"]
path = mods/pkarcs
url = https://git.tchncs.de/Illuna-Minetest/pkarcs
[submodule "mods/farming"]
path = mods/farming
url = https://git.tchncs.de/Illuna-Minetest/farming
[submodule "mods/boats"]
path = mods/boats
url = https://git.tchncs.de/Illuna-Minetest/boats
[submodule "mods/technic_chests"]
path = mods/technic_chests
url = https://git.tchncs.de/Illuna-Minetest/technic_chests
[submodule "mods/columnia"]
path = mods/columnia
url = https://git.tchncs.de/Illuna-Minetest/columnia
[submodule "mods/hemp"]
path = mods/hemp
url = https://github.com/pithydon/hemp.git
[submodule "mods/coloured_nametag"]
path = mods/coloured_nametag
url = https://github.com/Amaz1/coloured_nametag
unused_args = false
allow_defined_top = true
read_globals = {
"DIR_DELIM",
"minetest", "core",
"dump",
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
}
-- Overwrites minetest.handle_node_drops
files["mods/creative/init.lua"].globals = { "minetest" }
-- Don't report on legacy definitions of globals.
files["mods/default/legacy.lua"].global = false
language: generic
branches:
only:
- master
sudo: required
before_install:
- sudo apt-get update
- sudo apt-get install -y luarocks
- sudo luarocks install luacheck
script: luacheck --no-color ./mods
......@@ -62,6 +62,11 @@ Beds API
}
}
Creative API
------------
A global string called `creative.formspec_add` was added which allows mods to add additional formspec elements onto the default creative inventory formspec to be drawn after each update.
Doors API
---------
......@@ -245,6 +250,18 @@ Give Initial Stuff API
^ str is a comma separated list of initial stuff
^ Adds items to the list of items to be given
Nyancat API
-----------
`nyancat.place(pos, facedir, length)`
^ Place a cat at `pos` facing `facedir` with tail length `length`
Only accepts facedir 0-3, if facedir > 3 then it will be interpreted as facedir = 0
`nyancat.generate(minp, maxp, seed)`
^ Called by `minetest.register_on_generated`. To disable nyancat generation,
you can redefine nyancat.generate() to be an empty function
TNT API
----------
......@@ -331,7 +348,7 @@ To use it, add the `on_screwdriver` function to the node definition.
* `new_param2` the new value of param2 that would have been set if on_rotate wasn't there
* return value: false to disallow rotation, nil to keep default behaviour, true to allow
it but to indicate that changed have already been made (so the screwdriver will wear out)
* use `on_rotate = screwdriver.disallow` to always disallow rotation
* use `on_rotate = false` to always disallow rotation
* use `on_rotate = screwdriver.rotate_simple` to allow only face rotation
......
......@@ -5,6 +5,12 @@
# Whether creative mode (fast digging of all blocks, unlimited resources) should be enabled
#creative_mode = false
# Sets the behaviour of the inventory items when a player dies.
# "bones": Store all items inside a bone node but drop items if inside protected area
# "drop": Drop all items on the ground
# "keep": Player keeps all items
#bones_mode = "bones"
# The time in seconds after which the bones of a dead player can be looted by everyone
# 0 to disable
#share_bones_time = 1200
......@@ -14,9 +20,9 @@
# 0 to disable. By default it is "share_bones_time" divide by four.
#share_bones_time_early = 300
# Whether standard fire should be disabled ('basic flame' nodes will disappear)
# 'permanent flame' nodes will remain with either setting
#disable_fire = false
# Whether fire should be enabled. If disabled, 'basic flame' nodes will disappear.
# 'permanent flame' nodes will remain with either setting.
#enable_fire = true
# Whether the stuff in initial_stuff should be given to new players
#give_initial_stuff = false
......
......@@ -70,7 +70,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
-- physics, eye_offset, etc
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
player:set_look_yaw(math.random(1, 180) / 100)
player:set_look_horizontal(math.random(1, 180) / 100)
default.player_attached[name] = false
player:set_physics_override(1, 1, 1)
hud_flags.wielditem = true
......@@ -85,7 +85,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
-- physics, eye_offset, etc
player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})
local yaw, param2 = get_look_yaw(bed_pos)
player:set_look_yaw(yaw)
player:set_look_horizontal(yaw)
local dir = minetest.facedir_to_dir(param2)
local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2}
player:set_physics_override(0, 0, 0)
......
......@@ -14,4 +14,4 @@ http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
----------------------
Bad_Command_
All textures: paramat
-- Minetest 0.4 mod: bones
-- See README.txt for licensing and other information.
bones = {}
local function is_owner(pos, name)
local owner = minetest.get_meta(pos):get_string("owner")
if owner == "" or owner == name or minetest.check_player_privs(name, "protection_bypass") then
......@@ -11,7 +9,7 @@ local function is_owner(pos, name)
return false
end
bones.bones_formspec =
local bones_formspec =
"size[8,9]" ..
default.gui_bg ..
default.gui_bg_img ..
......@@ -29,7 +27,7 @@ local share_bones_time_early = tonumber(minetest.setting_get("share_bones_time_e
minetest.register_node("bones:bones", {
description = "Bones",
tiles = {
"bones_top.png",
"bones_top.png^[transform2",
"bones_bottom.png",
"bones_side.png",
"bones_side.png",
......@@ -37,11 +35,8 @@ minetest.register_node("bones:bones", {
"bones_front.png"
},
paramtype2 = "facedir",
groups = {dig_immediate=2},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.5},
dug = {name="default_gravel_footstep", gain=1.0},
}),
groups = {dig_immediate = 2},
sounds = default.node_sound_gravel_defaults(),
can_dig = function(pos, player)
local inv = minetest.get_meta(pos):get_inventory()
......@@ -78,11 +73,11 @@ minetest.register_node("bones:bones", {
end,
on_punch = function(pos, node, player)
if(not is_owner(pos, player:get_player_name())) then
if not is_owner(pos, player:get_player_name()) then
return
end
if(minetest.get_meta(pos):get_string("infotext") == "") then
if minetest.get_meta(pos):get_string("infotext") == "" then
return
end
......@@ -90,7 +85,7 @@ minetest.register_node("bones:bones", {
local player_inv = player:get_inventory()
local has_space = true
for i=1,inv:get_size("main") do
for i = 1, inv:get_size("main") do
local stk = inv:get_stack("main", i)
if player_inv:room_for_item("main", stk) then
inv:set_stack("main", i, nil)
......@@ -116,7 +111,7 @@ minetest.register_node("bones:bones", {
local meta = minetest.get_meta(pos)
local time = meta:get_int("time") + elapsed
if time >= share_bones_time then
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
meta:set_string("infotext", meta:get_string("owner") .. "'s old bones")
meta:set_string("owner", "")
else
meta:set_int("time", time)
......@@ -131,13 +126,9 @@ local function may_replace(pos, player)
local node_name = minetest.get_node(pos).name
local node_definition = minetest.registered_nodes[node_name]
-- if the node is unknown, we let the protection mod decide
-- this is consistent with when a player could dig or not dig it
-- unknown decoration would often be removed
-- while unknown building materials in use would usually be left
-- if the node is unknown, we return false
if not node_definition then
-- only replace nodes that are not protected
return not minetest.is_protected(pos, player:get_player_name())
return false
end
-- allow replacing air and liquids
......@@ -157,8 +148,26 @@ local function may_replace(pos, player)
return node_definition.buildable_to and not minetest.is_protected(pos, player:get_player_name())
end
local drop = function(pos, itemstack)
local obj = minetest.add_item(pos, itemstack:take_item(itemstack:get_count()))
if obj then
obj:setvelocity({
x = math.random(-10, 10) / 9,
y = 5,
z = math.random(-10, 10) / 9,
})
end
end
minetest.register_on_dieplayer(function(player)
if minetest.setting_getbool("creative_mode") then
local bones_mode = minetest.setting_get("bones_mode") or "bones"
if bones_mode ~= "bones" and bones_mode ~= "drop" and bones_mode ~= "keep" then
bones_mode = "bones"
end
-- return if keep inventory set or in creative mode
if bones_mode == "keep" or minetest.setting_getbool("creative_mode") then
return
end
......@@ -168,62 +177,65 @@ minetest.register_on_dieplayer(function(player)
return
end
local pos = player:getpos()
pos.x = math.floor(pos.x+0.5)
pos.y = math.floor(pos.y+0.5)
pos.z = math.floor(pos.z+0.5)
local param2 = minetest.dir_to_facedir(player:get_look_dir())
local pos = vector.round(player:getpos())
local player_name = player:get_player_name()
if (not may_replace(pos, player)) then
if (may_replace({x=pos.x, y=pos.y+1, z=pos.z}, player)) then
-- drop one node above if there's space
-- this should solve most cases of protection related deaths in which players dig straight down
-- yet keeps the bones reachable
pos.y = pos.y+1
else
-- drop items instead of delete
for i=1,player_inv:get_size("main") do
minetest.add_item(pos, player_inv:get_stack("main", i))
-- check if it's possible to place bones, if not go 1 higher
if bones_mode == "bones" and not may_replace(pos, player) then
pos.y = pos.y + 1
end
for i=1,player_inv:get_size("craft") do
minetest.add_item(pos, player_inv:get_stack("craft", i))
-- still cannot place bones? change mode to 'drop'
if bones_mode == "bones" and not may_replace(pos, player) then
bones_mode = "drop"
end
if bones_mode == "drop" then
-- drop inventory items
for i = 1, player_inv:get_size("main") do
drop(pos, player_inv:get_stack("main", i))
end
-- empty lists main and craft
player_inv:set_list("main", {})
-- drop crafting grid items
for i = 1, player_inv:get_size("craft") do
drop(pos, player_inv:get_stack("craft", i))
end
player_inv:set_list("craft", {})
drop(pos, ItemStack("bones:bones"))
return
end
end
minetest.set_node(pos, {name="bones:bones", param2=param2})
local param2 = minetest.dir_to_facedir(player:get_look_dir())
minetest.set_node(pos, {name = "bones:bones", param2 = param2})
minetest.chat_send_player(player_name, "Your stuff is waiting for you at "..minetest.pos_to_string(pos).. ". Go and grab it! ;-)")
minetest.log("action", player_name.." left their bones at "..minetest.pos_to_string(pos))
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
inv:set_size("main", 8 * 4)
inv:set_list("main", player_inv:get_list("main"))
for i=1,player_inv:get_size("craft") do
for i = 1, player_inv:get_size("craft") do
local stack = player_inv:get_stack("craft", i)
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
--drop if no space left
minetest.add_item(pos, stack)
drop(pos, stack)
end
end
player_inv:set_list("main", {})
player_inv:set_list("craft", {})
meta:set_string("formspec", bones.bones_formspec)
meta:set_string("formspec", bones_formspec)
meta:set_string("owner", player_name)
if share_bones_time ~= 0 then
meta:set_string("infotext", player_name.."'s fresh bones")
meta:set_string("infotext", player_name .. "'s fresh bones")
if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then
meta:set_int("time", 0)
......
mods/bones/textures/bones_bottom.png

181 Bytes | W: | H:

mods/bones/textures/bones_bottom.png

740 Bytes | W: | H:

mods/bones/textures/bones_bottom.png
mods/bones/textures/bones_bottom.png
mods/bones/textures/bones_bottom.png
mods/bones/textures/bones_bottom.png
  • 2-up
  • Swipe
  • Onion skin
mods/bones/textures/bones_front.png

183 Bytes | W: | H:

mods/bones/textures/bones_front.png

656 Bytes | W: | H:

mods/bones/textures/bones_front.png
mods/bones/textures/bones_front.png
mods/bones/textures/bones_front.png
mods/bones/textures/bones_front.png
  • 2-up
  • Swipe
  • Onion skin
mods/bones/textures/bones_rear.png

187 Bytes | W: | H:

mods/bones/textures/bones_rear.png

637 Bytes | W: | H:

mods/bones/textures/bones_rear.png
mods/bones/textures/bones_rear.png
mods/bones/textures/bones_rear.png
mods/bones/textures/bones_rear.png
  • 2-up
  • Swipe
  • Onion skin
mods/bones/textures/bones_side.png

188 Bytes | W: | H:

mods/bones/textures/bones_side.png

700 Bytes | W: | H:

mods/bones/textures/bones_side.png
mods/bones/textures/bones_side.png
mods/bones/textures/bones_side.png
mods/bones/textures/bones_side.png
  • 2-up
  • Swipe
  • Onion skin
mods/bones/textures/bones_top.png

182 Bytes | W: | H:

mods/bones/textures/bones_top.png

662 Bytes | W: | H:

mods/bones/textures/bones_top.png
mods/bones/textures/bones_top.png
mods/bones/textures/bones_top.png
mods/bones/textures/bones_top.png
  • 2-up
  • Swipe
  • Onion skin
Subproject commit 819daa52f1c8e1621489a5f8d73ad9a29e6efa4e
Subproject commit 5013537e24f526fbae97a6693a08d6eff7f8cd9b
......@@ -141,7 +141,7 @@ minetest.register_craftitem("bucket:bucket_empty", {
else
local pos = user:getpos()
pos.y = math.floor(pos.y + 0.5)
core.add_item(pos, liquiddef.itemname)
minetest.add_item(pos, liquiddef.itemname)
end
-- set to return empty buckets minus 1
......
Subproject commit c50a4ca893e5383d75ff274533327a5faf20b1b7
Subproject commit c3a57b9e17bdca5679366fab1518d19d01fd433f
Subproject commit 7a5384239d0e86b126cd873c5585061fb8926add
......@@ -125,7 +125,7 @@ creative.set_creative_formspec = function(player, start_i)
tooltip[creative_clear;Reset]
listring[current_player;main]
]] ..
"field[0.3,3.5;2.2,1;creative_filter;;" .. inv.filter .. "]" ..
"field[0.3,3.5;2.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. ";false]" ..
"listring[detached:creative_" .. player_name .. ";main]" ..
"tabheader[0,0;creative_tabs;Crafting,All,Nodes,Tools,Items;" .. tostring(inv.tab_id) .. ";true;false]" ..
"list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" ..
......@@ -192,7 +192,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
inv.filter = ""
creative.update_creative_inventory(player_name)
creative.set_creative_formspec(player, 0)
elseif fields.creative_search then
elseif fields.creative_search or
fields.key_enter_field == "creative_filter" then
player_inventory[player_name].start_i = 1
inv.filter = fields.creative_filter:lower()
creative.update_creative_inventory(player_name)
......
Subproject commit 272e10fc3d59e1f5dc05ebc2ec1bd2b46f8d725b
Subproject commit 3d7d76d4b4becaa00bb658769fa6dde4e2eafe96
......@@ -51,13 +51,11 @@ RealBadAngel's animated water (WTFPL):
default_water_flowing_animated.png
VanessaE (WTFPL):
default_nc_back.png
default_nc_front.png
default_nc_rb.png
default_nc_side.png
default_desert_sand.png
default_desert_stone.png
default_sand.png
default_mese_crystal.png
default_mese_crystal_fragment.png
Calinou (CC BY-SA):
default_brick.png
......@@ -125,6 +123,7 @@ paramat (CC BY-SA 3.0):
default_grass.png
default_grass_side.png
default_snow_side.png
default_mese_block.png
brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment