mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-13 19:40:27 +01:00
remove dropondie and replace by bones mod
This commit is contained in:
parent
2cb3a70846
commit
67dcb3f25f
17
mods/bones/README.txt
Executable file
17
mods/bones/README.txt
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
Minetest 0.4 mod: bones
|
||||||
|
=======================
|
||||||
|
|
||||||
|
License of source code:
|
||||||
|
-----------------------
|
||||||
|
Copyright (C) 2012 PilzAdam
|
||||||
|
|
||||||
|
WTFPL
|
||||||
|
|
||||||
|
License of media (textures and sounds)
|
||||||
|
--------------------------------------
|
||||||
|
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||||
|
http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
|
Authors of media files
|
||||||
|
----------------------
|
||||||
|
Bad_Command_
|
4
mods/bones/depends.txt
Executable file
4
mods/bones/depends.txt
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
default
|
||||||
|
pclasses
|
||||||
|
unified_inventory?
|
||||||
|
3d_armor?
|
222
mods/bones/init.lua
Executable file
222
mods/bones/init.lua
Executable file
@ -0,0 +1,222 @@
|
|||||||
|
-- Minetest 0.5 mod: bones
|
||||||
|
-- See README.txt for licensing and other information.
|
||||||
|
--REVISED 20151117 by maikerumine for adding bones to inventory after punch
|
||||||
|
|
||||||
|
|
||||||
|
bones = {}
|
||||||
|
local share_bones_time = (tonumber(minetest.setting_get("share_bones_time")) or 1800)
|
||||||
|
|
||||||
|
bones.bones_formspec =
|
||||||
|
"size[14,9]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[current_name;main;0,0.3;14,4;]"..
|
||||||
|
"list[current_player;main;3,4.85;8,1;]"..
|
||||||
|
"list[current_player;main;3,6.08;8,3;8]"..
|
||||||
|
"listring[current_name;main]"..
|
||||||
|
"listring[current_player;main]" ..
|
||||||
|
default.get_hotbar_bg(3,4.85)
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node("bones:bones", {
|
||||||
|
description = "Bones",
|
||||||
|
tiles = {
|
||||||
|
"bones_top.png",
|
||||||
|
"bones_bottom.png",
|
||||||
|
"bones_side.png",
|
||||||
|
"bones_side.png",
|
||||||
|
"bones_rear.png",
|
||||||
|
"bones_front.png"
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {cracky = 2, oddly_breakable_by_hand = 2},
|
||||||
|
stack_max = 999,
|
||||||
|
sounds = default.node_sound_dirt_defaults({
|
||||||
|
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||||
|
dug = {name="default_gravel_footstep", gain=1.0},
|
||||||
|
}),
|
||||||
|
|
||||||
|
can_dig = function(pos, player)
|
||||||
|
local inv = minetest.get_meta(pos):get_inventory()
|
||||||
|
return inv:is_empty("main")
|
||||||
|
end,
|
||||||
|
|
||||||
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
return 0
|
||||||
|
end,
|
||||||
|
|
||||||
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
|
return 0
|
||||||
|
end,
|
||||||
|
|
||||||
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
|
return stack:get_count()
|
||||||
|
end,
|
||||||
|
|
||||||
|
|
||||||
|
on_punch = function(pos, node, player)
|
||||||
|
-- only owner can punch bones to directly add to inventory
|
||||||
|
local owner = minetest.get_meta(pos):get_string("owner")
|
||||||
|
if owner ~= player:get_player_name() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local inv = minetest.get_meta(pos):get_inventory()
|
||||||
|
local player_inv = player:get_inventory()
|
||||||
|
|
||||||
|
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)
|
||||||
|
player_inv:add_item("main", stk)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if inv:is_empty("main") then
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_timer = function(pos, elapsed)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
if meta:get_inventory():is_empty("main") then
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local time = meta:get_int("time") + elapsed
|
||||||
|
if time < share_bones_time then
|
||||||
|
meta:set_int("time", time)
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_blast = function(pos)
|
||||||
|
local drops = {}
|
||||||
|
default.get_inventory_drops(pos, "main", drops)
|
||||||
|
drops[#drops+1] = "bones:bones"
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
return drops
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local find_best_node = function(pos)
|
||||||
|
local nodes = minetest.find_nodes_in_area(
|
||||||
|
{x=pos.x-2,y=pos.y, z=pos.z-2},
|
||||||
|
{x=pos.x+2,y=pos.y+2, z=pos.z+2},
|
||||||
|
{"air"}
|
||||||
|
)
|
||||||
|
if #nodes > 0 then
|
||||||
|
return nodes[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
nodes = minetest.find_nodes_in_area(
|
||||||
|
{x=pos.x-2,y=pos.y, z=pos.z-2},
|
||||||
|
{x=pos.x+2,y=pos.y+2, z=pos.z+2},
|
||||||
|
{"group:liquid"}
|
||||||
|
)
|
||||||
|
if #nodes > 0 then
|
||||||
|
return nodes[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
nodes = minetest.find_nodes_in_area(
|
||||||
|
{x=pos.x-2,y=pos.y, z=pos.z-2},
|
||||||
|
{x=pos.x+2,y=pos.y+2, z=pos.z+2},
|
||||||
|
{"group:leaves", "group:plant", "group:flower"}
|
||||||
|
)
|
||||||
|
if #nodes > 0 then
|
||||||
|
return nodes[1]
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_dieplayer(function(player)
|
||||||
|
if minetest.setting_getbool("creative_mode") or not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local player_name = player:get_player_name()
|
||||||
|
if player_name == "" then return end
|
||||||
|
|
||||||
|
local pos = player:getpos()
|
||||||
|
pos.y = math.floor(pos.y + 0.5)
|
||||||
|
|
||||||
|
minetest.chat_send_player(player_name, 'Died at '..math.floor(pos.x)..','..math.floor(pos.y)..','..math.floor(pos.z))
|
||||||
|
|
||||||
|
local bones_pos = nil
|
||||||
|
local node = minetest.get_node_or_nil(pos)
|
||||||
|
if node and node.name == "air" then
|
||||||
|
bones_pos = pos
|
||||||
|
else
|
||||||
|
bones_pos = find_best_node(pos)
|
||||||
|
end
|
||||||
|
if not bones_pos then return end -- no pos to place bones
|
||||||
|
|
||||||
|
minetest.set_node(bones_pos, {name="bones:bones"})
|
||||||
|
|
||||||
|
local meta = minetest.get_meta(bones_pos)
|
||||||
|
meta:set_string("formspec", bones.bones_formspec)
|
||||||
|
meta:set_string("owner", player_name)
|
||||||
|
meta:set_string("infotext", player_name.."'s bones")
|
||||||
|
local time = os.date("*t")
|
||||||
|
meta:set_int("time", 0)
|
||||||
|
|
||||||
|
local bones_inv = meta:get_inventory()
|
||||||
|
bones_inv:set_size("main", 14*4)
|
||||||
|
|
||||||
|
|
||||||
|
local player_inv = player:get_inventory()
|
||||||
|
-- main inventory
|
||||||
|
for i=1, player_inv:get_size("main") do
|
||||||
|
local stack = player_inv:get_stack("main", i)
|
||||||
|
if stack then
|
||||||
|
local stack_name = stack:get_name()
|
||||||
|
if not pclasses.data.reserved_items[stack_name] or
|
||||||
|
not pclasses.api.util.can_have_item(player_name, stack_name) then
|
||||||
|
bones_inv:add_item("main", stack)
|
||||||
|
player_inv:set_stack("main", i, nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- craft inventory
|
||||||
|
for i=1, player_inv:get_size("craft") do
|
||||||
|
local stack = player_inv:get_stack("craft", i)
|
||||||
|
if stack then
|
||||||
|
bones_inv:add_item("main", stack)
|
||||||
|
player_inv:set_stack("craft", i, nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- unified_inventory bags
|
||||||
|
if minetest.get_modpath("unified_inventory") then
|
||||||
|
for n = 1, 4 do
|
||||||
|
local stack = unified_inventory.extract_bag(player, n)
|
||||||
|
if stack then
|
||||||
|
bones_inv:add_item("main", stack)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--3d_armor
|
||||||
|
if minetest.get_modpath("3d_armor") then
|
||||||
|
local name, player_inv, armor_inv, pos = armor:get_valid_player(player, "[on_dieplayer]")
|
||||||
|
if name then
|
||||||
|
for i=1, player_inv:get_size("armor") do
|
||||||
|
local stack = armor_inv:get_stack("armor", i)
|
||||||
|
if stack:get_count() > 0 and (not pclasses.data.reserved_items[stack:get_name()] or
|
||||||
|
not pclasses.api.util.can_have_item(name, stack:get_name())) then
|
||||||
|
bones_inv:add_item("main", stack)
|
||||||
|
armor_inv:set_stack("armor", i, nil)
|
||||||
|
player_inv:set_stack("armor", i, nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
armor:set_player_armor(player)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
minetest.chat_send_player(player_name, 'Your bones is at '..math.floor(bones_pos.x)..','..math.floor(bones_pos.y)..','..math.floor(bones_pos.z))
|
||||||
|
minetest.get_node_timer(bones_pos):start(10)
|
||||||
|
end)
|
||||||
|
|
BIN
mods/bones/textures/bones_bottom.png
Executable file
BIN
mods/bones/textures/bones_bottom.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 180 B |
BIN
mods/bones/textures/bones_front.png
Executable file
BIN
mods/bones/textures/bones_front.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 183 B |
BIN
mods/bones/textures/bones_rear.png
Executable file
BIN
mods/bones/textures/bones_rear.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 187 B |
BIN
mods/bones/textures/bones_side.png
Executable file
BIN
mods/bones/textures/bones_side.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 188 B |
BIN
mods/bones/textures/bones_top.png
Executable file
BIN
mods/bones/textures/bones_top.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 181 B |
@ -1,202 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright {yyyy} {name of copyright owner}
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
|||||||
minetest-dropondie
|
|
||||||
==================
|
|
||||||
|
|
||||||
Minecraft-like drop-all-items-on-die mod
|
|
@ -1,2 +0,0 @@
|
|||||||
default
|
|
||||||
pclasses
|
|
@ -1,73 +0,0 @@
|
|||||||
local drop = function(pos, itemstack)
|
|
||||||
|
|
||||||
local it = itemstack:take_item(itemstack:get_count())
|
|
||||||
local obj = core.add_item(pos, it)
|
|
||||||
|
|
||||||
if obj then
|
|
||||||
|
|
||||||
obj:setvelocity({x=math.random(-2.5,2.5), y=7, z=math.random(-2.5,2.5)})
|
|
||||||
|
|
||||||
local remi = minetest.setting_get("remove_items")
|
|
||||||
|
|
||||||
if remi and remi == "true" then
|
|
||||||
obj:remove()
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_on_dieplayer(function(player)
|
|
||||||
|
|
||||||
if minetest.setting_getbool("creative_mode") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local pos = player:getpos()
|
|
||||||
pos.y = math.floor(pos.y + 0.5)
|
|
||||||
|
|
||||||
minetest.chat_send_player(player:get_player_name(), 'at '..math.floor(pos.x)..','..math.floor(pos.y)..','..math.floor(pos.z))
|
|
||||||
|
|
||||||
local player_inv = player:get_inventory()
|
|
||||||
|
|
||||||
for i=1,player_inv:get_size("main") do
|
|
||||||
if not pclasses.data.reserved_items[player_inv:get_stack("main", i):get_name()] or
|
|
||||||
not pclasses.api.util.can_have_item(player:get_player_name(), player_inv:get_stack("main", i):get_name()) then
|
|
||||||
drop(pos, player_inv:get_stack("main", i))
|
|
||||||
player_inv:set_stack("main", i, nil)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for i=1,player_inv:get_size("craft") do
|
|
||||||
drop(pos, player_inv:get_stack("craft", i))
|
|
||||||
player_inv:set_stack("craft", i, nil)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Drop unified_inventory bags and their contents
|
|
||||||
if minetest.get_modpath("unified_inventory") then
|
|
||||||
|
|
||||||
--[[ local bag_id = {"bag1", "bag2", "bag3", "bag4"}
|
|
||||||
local contents_id = ""
|
|
||||||
local n = 0
|
|
||||||
|
|
||||||
for n = 1, 4 do
|
|
||||||
if player_inv:get_size(bag_id[n]) ~= nil and player_inv:get_size(bag_id[n]) == 1 then
|
|
||||||
contents_id = bag_id[n].."contents"
|
|
||||||
-- Drop the contents of the bag (but keep the bag itself)
|
|
||||||
for i = 1, player_inv:get_size(contents_id) do
|
|
||||||
-- Drop a clone of this item's stack and remove the one from the inventory
|
|
||||||
drop(pos, player_inv:get_stack(contents_id, i))
|
|
||||||
player_inv:set_stack(contents_id, i, nil)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
]]
|
|
||||||
for n = 1, 4 do
|
|
||||||
local stack = unified_inventory.extract_bag(player, n)
|
|
||||||
if stack then
|
|
||||||
drop(pos, stack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end)
|
|
@ -160,7 +160,7 @@ load_mod_cozy = true
|
|||||||
load_mod_unified_inventory = true
|
load_mod_unified_inventory = true
|
||||||
load_mod_inventory_icon = true
|
load_mod_inventory_icon = true
|
||||||
load_mod_u_skins = true
|
load_mod_u_skins = true
|
||||||
load_mod_dropondie = true
|
load_mod_bones = true
|
||||||
load_mod_item_drop = true
|
load_mod_item_drop = true
|
||||||
|
|
||||||
load_mod_mff_core = true
|
load_mod_mff_core = true
|
||||||
|
Loading…
Reference in New Issue
Block a user