updated textures for bags mod
removed armor_stats and pvp mods removed some temp image filesmaster
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 175 B |
|
@ -1,11 +0,0 @@
|
|||
[Mod] Armor Stats HUD [armor_stats]
|
||||
==========================================================
|
||||
|
||||
Licenses:
|
||||
|
||||
All code is WTFPL by mtango688
|
||||
https://forum.minetest.net/viewtopic.php?t=14493
|
||||
|
||||
License Textures: Copyright (C) 2017 davidthecreator - CC-BY-SA 3.0
|
||||
https://github.com/daviddoesminetest/3d-armors-new-textures
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
inventory_plus
|
||||
default
|
||||
3d_armor
|
|
@ -1,64 +0,0 @@
|
|||
-- armor stats hud mod
|
||||
--
|
||||
-- this draws a statbar for armor above the breath bar for whatever
|
||||
-- armor the players are wearing
|
||||
--
|
||||
-- license: WTFPL
|
||||
|
||||
local stats = {}
|
||||
local update_interval = 1.0
|
||||
local is_armor = minetest.get_modpath("3d_armor") ~= nil
|
||||
local shields = minetest.get_modpath("shields") ~= nil
|
||||
|
||||
if minetest.setting_getbool("enable_damage") and is_armor then
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
stats[name] = {}
|
||||
local id = player:hud_add({
|
||||
name = "armor_stats",
|
||||
hud_elem_type = "statbar",
|
||||
position = {x = 0.5, y = 1},
|
||||
size = {x = 24, y = 24},
|
||||
text = "hud_armor_fg.png",
|
||||
number = 0,
|
||||
alignment = {x = -1, y = -1},
|
||||
offset = { x=-325, y = -116},
|
||||
max = 0,
|
||||
})
|
||||
stats[name].hud_id = id
|
||||
stats[name].level = 0
|
||||
end)
|
||||
end
|
||||
|
||||
-- just poll each interval (1s default)
|
||||
|
||||
local function update_stats()
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
if name and stats[name] then
|
||||
local level = 0
|
||||
local max = 63 -- full diamond armor
|
||||
if shields then max = 84.14 end -- + diamond shield
|
||||
|
||||
local def = armor.def
|
||||
if def[name] and def[name].level then
|
||||
level = def[name].level
|
||||
end
|
||||
|
||||
level = math.floor(20.0 * math.min(1.0, level / max))
|
||||
|
||||
-- wait for the value to *visibly* change before updating
|
||||
-- (hud_change more often than that is just redundant)
|
||||
if stats[name].level ~= level then
|
||||
stats[name].level = level
|
||||
player:hud_change(stats[name].hud_id, "number", level)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.after(update_interval, update_stats)
|
||||
end
|
||||
|
||||
if is_armor then
|
||||
minetest.after(update_interval, update_stats)
|
||||
end
|
Before Width: | Height: | Size: 371 B |
Before Width: | Height: | Size: 797 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 399 B |
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 391 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 399 B |
Before Width: | Height: | Size: 648 B |
|
@ -1,46 +0,0 @@
|
|||
PvP-Button Mod by Phiwari123
|
||||
============================
|
||||
|
||||
This mod adds a PvP-Button to the player's inventory, which allows each
|
||||
player on a server whether he/she wants to be attackable by others or not.
|
||||
|
||||
Current Version: 1.0
|
||||
|
||||
Dependencies: inventory_plus needs to be installed in order to use this mod
|
||||
|
||||
Report bugs or request help on the forum topic!
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Unzip the archive and place the folder in minetest/mods
|
||||
|
||||
For further information or help see:
|
||||
http://wiki.minetest.net/Installing_Mods
|
||||
|
||||
|
||||
License for Code
|
||||
----------------
|
||||
|
||||
Copyright (C) 2015 Phiwari123 phiwari123@web.de
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
License for Textures, Models and Sounds
|
||||
---------------------------------------
|
||||
|
||||
CC-BY-SA 3.0 UNPORTED. Created by Phiwari123
|
||||
|
|
@ -1 +0,0 @@
|
|||
inventory_plus
|
|
@ -1,68 +0,0 @@
|
|||
-- Needed variables
|
||||
local pvptable = {}
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
localname = player:get_player_name()
|
||||
pvptable[localname] = 0
|
||||
|
||||
inventory_plus.register_button(player,"pvp","PvP")
|
||||
minetest.after(1,function()
|
||||
inventory_plus.set_inventory_formspec(player,inventory_plus.get_formspec(player, inventory_plus.default))
|
||||
end)
|
||||
end)
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
|
||||
localname = player:get_player_name()
|
||||
|
||||
if fields.pvp then
|
||||
if pvptable[localname] == 0 then
|
||||
pvptable[localname] = 1
|
||||
minetest.chat_send_player(localname,
|
||||
"PvP was enabled for "..localname)
|
||||
player:hud_remove(pvpdisabled)
|
||||
pvpenabled = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
position = {x = 1, y = 0},
|
||||
offset = {x=-100, y = 20},
|
||||
scale = {x = 100, y = 100},
|
||||
text = "PvP is enabled for you!",
|
||||
number = 0xFF0000 -- Red
|
||||
})
|
||||
return
|
||||
else
|
||||
|
||||
pvptable[localname] = 0
|
||||
|
||||
minetest.chat_send_player(localname,
|
||||
"PvP was disabled for "..localname)
|
||||
player:hud_remove(pvpenabled)
|
||||
return
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
if minetest.setting_getbool("enable_pvp") then
|
||||
if minetest.register_on_punchplayer then
|
||||
minetest.register_on_punchplayer(
|
||||
function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage, pvp)
|
||||
|
||||
if not hitter:is_player() then
|
||||
return false
|
||||
end
|
||||
|
||||
local localname = player:get_player_name()
|
||||
local hittername = hitter:get_player_name()
|
||||
|
||||
if pvptable[localname] == 1 and pvptable[hittername] == 1 then
|
||||
return false
|
||||
else
|
||||
minetest.chat_send_player(localname,
|
||||
"The player "..hittername.." is trying to attack you.")
|
||||
minetest.chat_send_player(hittername,
|
||||
"The player "..localname.." does not have PvP activated.")
|
||||
return true
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
Before Width: | Height: | Size: 391 B |
Before Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 673 B |