Skip to content

Commit

Permalink
Merge pull request #170 from dacmot/update_3darmor
Browse files Browse the repository at this point in the history
Unfreeze and update 3d_armor (split modpack)
  • Loading branch information
dacmot authored Nov 21, 2023
2 parents 1870ab8 + 8d7ead7 commit 35525a7
Show file tree
Hide file tree
Showing 323 changed files with 2,812 additions and 2,090 deletions.
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 336 files
2 changes: 1 addition & 1 deletion mod_sources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,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)
* 9a687fbb5145f564a462deb4da226ae72f28151c Remove individual mod LICENSE.txt (#122)
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
26 changes: 0 additions & 26 deletions mods/player/3d_armor/LICENSE.txt

This file was deleted.

9 changes: 2 additions & 7 deletions mods/player/3d_armor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
|-[Armor Configuration](#armor-configuration) |||- - [3d_Armor Item Storage](#3d_armor-item-storage)
|- - [disable_specific_materials](#to-disable-individual-armor-materials) |||- - [Armor Registration](#armor-registration)
|- - [armor_init_delay](#initialization-glitches-when-a-player-first-joins) |||- - [Registering Armor Groups](#registering-armor-groups)
|- - [armor_init_times](#number-of-initialization-attempts) |||- - [Groups used by 3d_Armor](#groups-used-by-3d_armor)
|- - [wieldview_update_time](#how-often-player-wield-items-are-updated) |||- - [Groups used by 3d_Armor](#groups-used-by-3d_armor)
|- - [armor_bones_delay](#armor-not-in-bones-due-to-server-lag) |||- - - [Elements](#elements)
|- - [armor_update_time](#how-often-player-armor-items-are-updated) |||- - - [Attributes](#attributes)
|- - [armor_drop](#drop-armor-when-a-player-dies) |||- - - [Physics](#physics)
Expand All @@ -19,7 +19,7 @@
|- - [armor_fire_protect](#enable-fire-protection) |||- - - [armor:remove_all](#armor-remove_all)
|- - [armor_punch_damage](#enable-punch-damage-effects) |||- - - [armor:equip](#armor-equip)
|- - [armor_migrate_old_inventory](#migration-of-old-armor-inventories) |||- - - [armor:unequip](#armor-unequip)
|- - [wieldview_update_time](#how-often-player-wield-items-are-updated) |||- - - [armor:update_skin](#armor-update_skin)
| |||- - - [armor:update_skin](#armor-update_skin)
|-[Credits](#credits) |||- - [Callbacks](#Callbacks)
| |||- - - [Item callbacks](#item-callbacks)
| |||- - - [Global callbacks](#global-callbacks)
Expand Down Expand Up @@ -60,11 +60,6 @@ Change the following default settings by going to Main Menu>>Settings(Tab)>>All

armor_init_delay = 2

### Number of initialization attempts
**Increase to prevent glitches - Use in conjunction with armor_init_delay if initialization problems persist.**

armor_init_times = 10

### Armor not in bones due to server lag
**Increase to help resolve**

Expand Down
20 changes: 15 additions & 5 deletions mods/player/3d_armor/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ armor = {

armor.config = {
init_delay = 2,
init_times = 10,
bones_delay = 1,
update_time = 1,
drop = minetest.get_modpath("bones") ~= nil,
Expand Down Expand Up @@ -491,10 +490,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 +630,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 +683,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 @@ -799,9 +808,6 @@ end
-- @tparam[opt] bool listring Use `listring` formspec element (default: `false`).
-- @treturn string Formspec formatted string.
armor.get_armor_formspec = function(self, name, listring)
if armor.def[name].init_time == 0 then
return "label[0,0;Armor not initialized!]"
end
local formspec = armor.formspec..
"list[detached:"..name.."_armor;armor;0,0.5;2,3;]"
if listring == true then
Expand Down Expand Up @@ -930,6 +936,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
4 changes: 0 additions & 4 deletions mods/player/3d_armor/armor.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ ARMOR_FIRE_NODES = {
-- Increase this if you get initialization glitches when a player first joins.
ARMOR_INIT_DELAY = 1

-- Number of initialization attempts.
-- Use in conjunction with ARMOR_INIT_DELAY if initialization problems persist.
ARMOR_INIT_TIMES = 1

-- Increase this if armor is not getting into bones due to server lag.
ARMOR_BONES_DELAY = 1

Expand Down
Loading

0 comments on commit 35525a7

Please sign in to comment.