Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unfreeze and update 3d_armor (split modpack) #170

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions builder/lib-config-whynot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
declare -Ag BRANCHES=(
[minetest_game/minetest_game]=origin/stable-5 # Stay on stable version
[flora_ores/farming]=0b06c7cd450c5ec9a76b3c22a9c57f06e4f8a7c2 # freeze due to incompatibility with milk buckets
[player/3d_armor]=e1a262ba20e4bf0a1046ca06d83953ae0983f621 # freeze due to 3d_armor mod split for each armor type
)

#
Expand All @@ -22,4 +21,4 @@
[decor/homedecor_modpack]='--exclude=itemframes --exclude=homedecor_3d_extras --exclude=homedecor_inbox'
[decor/home_workshop_modpack]='--exclude=computers --exclude=home_workshop_machines'
[decor/mydoors]='--exclude=my_garage_door --exclude=my_saloon_doors --exclude=my_sliding_doors'
)
)
2 changes: 1 addition & 1 deletion builder/mods_src/player/3d_armor
Submodule 3d_armor updated 334 files
2 changes: 1 addition & 1 deletion mod_sources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ origin https://github.com/minetest-mirrors/mobs_redo.git (fetch)
Mod: mobs_redo/mobs_redo

origin https://github.com/minetest-mods/3d_armor (fetch)
* e1a262ba20e4bf0a1046ca06d83953ae0983f621 add feather falling (#73)
* aef125a0ca98cca378367881f2b9be446d884f33 fix small typo (#111)
Mod: player/3d_armor

origin https://gitlab.com/dacmot/awards.git (fetch)
Expand Down
4 changes: 2 additions & 2 deletions mods/player/3d_armor/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
3D Armor - Visible Player Armor
===============================

License Source Code: Copyright (C) 2013-2018 Stuart Jones - LGPL v2.1
License Source Code: Copyright (C) 2013-2023 Stuart Jones - LGPL v2.1

Armor Textures: Copyright (C) 2017-2018 davidthecreator - CC-BY-SA 3.0
Armor Textures: Copyright (C) 2017-2023 davidthecreator - CC-BY-SA 3.0

Special credit to Jordach and MirceaKitsune for providing the default 3d character model.

Expand Down
16 changes: 15 additions & 1 deletion mods/player/3d_armor/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,13 @@ armor.set_player_armor = function(self, player)
armor_monoid.monoid:add_change(player, change, "3d_armor:armor")
else
-- Preserve immortal group (damage disabled for player)
local immortal = player:get_armor_groups().immortal
local player_groups = player:get_armor_groups()
local immortal = player_groups.immortal
if immortal and immortal ~= 0 then
groups.immortal = 1
end
-- Preserve fall_damage_add_percent group (fall damage modifier)
groups.fall_damage_add_percent = player_groups.fall_damage_add_percent
player:set_armor_groups(groups)
end
if use_player_monoids then
Expand Down Expand Up @@ -628,6 +631,9 @@ end
armor.damage = function(self, player, index, stack, use)
local old_stack = ItemStack(stack)
local worn_armor = armor:get_weared_armor_elements(player)
if not worn_armor then
return
end
local armor_worn_cnt = 0
for k,v in pairs(worn_armor) do
armor_worn_cnt = armor_worn_cnt + 1
Expand Down Expand Up @@ -678,6 +684,10 @@ armor.equip = function(self, player, itemstack)
for i=1, armor_inv:get_size("armor") do
local stack = armor_inv:get_stack("armor", i)
if self:get_element(stack:get_name()) == armor_element then
--prevents equiping an armor that would unequip a cursed armor.
if minetest.get_item_group(stack:get_name(), "cursed") ~= 0 then
return itemstack
end
index = i
self:unequip(player, armor_element)
break
Expand Down Expand Up @@ -930,6 +940,10 @@ armor.get_valid_player = function(self, player, msg)
minetest.log("warning", ("3d_armor%s: Player reference is nil"):format(msg))
return
end
if type(player) ~= "userdata" then
-- Fake player, fail silently
return
end
local name = player:get_player_name()
if not name then
minetest.log("warning", ("3d_armor%s: Player name is nil"):format(msg))
Expand Down
Loading