1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2025-06-28 22:36:39 +02:00

408 Commits

Author SHA1 Message Date
fed2087238 add nil check in armor.damage 2023-08-04 07:28:58 +02:00
dfa19cce98 Fix LDoc URL 2023-07-14 08:27:36 +02:00
1d8509e75b Implements item groups soulbound and cursed (#105)
* Implements item groups soulbound and cursed:
Soulbound armors respawn with their owner.
Cursed armors cannot be unequipped by the player.
(disabled in creative mode)

* Prevents a cursed armor from getting unequipped by right clicking another piece of armor.
2023-05-31 14:59:20 +02:00
053c30b8b1 don't trigger armor:punch when max_hp decreases 2023-04-20 07:36:24 +02:00
dc7fbce09a Change Fire Protection Function (#100)
* Tweak Fire Protect

This change tweaks the fire protection function so that it no longer needs to override nodes and hence rely on additional dependencies like ethereal mod.

* Remove ethereal and fire dependencies

Remove fire and ethereal dependencies as they are no longer needed since fire protection doesn't override items inside those mods.

* Re-add Torch Damage

This re-adds torch damage of 1 per second if fire protection is enabled.

* Remove nether dependency

Nether dependency isn't required as well.
2023-02-05 17:44:17 +01:00
72970b3da1 add animations for use w/ the emote mod (#98) 2023-01-14 21:44:41 +01:00
52f0e6a0ed Update LICENSE.md
fixes #93
2023-01-12 15:32:21 +01:00
400745dd0c Swedish translation (+refresh translations and remove outdated meta) (#97)
* Refresh translations
* Add Swedish translations
* Remove outdated depends.txt and description.txt
2022-12-25 18:23:49 +01:00
68d724176e Update README.md (#94)
Update reflects on:
- outdated modpack version deleted as redundant
- MT 5+ version
- the specific "armors as modpack" refactorization

The latter was a little caveat for me as MT server admin as I was not aware of this major change in the modpack design. After an update no armor was available to anybody as all new mods get disabled (entry set to false) by default.
2022-12-19 08:45:53 +01:00
2ef66d3132 typo correct (#92)
and avoid polution of MT ContentDB with fake mod "etherial" instead of "ethereal"
2022-12-17 11:51:25 +01:00
e75c0bedcc remove pointless dependency on bakedclay (#90) 2022-12-10 19:45:21 +01:00
92d036c5a7 remove reference to smartshop image (#88) 2022-11-26 21:38:10 +01:00
7f20e5dcb7 add fake player check (#86) 2022-11-20 16:44:50 +01:00
04b45deec8 Add and fix Brazillian Portuguese translation (#85) 2022-11-16 20:10:09 +01:00
bfa3a2b6d1 more exhaustive attempt to display a wielded item w/ wieldview (#84)
* more exhaustive attempt to display a wielded item w/ wieldview
2022-11-13 20:55:31 +01:00
41301a4663 Added Esperanto translation
used the update translation script to determine which strings are still used
2022-11-04 07:44:47 +01:00
eebee34fa0 Preserve fall_damage_add_percent when setting player armor (#81) 2022-09-07 22:01:18 +02:00
c7ee559a4c Update LDoc helper scripts for separating armor into mods (#80) 2022-09-07 21:58:12 +02:00
9444afd722 Refactor armors to be mods rather than hardcoded into API (#78)
* Begin work on "armors as modpack" refactor letting anyone to enable/disable any armors they want as mods rather than obscure settings

* Fix some steel armor mishaps, remove pointless dependency on "default"

* Move admin armor into mod

* Make wood armor into a mod

* More consistent steel description text etc.

* remove wood references from 3d_armor api locale

* remove admin armor reference from 3d_armor locale template.txt

* Remove steel textures from api

* Bronze armor as mod

* Fix admin, wood armor missing local S translator var
Fix wood locale missing template.txt

* Fix bronze missing locale

* Cactus as mod

* Crystal into mod

* Diamond into mod

* Mithril and Gold as mods

* Register armor fix

* Nether as mod

* Clean-up, add optional depends for mod armors, remove armor.lua from 3d_armor

* Fix badly named mod.conf for admin, gold, nether armors
Fix attempt to register crafting recipe even though the armor is disabled via setting

* Fix steel and wood having bad globals for crafting section, turned them to locals

* Fix brazilian translation getting deleted
Fix cactus armor locales being incorrectly named
2022-09-06 21:06:27 +02:00
e1a262ba20 add feather falling (#73)
* add feather falling

add feather falling

* add feather falling to init.lua

add feather falling routine to globalstep

* add feather falling to readme

add feather falling to readme
2022-04-02 17:16:23 +02:00
ac445a6cd0 use player_api to register player model 2022-03-25 23:23:25 +01:00
a9b8bc4ddd Enhance mithril armor (#70)
* Enhance mithril armor

Mithril armor should be (at least) tougher than diamond armor. Mithril is found rarer and deeper than diamond and mithril tools are already better than diamond tools.

* Enhance mithril shield

Mithril armor should be (at least) tougher than diamond armor. Mithril is found rarer and deeper than diamond and mithril tools are already better than diamond tools.

* Correct armor_use

Now this enhance the durability by a factor 3 (instead of a factor 2) compared to diamond. Which can be justified by the ore generation update in moreores (deeper and rarer (but less scattered)).

* Correct armor_use

Now this enhance the durability by a factor 3 (instead of a factor 2) compared to diamond. Which can be justified by the ore generation update in moreores (deeper and rarer (but less scattered)).

* correct typo
2022-02-05 13:33:41 +01:00
b6651fd396 add fire protection to nether armor (#67)
* add fire protection to nether armor
* add fire protection to nether shield
2021-11-13 11:00:49 +01:00
16e2648416 fix nether package typo
reported in https://github.com/minetest-mods/3d_armor/issues/66
2021-11-11 09:42:10 +01:00
44778d7861 add nether armor and nether shield (#65)
* add texture files for nether based 3d_armor
* add texture files for nether based shield
* perpare for nether armor
* add nether armor
* add translation for nether armor
* add translation for nether armor
* add nether shield
* add nether shield translation
* add nether armor texture preview info
* add nether shield texture preview info
* add nether to settingtypes.txt
* add german translation for armor
* add german translation for shields
* Nether armor stats modified.
* Modify Nether Shield Stats

* Update inline documentation
2021-11-10 10:15:55 +01:00
8dcbc42525 LDoc: link to favicon (#62) 2021-08-01 14:41:16 +02:00
c0f303abc1 remove name attribute from modpack.conf
contentdb validation fails otherwise
2021-07-31 15:29:28 +02:00
46c599333e Exclude some files & directories from archives & releases (#61) 2021-07-31 14:03:33 +02:00
da78601a77 Some Fixes for HTML Docs Generated by LDoc (#60)
* LDoc: set min-height for "content" element
* LDoc: move generation script to .ldoc directory
* LDoc: add some output messages to gendoc.sh script
* LDoc: copy inventory image textures to reference dir instead of linking to remote files.
* LDoc: hack to compensate for "shields:" prefix being trimmed from item names
* Fix helmet_diamond & chestplate_crystal names in docstrings
2021-07-31 14:03:20 +02:00
c790b20169 Add Support for Generating HTML Documentation with LDoc (#58)
* Add Python scripts to generate temp files that can be parsed by LDoc
* Add config & script for generating HTML docs with LDoc...
* Add Lua docstrings for API & items
* Add workflow for building API reference docs on gh-pages branch
* Add LDoc's default stylesheet
* LDoc: make navigation panel fixed
2021-07-30 16:12:29 +02:00
a897f7e72f fix callbacks not being called by armor.equip() and armor.unequip() (#59) 2021-07-30 16:02:59 +02:00
ac7615212b Reduce skin_mod visibility (#53) 2021-07-13 20:50:22 +02:00
38fc2cff2b Fix typo in wieldview (#56)
* Fix typo in wieldview
fixes #55
2021-06-26 20:21:15 +02:00
1dec1f2153 Add armor.set_skin_mod() to set the skin mod name manually (#51)
Useful for skin mod forks that do not use the same name.
2021-06-23 17:28:29 +02:00
0dffd62fb0 add nether lava to fire protection (#52)
adds nether lava and lava crust to fire protection list.
2021-06-14 11:56:05 +02:00
a0cf12bbd0 Add setting to disable armor visuals on player model (#48)
* Add setting to disable armor visuals on player model
2021-05-27 09:11:04 +02:00
371285a903 adjust fire protection label position
fixes #50
2021-05-24 09:59:54 +02:00
f07f0507e2 Silence warnings when ui is not enabled 2021-04-15 19:03:21 +02:00
e75af55f7e Fix translation nonsense in minetest.log
.. and document the armor warning when used with skinsdb
2021-03-24 19:21:39 +01:00
583dfe7b21 Update to work with Unified Inventory since formspec v4 update (#45)
Requires UI git tag "version-2" or commit a7556c50, and Minetest v5.4.0
or later
2021-03-10 09:21:26 +01:00
44111db4d7 Add use_texture_alpha to avoid warnings from 3d_armor_stand (#44)
Co-authored-by: sys4 <bricassa@sys4.fr>
2021-03-06 17:36:02 +01:00
31aa979215 3darmor sfinv spanish translation 2021-03-01 17:31:50 +01:00
42f7dac4d0 Update fire and water protection (#42)
Update fire protection to use register_on_player_hpchange instead of overriding node damage, move water protection into different globalstep.
2021-02-07 09:47:23 +01:00
e7abacc94e Add armor set and armor set bonus setting (#41)
- Add settingtypes of:
  -  armor_set_elements
  - armor_set_multiplier
- Add check to armor.registration_armor for "_materialname", print msg to debug if not found
- Complete change to how an armor set is calculated
- Set elements linked to settingtypes no longer hard linked to num armor.elements
- Set multiplier linked to settingtypes no longer hard coded
- Readme.MD updated:
  - Addition of the 2 new settingtypes
  - Addition of "Armor Material" topic
2021-01-11 15:34:28 +01:00
a3cba570c4 locale es fix 2020-12-27 17:17:10 +01:00
3ddcbae968 Fix for #34 - Divide Armor Wear by # Pieces
See Details contained in #34

Note1: I split out the fix for Issue 13 and it had been applied
Note2: I will also do a seperate pull request for Issue 30

From what I udnerstand smaller specific pull requests allow for reversion of specific additions and features much more easily. Please do correct me if I have the wrong end of the stick on this.
2020-12-26 20:25:55 +01:00
5642819ba5 fix for #30
2 line update so that shields when used no longer affects the base armor.config.level_multiplier and hard sets this to 0.9 and overriding whatever value maybe set under the UI for this seeting.

Tested in combination with #34 but no issues detected
2020-12-26 20:24:30 +01:00
724a3df50f call "set_player_armor" on respawn 2020-12-23 15:40:44 +01:00
33e9ac8e23 Minor improvement to fix #13
Picked up while testing  #34 and #30 that this needed to be adjusted from hitter name to hitter is player.

Hitter name was resolving to true even when mob was attacking...nil being counted as a value.

I should have picked this up before and not sure how I missed this.
2020-12-23 15:31:51 +01:00
06aaaf4bca whitespace removal 2020-12-20 21:26:33 +01:00
d515480370 fix for #13
Tested PVP inside and outside protected - passed as expected

Tested PvsM inside and outside protected - passed as expected
2020-12-20 21:26:33 +01:00
6242cebb20 Added moreores to optional dependencies 2020-12-17 09:06:00 +01:00
291f0eb23a Torch Damage Switchable (#29)
Turn torch fire damage off if fire damage/protection enabled
Minor fixes to README.MD after further testing.
2020-12-13 13:07:39 +01:00
3b97763fdc temporary workaround for #24 2020-12-11 10:23:05 +01:00
713b0c81d4 Documentation and Screenshot Update (#26)
* New screenshot
* Examples Added
* formatting
* Delete README.txt
* formatting
* Update README.md
2020-12-03 08:38:41 +01:00
cbd1a1246b Update README.md (#25)
Update documentation #10
2020-11-30 07:44:32 +01:00
5958b312ac Fix detached inventory vulnerability (#23) 2020-11-03 22:22:14 +01:00
7436fcdffe Improve API for third party mods (#21)
* Add `armor:update_skin(player_name)` function (useful for skin mods)
* Add option to prevent physics override (useful for Techage Jetpack mod)
* Add documentation
2020-10-12 07:47:57 +02:00
3f1a952afb Fix not being able to place armor on anvil (#19)
* fix not being able to place armor on anvil
* check for node on_rightclick on armor equip
2020-10-01 20:09:31 +02:00
7f63df230c fix armor equip/unequip (#17) 2020-09-24 14:08:17 +02:00
294338d3b0 Added the possibility to wear the armor on rightclick (#16)
* Added the possibility to wear the armor on rightclick
* Added equip, unequip and get_weared_armor_elements functions

Co-authored-by: Giov4 <brancacciogiovanni1@gmail.com>
2020-09-22 07:45:39 +02:00
9459400474 Italian translation corrections + armor:remove_all (#15)
* Added armor:remove_all function
* Corrected README.txt
* Corrected italian translation
* Simplified Italian translation further
* CRUSHFIX: Replaced self.function with self:function

Co-authored-by: Giov4 <brancacciogiovanni1@gmail.com>
2020-09-19 13:30:39 +02:00
2d9b0066bf Added the possibility to hide wielded items in-game (#14)
* Added the possibility to hide wielded items in-game
* Update wieldview/README.txt

Co-authored-by: David Leal <halfpacho@gmail.com>
2020-09-15 06:43:55 +02:00
502eb142da run actions on pull-requests too 2020-08-31 07:43:19 +02:00
7fc9966945 Move armor.get_translator to API 2020-08-31 07:41:59 +02:00
4dc9a81ec2 Change intllib for v5 minetest.get_translator 2020-08-31 07:41:59 +02:00
979516c13d Update French translation 2020-08-31 07:41:59 +02:00
ec5de28dc2 Update translations to MT v5 format
using the script https://github.com/minetest-tools/update_translations
2020-08-31 07:41:59 +02:00
0af7280e64 Update translations to MT v5 format
using the script https://github.com/minetest-tools/update_translations
2020-08-31 07:41:59 +02:00
073206701a update integration test to minetest 5.2.0 2020-05-14 21:37:09 +02:00
b4eebf604e fix ci badge urls 2020-05-01 16:33:46 +02:00
0da0088889 Merge branch 'master' of https://github.com/Panquesito7/minetest-3d_armor 2020-05-01 16:30:35 +02:00
dbc6ccf089 Add missing fuel recipes for wood and cactus armor.
Fixes https://github.com/stujones11/minetest-3d_armor/issues/174
2020-04-30 08:18:29 +02:00
acd8b2647d Don't damage armor when drowning, eating or starving. 2020-04-30 08:15:37 +02:00
a6b89e7929 Fix count when armor is destroyed. 2020-04-29 11:10:11 +02:00
c3a755518e Silence png warnings.
Closes https://github.com/mt-mods/3d_armor/pull/1
2020-04-09 07:22:39 +02:00
4c99049600 Merge pull request #2 from mt-mods/code-quality
add luacheck and integration test workflows / fix luacheck errors
2020-02-17 17:36:52 +01:00
f81cb10f20 add luacheck and integration test workflows / fix luacheck errors
partially attends to https://github.com/pandorabox-io/pandorabox.io/issues/444 (the ObjectRef issue)
2020-02-13 12:26:32 +01:00
f3ad7ec6f1 add armor breakage alerts
something I've wanted for a while...
2019-12-28 23:13:41 +11:00
fccd4d8b15 Merge branch 'preserve_immortal' of https://github.com/SmallJoker/minetest-3d_armor
PR: https://github.com/stujones11/minetest-3d_armor/pull/170
2019-12-17 14:36:05 +01:00
e5b2cf3a34 new armor and shield textures 2019-12-15 19:03:25 +01:00
d2608351f6 extend bone search radius
hopefully fixes https://github.com/pandorabox-io/pandorabox.io/issues/364
2019-12-09 11:04:11 +01:00
a05eae3782 Preserve immortal group for per-player damage 2019-10-07 20:12:58 +02:00
2ac90f8d19 drop invalid item instead of erase it 2019-07-16 09:40:28 +07:00
4adc602704 Update api.lua 2019-06-17 13:03:27 -05:00
e248752ee4 Use newer functions from MT/MTG 5.0.0+
These commits create more compatibility with MT/MTG 5.0.0+.
However, these commits (may) break compatibility with the 0.4-series.
2019-06-16 15:17:21 -05:00
47ecef46f7 Update licenses 2019-05-27 20:30:03 +01:00
1d22612664 Bump version to 0.4.13 2019-03-05 20:01:01 +00:00
3fe7dd2249 Replace deprecated getpos call 2019-03-05 19:40:54 +00:00
be9579a365 Offset models for minetest 5.0.0 2019-03-05 19:30:38 +00:00
18320e96b9 Replace braces within replace to avoid invalid line error 2019-03-05 19:27:37 +00:00
99471d3aa0 Create settingtypes.txt file 2019-03-05 19:27:37 +00:00
b6283f3f0f Fix some default settings values in README 2019-03-05 19:27:37 +00:00
7e2d9426d1 fix formatting 2019-01-20 23:21:05 +00:00
813a88f3a1 Fixes Stand appending extra ".png" to texture when a "texture" attribute
is explicity set on the armor's definition.
2019-01-20 23:21:05 +00:00
4c032e8c7e Add Portuguese Translations 2018-11-09 17:50:10 +00:00
945e816b55 Locale es.po created 2018-10-23 18:02:46 +01:00
10ded06705 Create es.po 2018-10-23 18:02:46 +01:00
43a69ad853 Locale es.po created 2018-10-23 18:02:46 +01:00
13a8f0d019 Add new textures 2018-10-19 20:37:48 +01:00
70325158e6 Reverts 9ce0ed9f55 / #152
The preview method is skin preview only, without armor. That is wrong for showing on formspec

Sorry for inconveniences. I need to fix the preview handling in player_api_modpack-version in an other way
2018-08-24 18:58:32 +01:00
c96ba7ef34 Cleanup locales (#155)
* use localization function in formspecs

* remove unused translations

* remove F keyword from updatepo tool

* add tool readme
2018-07-26 20:05:50 +01:00
838867a6bc add russian locale 2018-07-22 20:53:38 +01:00
9ce0ed9f55 Use preview method for unified inventory
I found this during porting the 3d_armor to player_api ;-)
2018-07-22 20:51:07 +01:00
c0d45ceaa1 show fire: value
this fixes the Fire: value in formspec so it shows a number instead of "Fire: armor_fire".
2018-06-18 20:21:58 +01:00
656bcf30bc Bump version to 0.4.12 2018-06-10 19:39:38 +01:00
579e64a5e7 Code tidy 2018-06-02 22:13:41 +01:00
6f99803d2d Return invalid items in singleplayer mode 2018-06-02 20:46:44 +01:00
f960fc1a41 Only validate armor inventory after user changes 2018-06-02 18:59:32 +01:00
af4a381433 Update screenshot image 2018-05-24 19:25:34 +01:00
1f11a28ad4 More armor callback fixes 2018-05-24 19:06:27 +01:00
a5ddc3e60a Move comment :) 2018-05-23 21:40:06 +01:00
83f3e01efa Run callbacks based on validated inventory 2018-05-23 20:15:09 +01:00
7d30bc25a3 Allow replacing similar armor in the same slot 2018-05-22 18:40:24 +01:00
e4b12558d4 Ammendment to 21b5c68505 2018-05-19 21:35:15 +01:00
21b5c68505 Validate and clean armor inventory before saving 2018-05-19 20:25:27 +01:00
21716ffd31 Display correct heal attribute level, fixes #137 2018-05-13 16:52:29 +01:00
cc6fff2b04 Shields: Fix positional sound effects 2018-05-13 16:31:51 +01:00
4210cafff3 add POVA support (#138)
* add POVA support

Add support for POVA player overrides.

* add POVA support

Add support for POVA player overrides.
2018-05-07 14:41:40 +01:00
579d245a00 Fix crash with UI but no technic 2018-02-23 18:00:43 +00:00
c812e0ac56 Shields: Add option to disable sound effects 2018-02-18 20:35:49 +00:00
4baed2ca22 Remove on_punch effects from admin armor, closes #131 2018-02-18 20:24:35 +00:00
b9c8681e14 Bump version to 0.4.11 2018-02-11 17:13:25 +00:00
2fc92880fd Move technic_armor and hazmat_suit to separate repos 2018-02-11 17:11:51 +00:00
b4cfdac6f5 Update licenses to current year 2018-02-11 16:57:27 +00:00
59b26b37f9 Fix item duplication vulnerability 2018-02-11 16:12:22 +00:00
7226dd6174 Add Malay translation 2018-02-07 17:39:38 +00:00
4fc51971d1 Fix registered group level display 2018-01-10 19:16:23 +00:00
291b34bfc6 Auto-refresh armor stands after clearobjects.
Currently armor stands appear empty after a clearobjects, in order to refresh them the armor must be removed and put back on again, this code automatically refreshes armor stands periodically to avoid these issues.
2017-12-05 18:28:27 +00:00
da7df11ce4 Change armor stand recipe to use any item from the fence group. 2017-11-10 17:41:59 +00:00
4ff61da39a Correct minetest version in README.md 2017-10-24 20:53:06 +01:00
688e21f285 Bump version to 0.4.10 2017-10-21 17:57:12 +01:00
ea70066d7a Add link to general mod install info, closes #117 2017-10-20 21:19:22 +01:00
d5896a04e2 Check that player inventory returns a valid table 2017-10-20 20:17:37 +01:00
d979815a49 Fix libpng sRGB profile warnings 2017-10-20 19:38:22 +01:00
cca523f193 Italian locale 2017-08-18 13:21:30 +01:00
ae448c150c added complete intllib support (i18n)
added french translation
2017-08-08 18:09:27 +01:00
925b39f577 added tooltip on unified_inventory button 2017-08-08 18:09:27 +01:00
0454d72c72 Ensure valid inventory table when setting armor 2017-08-01 19:03:17 +01:00
9fa95b2e2c Run update callbacks when player visuals change, closes #113 2017-08-01 18:48:06 +01:00
43c9984d57 Do not drop armor in uloaded areas 2017-08-01 18:42:04 +01:00
cc26d04345 Replace deprecated function 'intllib.Getter':
- Check first for 'intllib.make_gettext_pair', otherwise continue using
function 'intllib.Getter'.
2017-07-09 14:29:11 +01:00
38d79b91a1 Replace deprecated methods:
- 'setting_get' with 'settings:get'
- 'setting_getbool' with 'settings:get_bool'
- 'setting_set' with 'settings:set'
2017-06-21 17:48:18 +01:00
db8fb5ebd4 bugfix and small optimization 2017-06-21 17:47:24 +01:00
2150fcea8d return the png suffix in get_player_skin for complete texture definition to support more complex textures
Note the armor.get_player_skin() could be redefined in other mods to privide the more complex textures
2017-06-21 17:47:24 +01:00
9577fb773e Ignore Eclipse project files & directories 2017-05-14 19:29:08 +01:00
ea29ec6f6f Register armor after mod compat tests, fixes #106 2017-05-10 20:33:49 +01:00
793c74856f Fix nil index in on_damage callback 2017-05-03 17:56:32 +01:00
47734969e2 Bump version to 0.4.9 2017-04-28 19:06:38 +01:00
1af0bb60f8 Rename on_punch callback to avoid potential conflict with nodes 2017-04-21 18:33:30 +01:00
a11b3302e1 Move armor initialization back out of the api 2017-04-19 21:53:13 +01:00
664d9fbfef Increase fleshy level of wood and cactus leggings 2017-04-19 19:42:12 +01:00
4dd7e41749 Add damage method and update README.txt 2017-04-19 19:00:00 +01:00
df429ee487 Run inventory equip callbacks before set_player_armor 2017-04-16 19:34:09 +01:00
7566ecccee Initialize armor after all on_joinplayer callbacks have run 2017-04-16 16:52:49 +01:00
99bc8cf2d3 Reverse order of stack and index in callbacks for consistency 2017-04-15 20:44:05 +01:00
a2ec13e28d Only allow armor items in the armor inventory 2017-04-15 18:00:10 +01:00
065815eec1 Include stack index it armor item callbacks 2017-04-15 17:54:39 +01:00
16b0ee2d9e Register adminshield alias for consistency 2017-04-14 20:19:38 +01:00
64f8b3cd58 Fix OOM crash with admin shield 2017-04-14 17:08:08 +01:00
74ef6c5759 Shields: check valid hitter 2017-04-13 21:29:57 +01:00
b741b7426b More player validity checks 2017-04-13 20:34:55 +01:00
db312b3245 Code styling 2017-04-13 20:11:15 +01:00
de2c47f334 More protection from un-initialized player crashes 2017-04-13 19:47:43 +01:00
b4283f6e60 Fix string concatenation in UI form, resolves #104 2017-04-13 17:21:16 +01:00
888fbacb49 Prevent potentially bogus warning 2017-04-11 21:26:06 +01:00
50453aa5a6 Fix warnings 2017-04-11 20:55:28 +01:00
b45fbd0f2a Log warning if initialization fails and validate armor.def for UI 2017-04-11 20:42:58 +01:00
9ffcc19fd7 Improve player initialization and increase default delay 2017-04-11 19:34:06 +01:00
6359b0a0ed bugfix: the count was lost 2017-04-10 18:24:27 +01:00
4dbe76312b Hazmat suit: updates and fixes 2017-04-09 20:43:55 +01:00
20edce6c55 Better balance of armor weights 2017-04-09 18:49:44 +01:00
6e58d1280b Add minor physics penalties to metal armors 2017-04-09 18:37:55 +01:00
20d4728829 Only reciprocate damage of valid tool items 2017-04-09 18:07:53 +01:00
7cfd744ff3 Respect flammable group when fire is protection enabled 2017-04-09 17:34:22 +01:00
a76a35f177 Fix regression with heal_multiplier config 2017-04-09 16:25:52 +01:00
e5e926a02e Use metal sounds for enhanced shields 2017-04-09 15:43:35 +01:00
3951c833da More documentation ammendments 2017-04-09 15:00:48 +01:00
e9a2c57826 Correction to example code 2017-04-08 22:32:46 +01:00
5508a26dbf Bugfix: shields crash with nil method, fixes #102 2017-04-08 22:28:52 +01:00
0ec7858937 Add punch damage groups and effects 2017-04-08 21:32:56 +01:00
1e059f2557 Bugfix: recognise boolean false in configuration 2017-04-05 17:51:50 +01:00
5dab1ca887 Add intllib support to 3d_armor_stand 2017-03-31 22:09:32 +01:00
1fdff7adaa Make water protection optional, default true
This can save a `global_step` regisration if neither fire or water
protection are enabled.
2017-03-31 22:03:59 +01:00
23e4d5114f Add support for intllib 2017-03-31 20:12:20 +01:00
7fde7c050d Update wieldview README about dependencies 2017-03-31 17:42:22 +01:00
45099ae25a Mod-defined wield item transformation w/ group 2017-03-31 17:42:22 +01:00
edebf13c1f Remove unneeded default dependency from wieldview 2017-03-31 17:42:22 +01:00
4083782246 Improve get_armor_formspec 2017-03-29 19:31:00 +01:00
5911447048 Move shields level reduction to shields mod 2017-03-29 19:13:13 +01:00
3aac5c98f4 Fix movement and level bugs 2017-03-29 17:44:40 +01:00
fe9664589a Fix potential missing texture bug 2017-03-26 22:46:51 +01:00
11ce84873b Add support for non-fleshy damage groups, closes #47 2017-03-26 20:53:04 +01:00
86fd6b0d7d Fix crash caused by 27a3823eed 2017-03-23 00:59:21 +00:00
27a3823eed Improve error logging, reduce log level to warning 2017-03-22 19:00:48 +00:00
348dad3d4d Log warning of unused mods when dependencies are missing 2017-03-21 15:16:58 +00:00
ea86aa35f5 Merge branch 'bell07-pr_compat_cleanup' 2017-03-21 14:54:03 +00:00
f0edb9a710 Inventory compat cleanup
fix inventory_plus after cleanup. Create own register_on_player_receive_fields for this inventory

removed smart_inventory (moved to the inventoy mod), adjusted sfinv

moved sfinv to own mod 3d_armor_sfinv

moved unified_inventory to 3d_armor_ui

moved inventory_plus support to own mod 3d_armor_ip
2017-03-21 14:50:17 +00:00
75191490c2 Use api call to get player skin 2017-03-19 18:52:51 +00:00
f91af02c45 Fix inventory paging bugs caused by previous commit 2017-03-19 18:06:54 +00:00
3843578a33 Remove unnecessary code 2017-03-19 17:22:24 +00:00
1570efb7ac Depreciate update_inventory and use on_update callback 2017-03-19 16:10:52 +00:00
5517be8ff2 Replace missed global config, fixes #94 2017-03-19 13:28:55 +00:00
709535dff0 Only apply valid wardrobe mod skins, fixes #93 2017-03-18 22:14:08 +00:00
a1d904c517 Remove redundant code 2017-03-18 22:02:11 +00:00
3c2cb16351 Correction to documentation 2017-03-18 20:39:03 +00:00
6bf28dc2c5 Only allow one of each armor element in armor slots
Required, otherwise equip callbacks may be bogus.
2017-03-18 20:32:11 +00:00
75a7181e0f Add callbacks, closes #46 2017-03-18 20:12:43 +00:00
2b840fbe38 Add comment and remove empty lines 2017-03-18 18:04:10 +00:00
701215c22f Depreciate global configs, closes #68 2017-03-18 17:23:50 +00:00
e46ff3488b Remove kill/me commands 2017-03-17 21:57:13 +00:00
f74a52df62 Code re-organisation
This should make it easier to merge features from the now
out-dated development branch.
2017-03-17 20:26:41 +00:00
3c4500a9bf Only show protection levels of enabled features 2017-03-17 18:27:19 +00:00
e69b59e2af Fix alignment of formspec page slots 2017-03-15 19:31:48 +00:00
d43d96bb28 Fix typo in cactus helmet description, closes #91 2017-03-15 18:58:27 +00:00
7a980a6717 Fix missing sfinv page background images, closes #90 2017-03-12 20:34:54 +00:00
fc3fcea4b7 Bump version to 0.4.8 2017-03-12 19:14:32 +00:00
b59464de88 Improve skin mod preview support 2017-03-12 18:23:49 +00:00
80024fc154 Fix security violation in player_textures mod support 2017-03-12 17:01:04 +00:00
d826b53877 Use u_skins preview image as base for armor preview 2017-03-11 21:34:26 +00:00
01a3425ec8 Add preview generator and update preview textures 2017-03-11 20:02:55 +00:00
616d9398f2 Minor formspec improvements 2017-03-11 19:31:37 +00:00
6661ec0b40 Add support for player monoids, resolves #85 2017-03-10 20:33:45 +00:00
ca1cf6bfeb Fix inconsistency with cactus boots, closes #89 2017-03-10 18:09:28 +00:00
8f5ffeb384 Shields: Remove registration delay, closes #88 2017-03-10 18:05:16 +00:00
ca79d39688 Armor stand: Improve TNT effects, closes #55 2017-03-08 19:36:30 +00:00
8b8a554ff7 Add support for sfinv 2017-03-08 17:47:38 +00:00
3df7802439 added new torch fire nodes
added new torch nodes to the fire nodes list.
2017-03-08 17:44:49 +00:00
19e297a2e8 Update inventory_plus formspec style 2017-03-03 17:59:31 +00:00
190614d47b Fix potential bug with new bone location method 2017-02-24 23:00:03 +00:00
37b10d1cee Remove redundant code 2017-02-24 22:45:23 +00:00
4b45f85687 Improve bones locating and fallback, fixes #84 2017-02-24 22:32:27 +00:00
a5b650285b beter smart_inventory integration 2017-02-21 19:07:17 +00:00
26212fb3e4 Add new armor textures by @daviddoesminetest 2017-02-19 19:33:10 +00:00
4829445d12 Update style of default armor formspec 2017-02-15 19:37:35 +00:00
4d3b219e7d add smart_inventory support 2017-02-15 19:06:06 +00:00
81ffdaa6a7 Improve armor stand selection box 2017-02-15 18:25:49 +00:00
ba62febdee Armor stand, check protection and ignore, ignore 2017-02-08 20:57:42 +00:00
8939a0dd43 Armor stand hidden nodes use copy of pos vector 2017-02-08 19:32:42 +00:00
c691f3e219 Prevent building over armor stands 2017-02-08 18:26:15 +00:00
bf9ba59c0f Merge branch 'tobyplowy-master' 2017-01-25 19:49:52 +00:00
75f808131c New armorstand mapping 2017-01-25 19:48:25 +00:00
b88f946929 Bump version to 0.4.7 2017-01-11 19:36:51 +00:00
c63376b523 Improve hazmat-suit documentation, closes #72 2017-01-11 19:28:17 +00:00
c070dfb19f Include years of all licenses 2017-01-11 19:15:06 +00:00
4b70580ce4 Update licensing information 2017-01-08 18:54:24 +00:00
65b6d58580 Prevent armor damage when using /killme command 2016-12-07 19:24:00 +00:00
98786fd8f7 Add killme command to replace old kill command 2016-11-27 17:18:08 +00:00
9105e8403e Merge pull request #62 from paly2/kill_chatcommand_privs
Add "ban" privilege for kill chatcommand
2016-11-27 16:50:03 +00:00
6b2e3adc00 Bump version to 0.4.6 2016-11-27 16:22:29 +00:00
c9001f9e53 Rebase armor model, armature and UV fixes 2016-11-27 16:11:51 +00:00
cc25d6be13 Merge pull request #66 from diogo-gomes/develop
Add table of contents to README.md
2016-08-21 17:52:03 +01:00
f557c4d69e Add table of contents to README.md 2016-07-25 14:48:52 +01:00
456c84e93e Merge pull request #65 from everamzah/fixbones
Try harder to add armor to bones
2016-07-22 17:51:06 +01:00
0157ebd683 Try harder to add armor to bones
Previously, if bones were on a slab, or some non-buildable_to but walkable
node, then the armor would fail to find the bones node (which is Y+1,
typically) and the armor would disappear.  This is an attempt to address that.
2016-07-22 10:46:05 -04:00
c39f838893 Fix a mistake in the kill chatcommand
Use "param" instead of "name" in "func"
2016-06-17 18:29:43 +02:00
862deff373 Add "ban" privilege for kill chatcommand 2016-06-17 16:08:50 +02:00
ac414d3df3 Remove admin shield from creative inventory 2016-05-27 19:51:39 +01:00
3cf6887abd Fix undeclared global error in hazmat_suit 2016-05-18 19:42:37 +01:00
b14db3c43c Add missing placer param to locked armor stand, fixes #59 2016-05-11 22:19:13 +01:00
8f8c6c6bfa Merge pull request #56 from Thomas--S/patch-2
Fix typo
2016-05-11 19:46:48 +01:00
54ec4b3cef Fix typo 2016-05-11 19:25:59 +02:00
32e87ee543 More armor stand fixes 2016-05-04 18:27:21 +01:00
d322a0f110 Modify helmet textures, fixes #49 2016-05-01 20:25:46 +01:00
9cc2f3db02 Radiation protection support added 2016-05-01 17:09:07 +01:00
ddd7f3786c Fix disappearing armor stand entities, again... 2016-05-01 16:11:27 +01:00
5c5359de4f Restore armor stand entities when knocked-back by TNT 2016-04-27 18:48:06 +01:00
1aa2b769d7 Rebase armor player model, fixes #54 2016-04-24 21:13:45 +01:00
5421ce46da Make armor stands 'blast-proof', fixes #55 2016-04-22 18:53:25 +01:00
72cffbae17 Restore moved armor stand objects to original position when possible 2016-04-20 20:26:01 +01:00
170ee39aed Auto remove stray armor stand entities 2016-04-20 18:54:34 +01:00
59bbc55b73 Fix armor stand entity duplication bug 2016-04-16 15:36:48 +01:00
1dd904f5be Merge pull request #50 from Thomas--S/patch-1
Add a locked armor stand
2016-04-13 17:41:37 +01:00
9de8cc12bb Fix disappearing entities when placing stands next to each other 2016-04-10 22:17:45 +01:00
4e8cf05436 Add a locked armor stand
This change adds a locked armor stand, so that player can use them savely on multiplayer worlds.
2016-04-10 20:11:53 +02:00
b6a44057a6 Fix some tabulation 2016-04-09 01:19:32 +01:00
ae33659168 Make cactus leggings inventory image more consistent 2016-04-08 21:35:56 +01:00
fb29ce9150 Add a chest-like visible armor stand, closes #48 2016-04-08 20:17:28 +01:00
7408ebcd81 Add support for mod managers 2016-03-25 19:52:00 +00:00
36737441d4 Merge pull request #45 from tenplus1/patch-7
Added insta-kill ability for tools/commands
2016-02-14 19:49:09 +00:00
5a112547e6 Added insta-kill ability for tools/commands
Some armor was too powerful that killing yourself to respawn wouldn't work or instant kill tools for admin didn't have effect, so I've added a check so that if the player is dealt with more than -100 damage points it instantly kills them but doesn't damage armor.  Also added /kill command.
2016-02-08 19:05:32 +00:00
0d5cf6d58a Merge pull request #44 from proller/patch-1
Dont rewrite inventory in creative mode
2016-02-08 03:54:28 +08:00
f17a104ab1 Dont rewrite inventory in creative mode
happens on first press I if no unified inventory installed
2016-02-07 18:46:37 +03:00
f83e7e9984 Merge pull request #43 from tenplus1/patch-6
admin helmet lets you breathe underwater
2016-01-28 01:35:46 +08:00
be1d353ec0 Merge pull request #42 from tenplus1/patch-5
Add ability to breath underwater
2016-01-28 01:34:45 +08:00
241aa663f1 admin helmet lets you breathe underwater
added armor_water=1 group to admin helmet so players can breathe underwater.
2016-01-25 14:48:23 +00:00
921e1ace24 Add ability to breath underwater
Added functionality for armor to have armor_water=1 in groups so that player can breathe underwater.
2016-01-25 14:47:05 +00:00
0ec2dbfb36 Update default fire protection nodes, closes #41 2015-12-19 19:25:43 +00:00
7fc991765c Utilize player_on_hpchange callback 2015-12-09 21:03:45 +00:00
991d2955e0 Simplify previous commit 2015-12-04 20:37:24 +00:00
64ec3dcf93 Allow armor textures to be specified by the tool definition 2015-12-04 18:42:42 +00:00
e1caf0ab0c Bump version to 0.4.5 2015-11-15 22:56:53 +00:00
a44d1a2530 Add 'listring' support for inventory mods, closes #38 2015-11-15 21:50:27 +00:00
16bc6232ca Add support for unified inventory 'ui_full' privilege 2015-11-15 19:18:21 +00:00
6efe3bf116 Merge pull request #40 from CraigyDavi/prevent-admin-drops
Prevent admin armor from being dropped
2015-10-30 01:46:19 +08:00
67867e78ec Prevent admin armor from being dropped 2015-10-29 14:19:59 +00:00
64f6be4d61 Bugfix: invalid capture index with non-english player names, resolves #39 2015-10-17 19:20:28 +01:00
741faf3520 Fix support for crafting modpack 2015-09-09 19:07:31 +01:00
1c56ee4bd6 Merge pull request #31 from tenplus1/patch-2
dtime glitches
2015-08-08 18:05:02 +01:00
40a3c1e0c4 Include Technic Armor in README.md 2015-07-25 19:11:36 +01:00
ae7ad422a5 Belated version string update (oopsie) 2015-07-15 20:52:56 +01:00
bad1452e87 Register fire-node overrides at start-up 2015-07-15 19:00:16 +01:00
7cefc1a7ba dtime glitches
sometimes dtime isn't registering when armor.update_armor is called and so it never checks for fire resistance on armor meaning cactus is fireproof if ethereal mod is found...  we cant have that :)  replaced dtime with ARMOR_UPDATE_TIME and it works fine :)
2015-07-15 16:57:17 +01:00
8f2badeec3 Add support for unified inventory 'lite' mode 2015-07-01 19:21:14 +01:00
734e01e847 Only check for fire damage if valid delta time 2015-05-15 18:39:32 +01:00
4eabd8512a Only round the drop position for bones (deja vu) 2015-05-06 20:59:22 +01:00
14a0eb8cca Fix armor damage when using fire protection (my bad) 2015-05-06 20:06:07 +01:00
e1ffdd6a0d Add technic shields by poet.nohit 2015-05-06 19:03:40 +01:00
306f193db6 Stop dropped armor disappearing into ground
This stops dropped armor disappearing into ground at times...
2015-05-06 18:41:40 +01:00
6704431499 Bump version to 0.4.4 2015-05-04 19:24:34 +01:00
bc0ea6b5bf Add technic armor by poet.nohit 2015-05-04 18:42:46 +01:00
0fc71201b4 Add crystal armor and fire protection by TenPlus1 2015-05-04 17:08:40 +01:00
d107708bec Fix Lua escape sequence, resolves #28 2015-05-01 18:06:43 +01:00
bd2ebac24e Merge pull request #27 from indriApollo/master
add support for inventory_enhanced
2015-04-26 12:23:24 +01:00
ebe159ac2c add support for inventory_enhanced 2015-04-25 18:45:59 +02:00
1d1534b416 Merge pull request #25 from indriApollo/master
Add support for wardrobe mod
2015-04-25 15:53:35 +01:00
91602ed6f2 Add support for wardrobe mod 2015-04-25 14:28:45 +02:00
2b0ce6f63e Check node is not nil before indexing 2015-04-17 19:41:15 +01:00
3badcea0d9 Merge pull request #24 from Pilcrow182/master
drop armor if no bones node is found
2015-04-17 19:38:26 +01:00
d2f32beebb drop armor if no bones node is found 2015-04-16 21:57:07 -05:00
b3f755f7d7 Merge pull request #23 from Pilcrow182/master
Put aromr drops into a single loop, fix #22
2015-04-15 18:57:15 +01:00
dec92749f9 Put aromr drops into a single loop, fix #22 2015-04-14 18:22:22 -05:00
9da2395586 More error logging improvements, fix #21 2015-04-02 20:59:45 +01:00
6942aa37d2 Drop excess armor items when bones are full 2015-03-21 17:48:09 +00:00
7da9d81963 Merge pull request #20 from ExeterDad/master
smaller b3d export
2015-03-20 18:20:27 +00:00
905fc9fcb0 smaller b3d export 2015-03-18 20:50:54 -04:00
b8e5d0adde Fix inverted normal on inner right arm 2015-03-18 18:37:04 +00:00
58337c0404 Better skin mod support and more preview bug fixes 2015-03-08 18:29:17 +00:00
87af6e0c68 Fix missing preview image when using simple_skins mod 2015-03-08 15:21:37 +00:00
70d353bb6c Merge pull request #19 from Calinou/optimize_textures
Optimize textures using OptiPNG
2015-02-22 13:54:28 +00:00
6e0fbc8bb2 Optimize textures using OptiPNG 2015-02-22 10:13:06 +01:00
9c2b9c9b5a Character model improvements. Extruded shields - closes #18 2015-02-21 16:34:49 +00:00
b8be801b94 Bump version to 0.4.3 2015-02-20 21:27:47 +00:00
679888398f Craft wooden armor from any type of wood [group:wood] 2015-02-20 15:09:30 +00:00
c03cefbc87 Don't show admin armor in the creative inventory 2015-02-19 22:11:03 +00:00
d95f494a94 Add some wieldview bug fixes from Carbone game by Calinou 2015-02-19 22:01:09 +00:00
195d138da5 Use b3d armor model export by ExeterDad 2015-02-19 21:08:24 +00:00
dd9c63e4ca Merge pull request #17 from ExeterDad/master
unlinked textures in 3d_amor_character blend file, and created 3d_amor ....
2015-02-19 20:56:26 +00:00
358e4a2467 unlinked textures in 3d_amor_character blend file, and created 3d_amor .b3d export 2015-02-19 14:59:44 -05:00
3dd43c7c6f Update shields to use the ARMOR_MATERIALS table 2015-02-19 19:18:34 +00:00
b17d8ea55a Allow individual armor materials to be disabled via armor.conf 2015-02-19 18:55:58 +00:00
e6979e9409 Update model files for newer versions of blender 2015-02-01 16:53:39 +00:00
466c5e6957 Add missing 'admin boots' texture 2015-01-24 00:18:20 +00:00
a9fcbf29fe Added cactus armor and admin armor 2015-01-09 20:16:22 +00:00
499d5af310 More error logging enhancements 2015-01-07 21:25:40 +00:00
e3c2616328 Improve error logging a little 2015-01-04 21:37:12 +00:00
b5db0f1aa6 Remove undeclared variable warnings on start-up 2015-01-04 19:57:55 +00:00
ad6c464573 More UV fixes 2014-10-09 18:34:21 +01:00
5ab2f73695 Fix UV error on cape 2014-10-08 18:55:01 +01:00
e14af35b95 Add compatibilty for caped skins 2014-10-05 19:05:11 +01:00
c3d37e83c2 Remove old character model 2014-10-05 19:03:40 +01:00
046880a534 Add compatiblity for SmallJoker's u_skins fork 2014-10-02 21:08:18 +01:00
258b1cbf48 Bump version to 0.4.2 2014-09-28 19:51:35 +01:00
c10a606632 Update README.md and fix paste error in crafting_guide.txt 2014-09-28 19:37:16 +01:00
2415d66057 Merge pull request #12 from donat-b/patch-1
Update init.lua
2014-09-28 15:13:09 +01:00
abf445014e Update init.lua
fix typo in condition
2014-09-28 15:39:31 +04:00
4415e2b33b Add support for simple skins by TenPlus1 2014-09-12 18:30:09 +01:00
36688c74a8 Add check for nil player inventory 2014-09-11 20:13:16 +01:00
672dbe1f54 Expose physics overrides in global armor.def 2014-09-11 20:11:08 +01:00
3c98acb9c9 Make ARMOR_DROP default depend on presence of bones mod 2014-08-17 17:07:27 +01:00
5075cc48a4 Allow per world configuration overrides 2014-08-17 17:00:52 +01:00
7eebc378a6 Fix crash if wielditem inventory image is nil 2014-06-25 21:10:35 +01:00
6f7a0ea7fc Merge pull request #9 from Megaf/master
Added Gold Armor and Shield
2014-06-12 22:28:47 +01:00
7ee4126d15 Merge branch 'master' of https://github.com/Megaf/minetest-3d_armor 2014-06-12 12:39:50 -03:00
b67de94223 Added gold recipe. 2014-06-12 12:39:17 -03:00
3604420d9e Added Gold Shield recipe. 2014-06-12 12:10:43 -03:00
0936d6f173 Change gold damage.
Gold is equivalent as bronze now.
2014-06-12 12:06:03 -03:00
e4ab8c02ac Created gold shields
They are as strong as Bronze Shields.
2014-06-12 12:04:08 -03:00
db157c080d Added Gold textures to shields.
new file:   shields/textures/shields_inv_shield_gold.png
	new file:   shields/textures/shields_shield_gold.png
	new file:   shields/textures/shields_shield_gold_preview.png
2014-06-12 12:00:52 -03:00
aaf90c2b24 new file: 3d_armor/textures/3d_armor_inv_chestplate_gold.png 2014-06-12 11:56:43 -03:00
4420afb8d1 Added gold textures.
new file:   3d_armor/textures/3d_armor_boots_gold.png
	new file:   3d_armor/textures/3d_armor_boots_gold_preview.png
	new file:   3d_armor/textures/3d_armor_chestplate_gold.png
	new file:   3d_armor/textures/3d_armor_chestplate_gold_preview.png
	new file:   3d_armor/textures/3d_armor_helmet_gold.png
	new file:   3d_armor/textures/3d_armor_helmet_gold_preview.png
	new file:   3d_armor/textures/3d_armor_inv_boots_gold.png
	new file:   3d_armor/textures/3d_armor_inv_helmet_gold.png
	new file:   3d_armor/textures/3d_armor_inv_leggings_gold.png
	new file:   3d_armor/textures/3d_armor_leggings_gold.png
	new file:   3d_armor/textures/3d_armor_leggings_gold_preview.png
2014-06-12 11:44:28 -03:00
3e9ce303e6 Update crafting_guide.txt
Added gold armor recipes.
2014-06-12 11:34:28 -03:00
11887fc73b Added Gold armor 2014-06-12 11:32:58 -03:00
85f56f7ba0 Check for valid player inventory 2014-04-21 19:10:24 +01:00
eedf913638 Set inventory mod to main page on die player 2014-04-18 00:12:38 +01:00
ecfd397d77 Fix error in previous commit 2014-04-15 22:06:47 +01:00
b76508397f Only round the drop position when using bones mod 2014-04-15 21:55:23 +01:00
9aaba7569c Update config example 2014-04-15 21:52:24 +01:00
1886fe6b1a Fix armor wear level being fully restored on item drop 2014-04-14 19:28:23 +01:00
19d45efd12 Fix preview not updating when armor is destroyed 2014-04-14 19:25:10 +01:00
72b612f081 Update armor.conf.example 2014-04-13 20:26:14 +01:00
8a881022e9 Make armor more configurable 2014-04-13 20:17:11 +01:00
8457220413 Add support for unified inventory and skins 2014-04-13 17:41:19 +01:00
cf2786a818 Add support for bones mod 2014-04-08 22:03:01 +01:00
5345c50c7e Bump version to 0.4.1 for minetest 0.4.9 2014-01-03 20:55:32 +00:00
2b8e0c5fd9 Merge pull request #6 from Bremaweb/armor-physics
add physics overrides to armor
2013-12-23 11:24:12 -08:00
55e2b69a08 change delay back to 0 2013-12-22 19:51:46 -06:00
a07a00c117 remove unused variable 2013-12-20 23:56:50 -06:00
681bf25505 add physics overrides to armor 2013-12-20 23:52:15 -06:00
0b3deea513 Improve player model hanlding and update to version 0.4.0 2013-11-12 21:22:52 +00:00
9dbf76d013 UV mapping fix, edge of boots showing on hat layer 2013-10-15 22:03:43 +01:00
f71204db09 Merge pull request #5 from BlockMen/2nd
Better implementation of support for hud
2013-09-13 10:38:44 -07:00
025c0136b7 Merge pull request #4 from BlockMen/master
Add support for Better HUD mod
2013-09-12 10:15:26 -07:00
cf87528a03 General way to provide read out of armor 2013-09-12 01:29:30 +02:00
9481e548cf Add support for Better HUD mod 2013-09-12 01:08:11 +02:00
02ba28f11b Make wielded item more 3d looking 2013-08-04 22:20:03 +01:00
5e52758216 Add texture transform support 2013-08-04 22:17:08 +01:00
59048743ab Update Textures 2013-07-14 19:20:54 +01:00
cfc6984a36 Update Models 2013-07-14 19:15:11 +01:00
619a52688f Add multiple UV texture support 2013-07-14 18:24:24 +01:00
8f2852c6b3 Rename inventory++ icon 2013-07-06 18:05:10 +01:00
956193b49a Re add support for inventory++ by Zeg9 2013-07-04 19:15:38 +01:00
d7a87a515b Only load formspec when armor inventory selected 2013-06-26 22:55:55 +01:00
eeb69e1280 Update README.md 2013-06-24 20:45:05 +01:00
cf0331a043 Add diamond shield craft registration 2013-06-24 20:34:51 +01:00
61e6052019 Add shields back as a separate mod 2013-06-24 19:06:19 +01:00
0edd6ac9e0 Update README.md 2013-06-22 19:40:54 +01:00
efea71a63e Version update: 0.3.0 2013-06-22 19:31:57 +01:00
449 changed files with 8192 additions and 7278 deletions

5
.gitattributes vendored Normal file
View File

@ -0,0 +1,5 @@
.* export-ignore
gendoc.sh export-ignore
integration-test.sh export-ignore
preview_gen.py export-ignore
screenshot.xcf export-ignore

14
.github/workflows/integration-test.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: integration-test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: integration-test
run: ./integration-test.sh

17
.github/workflows/luacheck.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: luacheck
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: apt
run: sudo apt-get install -y luarocks
- name: luacheck install
run: luarocks install --local luacheck
- name: luacheck run
run: $HOME/.luarocks/bin/luacheck ./

31
.github/workflows/reference.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Build Reference
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Lua
uses: leafo/gh-actions-lua@v10.0.0
with:
luaVersion: 5.4
- name: Setup Lua Rocks
uses: leafo/gh-actions-luarocks@v4
- name: Setup LDoc dependencies
run: luarocks install --only-deps https://raw.githubusercontent.com/lunarmodules/ldoc/master/rockspecs/ldoc-1.5.0-1.rockspec
- name: Setup LDoc
run: git clone --single-branch --branch=custom https://github.com/AntumDeluge/ldoc.git .ldoc/ldoc && chmod +x .ldoc/ldoc/ldoc.lua
- name: Generate docs
run: chmod +x .ldoc/gendoc.sh && ./.ldoc/gendoc.sh
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./3d_armor/docs

4
.gitignore vendored
View File

@ -4,4 +4,8 @@
*bak*
tags
*.vim
armor.conf
## Eclipse project files & directories
.project
.settings

335
.ldoc/config.ld Normal file
View File

@ -0,0 +1,335 @@
-- place this file in mod ".ldoc" directory
local print, type, string, table, tostring, tonumber, error, pairs, ipairs
if import then
print = import("print")
type = import("type")
string = import("string")
table = import("table")
tostring = import("tostring")
tonumber = import("tonumber")
error = import("error")
pairs = import("pairs")
ipairs = import("ipairs")
end
project = "3d_armor"
title = "3D Armor"
format = "markdown"
not_luadoc = true
boilerplate = false
wrap = false
style = true
favicon = "https://www.minetest.net/media/icon.svg"
file = {
"3d_armor/api.lua",
".ldoc/settings.luadoc",
--".ldoc/armors.luadoc",
".ldoc/helmets.luadoc",
".ldoc/chestplates.luadoc",
".ldoc/leggings.luadoc",
".ldoc/boots.luadoc",
--".ldoc/shields.luadoc",
"shields/init.lua",
".ldoc/crafting.luadoc",
}
new_type("setting", "Settings")
new_type("armor", "Armors")
new_type("craft", "Craft Recipes")
alias("helmet", "armor")
alias("chestplate", "armor")
alias("leggings", "armor")
alias("boots", "armor")
alias("shield", "armor")
alias("grp", "group")
-- function declarations
local format_text
local format_group
custom_tags = {
-- settings
{
"settype",
title = "Type",
hidden = true,
},
{
"min",
title = "Minimum Value",
hidden = true,
},
{
"max",
title = "Maximum Value",
hidden = true,
},
{
"default",
title = "Default Value",
hidden = true,
},
-- craft items/tools
{
-- specify image basename only
"img",
title = "Inventory Image",
format = function(value)
return "<img src=\"../data/" .. value .. "\" style=\"width:32px; height:32px;\" />"
end,
},
{
-- specify full (relative or absolute) image path
"image",
title = "Image",
format = function(value)
return "<img src=\"" .. value .. "\" style=\"width:32px; height:32px;\" />"
end,
},
{
"group",
title = "Groups",
format = function(value)
return format_group(value)
end,
},
{
"armorgrp",
title = "Armor Groups",
format = function(value)
return format_group(value)
end,
},
{
"damagegrp",
title = "Damage Groups",
format = function(value)
return format_group(value)
end,
},
}
if string then
string.trim = function(st, delim)
if not delim then
delim = " "
end
while string.find(st, delim) == 1 do
st = st:sub(2)
end
while string.sub(st, string.len(st)) == delim do
st = st:sub(1, string.len(st)-1)
end
return st
end
string.split = function(st, delim)
local list = {}
local idx = string.find(st, delim)
while idx do
table.insert(list, st:sub(1, idx-1))
st = st:sub(idx+1)
idx = string.find(st, delim)
end
-- add remaining item
table.insert(list, st)
return list
end
end
if table then
if not table.copy then
table.copy = function(orig_table)
local new_table = {}
for k, v in pairs(orig_table) do
new_table[k] = v
end
return new_table
end
end
end
format_text = function(text, flags)
local ret = "<"
local ttype = "span"
if flags.code then
ttype = "code"
end
ret = ret .. ttype .. " style=\""
if flags.size then
ret = ret .. "font-size:" .. flags.size .. ";"
end
if flags.mono then
ret = ret .. "font-family:monospace;"
end
if flags.italic then
ret = ret .. "font-style:italic;"
end
if flags.bold then
ret = ret .. "font-weight:bold;"
end
if flags.color then
ret = ret .. "color:" .. flags.color .. ";"
end
if flags.bgcolor then
ret = ret .. "background-color:" .. flags.bgcolor .. ";"
end
ret = ret .. "\">" .. text .. "</" .. ttype .. ">"
return ret
end
format_group = function(text)
if string then
local idx, k, v = string.find(text, " ")
if idx then
text = format_text(string.sub(text, 1, idx-1) .. ": ", {mono=true, color="darkgreen"})
.. string.sub(text, idx)
end
end
return text
end
local function format_setting_tag(desc, value)
return "\n- <span style=\"font-size:80%;\">`" .. desc .. ":`</span> `" .. value .. "`"
end
local registered = {
settings = {},
}
local function setting_handler(item)
-- avoid parsing again
if registered.settings[item.name] then
return item
end
if not ipairs or not type then
return item
end
local tags = {
{"settype", "type"},
{"default"},
{"min", "minimum value"},
{"max", "maximum value"},
}
local def = {
["settype"] = format_setting_tag("type", "string"),
}
for _, t in ipairs(tags) do
local name = t[1]
local desc = t[2]
if not desc then desc = name end
local value = item.tags[name]
if type(value) == "table" then
if #value > 1 then
local msg = item.file.filename .. " (line " .. item.lineno
.. "): multiple instances of tag \"" .. name .. "\" found"
if error then
error(msg)
elseif print then
print("WARNING: " .. msg)
end
end
if value[1] then
def[name] = format_setting_tag(desc, value[1])
end
end
end
item.description = item.description .. "\n\n**Definition:**\n" .. def.settype
for _, t in ipairs({def.default, def.min, def.max}) do
if t then
item.description = item.description .. t
end
end
registered.settings[item.name] = true
return item
end
function custom_display_name_handler(item, default_handler)
if item.type == "setting" then
item = setting_handler(item)
end
if item then
return default_handler(item)
end
end
local custom_see_links = {
["ObjectRef"] = "https://minetest.gitlab.io/minetest/class-reference/#objectref",
["PlayerMetaRef"] = "https://minetest.gitlab.io/minetest/class-reference/#playermetaref",
["ItemDef"] = "https://minetest.gitlab.io/minetest/definition-tables/#item-definition",
["ItemStack"] = "https://minetest.gitlab.io/minetest/class-reference/#itemstack",
["groups"] = "https://minetest.gitlab.io/minetest/groups/",
["entity_damage_mechanism"] = "https://minetest.gitlab.io/minetest/entity-damage-mechanism/",
["vector"] = "https://minetest.gitlab.io/minetest/representations-of-simple-things/#positionvector",
}
local function format_custom_see(name, section)
local url = custom_see_links[name]
if not url then
url = ""
end
if not name then
name = ""
end
return name, url
end
custom_see_handler("^(ObjectRef)$", function(name, section)
return format_custom_see(name, section)
end)
custom_see_handler("^(PlayerMetaRef)$", function(name, section)
return format_custom_see(name, section)
end)
custom_see_handler("^(ItemDef)$", function(name, section)
return format_custom_see(name, section)
end)
custom_see_handler("^(groups)$", function(name, section)
return format_custom_see(name, section)
end)
custom_see_handler("^(entity_damage_mechanism)$", function(name, section)
return format_custom_see(name, section)
end)
custom_see_handler("^(ItemStack)$", function(name, section)
return format_custom_see(name, section)
end)
custom_see_handler("^(vector)$", function(name, section)
return name, "https://minetest.gitlab.io/minetest/representations-of-simple-things/#positionvector"
end)

39
.ldoc/crafting.luadoc Normal file
View File

@ -0,0 +1,39 @@
--- 3D Armor Crafting
--
-- @topic crafting
--- Craft recipes for helmets, chestplates, leggings, boots, & shields.
--
-- @craft armor
-- @usage
-- Key:
-- - m: material
-- - wood: group:wood
-- - cactus: default:cactus
-- - steel: default:steel_ingot
-- - bronze: default:bronze_ingot
-- - diamond: default:diamond
-- - gold: default:gold_ingot
-- - mithril: moreores:mithril_ingot
-- - crystal: ethereal:crystal_ingot
-- - nether: nether:nether_ingot
--
-- helmet: chestplate: leggings:
-- ┌───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┐
-- │ m │ m │ m │ │ m │ │ m │ │ m │ m │ m │
-- ├───┼───┼───┤ ├───┼───┼───┤ ├───┼───┼───┤
-- │ m │ │ m │ │ m │ m │ m │ │ m │ │ m │
-- ├───┼───┼───┤ ├───┼───┼───┤ ├───┼───┼───┤
-- │ │ │ │ │ m │ m │ m │ │ m │ │ m │
-- └───┴───┴───┘ └───┴───┴───┘ └───┴───┴───┘
--
-- boots: shield:
-- ┌───┬───┬───┐ ┌───┬───┬───┐
-- │ │ │ │ │ m │ m │ m │
-- ├───┼───┼───┤ ├───┼───┼───┤
-- │ m │ │ m │ │ m │ m │ m │
-- ├───┼───┼───┤ ├───┼───┼───┤
-- │ m │ │ m │ │ │ m │ │
-- └───┴───┴───┘ └───┴───┴───┘

88
.ldoc/gendoc.sh Executable file
View File

@ -0,0 +1,88 @@
#!/usr/bin/env bash
# Place this file in mod ".ldoc" directory.
#
# To change output directory set the `d_export` environment variable.
# Example:
# $ d_export=/custom/path ./gendoc.sh
d_ldoc="$(dirname $(readlink -f $0))"
f_config="${d_ldoc}/config.ld"
cd "${d_ldoc}/.."
d_root="$(pwd)"
d_export="${d_export:-${d_root}/3d_armor/docs/reference}"
d_data="${d_export}/data"
cmd_ldoc="${d_ldoc}/ldoc/ldoc.lua"
if test -f "${cmd_ldoc}"; then
if test ! -x "${cmd_ldoc}"; then
chmod +x "${cmd_ldoc}"
fi
else
cmd_ldoc="ldoc"
fi
# clean old files
rm -rf "${d_export}"
# generate items, settings, & crafts topics temp files
echo -e "\ngenerating temp files ..."
for script in src settings; do
script="${d_ldoc}/parse_${script}.py"
if test ! -f "${script}"; then
echo "ERROR: script doesn't exist: ${script}"
else
# check script's executable bit
if test ! -x "${script}"; then
chmod +x "${script}"
fi
# execute script
"${script}"
fi
done
echo
# generate new doc files
"${cmd_ldoc}" --UNSAFE_NO_SANDBOX -c "${f_config}" -d "${d_export}" "${d_root}"; retval=$?
# check exit status
if test ${retval} -ne 0; then
echo -e "\nan error occurred (ldoc return code: ${retval})"
exit ${retval}
fi
echo -e "\ncleaning temp files ..."
find "${d_ldoc}" -type f -name "*.luadoc" ! -name "crafting.luadoc" -exec rm -vf {} +
# HACK: ldoc does not seem to like the "shields:" prefix
echo -e "\ncompensating for LDoc's issue with \"shields:\" prefix ..."
sed -i \
-e 's/<strong>shield_/<strong>shields:shield_/' \
-e 's/<td class="name\(.*\)>shield_/<td class="name\1>shields:shield_/' \
-e 's/<a href="#shield_/<a href="#shields:shield_/' \
-e 's/<a name.*"shield_/<a name="shields:shield_/' \
"${d_export}/topics/shields.html"
# copy textures to data directory
printf "\ncopying textures ..."
mkdir -p "${d_data}"
texture_count=0
for d_mod in armor_* shields; do
printf "\rcopying textures from ${d_mod} ...\n"
for png in $(find "${d_root}/${d_mod}/textures" -maxdepth 1 -type f -name "*.png"); do
if test -f "${d_data}/$(basename ${png})"; then
echo "WARNING: not overwriting existing file: ${png}"
else
cp "${png}" "${d_data}"
texture_count=$((texture_count + 1))
printf "\rcopied ${texture_count} textures"
fi
done
done
echo -e "\n\nDone!"

305
.ldoc/ldoc.css Normal file
View File

@ -0,0 +1,305 @@
/* BEGIN RESET
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.8.2r1
*/
html {
color: #000;
background: #FFF;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,img {
border: 0;
}
address,caption,cite,code,dfn,em,strong,th,var,optgroup {
font-style: inherit;
font-weight: inherit;
}
del,ins {
text-decoration: none;
}
li {
margin-left: 20px;
}
caption,th {
text-align: left;
}
h1,h2,h3,h4,h5,h6 {
font-size: 100%;
font-weight: bold;
}
q:before,q:after {
content: '';
}
abbr,acronym {
border: 0;
font-variant: normal;
}
sup {
vertical-align: baseline;
}
sub {
vertical-align: baseline;
}
legend {
color: #000;
}
input,button,textarea,select,optgroup,option {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
}
input,button,textarea,select {*font-size:100%;
}
/* END RESET */
body {
margin-left: 1em;
margin-right: 1em;
font-family: arial, helvetica, geneva, sans-serif;
background-color: #ffffff; margin: 0px;
}
code, tt { font-family: monospace; font-size: 1.1em; }
span.parameter { font-family:monospace; }
span.parameter:after { content:":"; }
span.types:before { content:"("; }
span.types:after { content:")"; }
.type { font-weight: bold; font-style:italic }
body, p, td, th { font-size: .95em; line-height: 1.2em;}
p, ul { margin: 10px 0 0 0px;}
strong { font-weight: bold;}
em { font-style: italic;}
h1 {
font-size: 1.5em;
margin: 20px 0 20px 0;
}
h2, h3, h4 { margin: 15px 0 10px 0; }
h2 { font-size: 1.25em; }
h3 { font-size: 1.15em; }
h4 { font-size: 1.06em; }
a:link { font-weight: bold; color: #004080; text-decoration: none; }
a:visited { font-weight: bold; color: #006699; text-decoration: none; }
a:link:hover { text-decoration: underline; }
hr {
color:#cccccc;
background: #00007f;
height: 1px;
}
blockquote { margin-left: 3em; }
ul { list-style-type: disc; }
p.name {
font-family: "Andale Mono", monospace;
padding-top: 1em;
}
pre {
background-color: rgb(245, 245, 245);
border: 1px solid #C0C0C0; /* silver */
padding: 10px;
margin: 10px 0 10px 0;
overflow: auto;
font-family: "Andale Mono", monospace;
}
pre.example {
font-size: .85em;
}
table.index { border: 1px #00007f; }
table.index td { text-align: left; vertical-align: top; }
#container {
margin-left: 1em;
margin-right: 1em;
background-color: #f0f0f0;
}
#product {
text-align: center;
border-bottom: 1px solid #cccccc;
background-color: #ffffff;
}
#product big {
font-size: 2em;
}
#main {
background-color: #f0f0f0;
border-left: 2px solid #cccccc;
}
#navigation {
float: left;
width: 14em;
vertical-align: top;
background-color: #f0f0f0;
overflow: visible;
position: fixed;
}
#navigation h2 {
background-color:#e7e7e7;
font-size:1.1em;
color:#000000;
text-align: left;
padding:0.2em;
border-top:1px solid #dddddd;
border-bottom:1px solid #dddddd;
}
#navigation ul
{
font-size:1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
}
#navigation li {
text-indent: -1em;
display: block;
margin: 3px 0px 0px 22px;
}
#navigation li li a {
margin: 0px 3px 0px -1em;
}
#content {
margin-left: 14em;
padding: 1em;
width: 700px;
border-left: 2px solid #cccccc;
border-right: 2px solid #cccccc;
background-color: #ffffff;
min-height: 425px;
}
#about {
clear: both;
padding: 5px;
border-top: 2px solid #cccccc;
background-color: #ffffff;
}
@media print {
body {
font: 12pt "Times New Roman", "TimeNR", Times, serif;
}
a { font-weight: bold; color: #004080; text-decoration: underline; }
#main {
background-color: #ffffff;
border-left: 0px;
}
#container {
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
}
#content {
padding: 1em;
background-color: #ffffff;
}
#navigation {
display: none;
}
pre.example {
font-family: "Andale Mono", monospace;
font-size: 10pt;
page-break-inside: avoid;
}
}
table.module_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.module_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.module_list td.name { background-color: #f0f0f0; min-width: 200px; }
table.module_list td.summary { width: 100%; }
table.function_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.function_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.function_list td.name { background-color: #f0f0f0; min-width: 200px; }
table.function_list td.summary { width: 100%; }
ul.nowrap {
overflow:auto;
white-space:nowrap;
}
dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
dl.table h3, dl.function h3 {font-size: .95em;}
/* stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }
/* make the target distinct; helps when we're navigating to a function */
a:target + * {
background-color: #FF9;
}
/* styles for prettification of source */
pre .comment { color: #558817; }
pre .constant { color: #a8660d; }
pre .escape { color: #844631; }
pre .keyword { color: #aa5050; font-weight: bold; }
pre .library { color: #0e7c6b; }
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
pre .string { color: #8080ff; }
pre .number { color: #f8660d; }
pre .operator { color: #2239a8; font-weight: bold; }
pre .preprocessor, pre .prepro { color: #a33243; }
pre .global { color: #800080; }
pre .user-keyword { color: #800080; }
pre .prompt { color: #558817; }
pre .url { color: #272fc2; text-decoration: underline; }

118
.ldoc/parse_settings.py Executable file
View File

@ -0,0 +1,118 @@
#!/usr/bin/env python
# This script will format "settingtypes.txt" file found at the root
# of 3d_armor modpack into a format readable by LDoc.
import sys, os, errno, codecs
path = os.path.realpath(__file__)
script = os.path.basename(path)
d_root = os.path.dirname(os.path.dirname(path))
d_ldoc = os.path.join(d_root, ".ldoc")
f_settings = os.path.join(d_root, "settingtypes.txt")
if not os.path.isfile(f_settings):
print("settingtypes.txt does not exist")
sys.exit(errno.ENOENT)
i_stream = codecs.open(f_settings, "r", "utf-8")
data_in = i_stream.read()
i_stream.close()
data_in = data_in.replace("\r", "")
sets = data_in.split("\n\n")
for idx in reversed(range(len(sets))):
set = sets[idx]
lines = set.split("\n")
for idx2 in reversed(range(len(lines))):
li = lines[idx2].strip(" \t")
if li == "" or li[0] == "[":
lines.pop(idx2)
if len(lines) == 0:
sets.pop(idx)
else:
sets[idx] = "\n".join(lines)
filtered = []
for set in sets:
comment = False
lines = set.split("\n")
new_lines = []
for li in lines:
if li[0] == "#":
new_lines.append(li)
else:
new_lines.append(li)
filtered.append("\n".join(new_lines))
new_lines = []
settings = []
def parse_setting(set):
desc = []
setting = summary = stype = sdefault = soptions = None
for li in set.split("\n"):
if li[0] == "#":
desc.append("-- {}".format(li.lstrip(" #")))
else:
setting = li.split(" ")[0]
summary = li.split(")")[0].split("(")[-1]
li = li.split(")")[-1].strip()
rem = li.split(" ")
stype = rem[0]
rem.pop(0)
if len(rem) > 0:
sdefault = rem[0]
rem.pop(0)
if len(rem) > 0:
soptions = " ".join(rem)
if not setting:
return
st = "---"
if summary:
if summary[-1] != ".":
summary = "{}.".format(summary)
st = "{} {}".format(st, summary)
st = "{}\n--".format(st)
if len(desc) > 0:
st = "{}\n{}\n--".format(st, "\n".join(desc))
st = "{}\n-- @setting {}".format(st, setting)
if stype:
st = "{}\n-- @settype {}".format(st, stype)
if sdefault:
st = "{}\n-- @default {}".format(st, sdefault)
# TODO: add options
settings.append(st)
for f in filtered:
parse_setting(f)
outfile = os.path.join(d_ldoc, "settings.luadoc")
data_out = "\n--- 3D Armor Settings\n--\n-- @topic settings\n\n\n{}\n".format("\n\n".join(settings))
o_stream = codecs.open(outfile, "w", "utf-8")
if not o_stream:
print("ERROR: could not open file for writing: {}".format(outfile))
sys.exit(errno.EIO)
o_stream.write(data_out)
o_stream.close()
print("settings exported to\t{}".format(outfile))

90
.ldoc/parse_src.py Executable file
View File

@ -0,0 +1,90 @@
#!/usr/bin/env python
# This script will parse source files for docstring.
import os, codecs
path = os.path.realpath(__file__)
script = os.path.basename(path)
d_root = os.path.dirname(os.path.dirname(path))
d_ldoc = os.path.join(d_root, ".ldoc")
armor_types = {
"armor": {"topic": "Armors", "values": []},
"helmet": {"topic": "Helmets", "values": []},
"chestplate": {"topic": "Chestplates", "values": []},
"leggings": {"topic": "Leggings", "values": []},
"boots": {"topic": "Boots", "values": []},
#"shield": {"topic": "Shields", "values": []},
}
def parse_file(f):
buffer = codecs.open(f, "r", "utf-8")
if not buffer:
print("ERROR: could not open file for reading: {}".format(f))
return
data_in = buffer.read()
buffer.close()
# format to LF (Unix)
data_in = data_in.replace("\r\n", "\n").replace("\r", "\n")
current_item = []
item_type = None
new_item = False
for li in data_in.split("\n"):
li = li.strip()
if li.startswith("---"):
new_item = True
elif not li.startswith("--"):
new_item = False
if new_item:
current_item.append(li)
if not item_type:
for a_type in armor_types:
if "@{} ".format(a_type) in li:
item_type = a_type
break
elif item_type and len(current_item):
armor_types[item_type]["values"].append("\n".join(current_item))
item_type = None
current_item = []
else:
current_item = []
to_parse = []
for obj in os.listdir(d_root):
fullpath = os.path.join(d_root, obj)
if not obj.startswith(".") and os.path.isdir(fullpath):
for root, dirs, files in os.walk(fullpath):
for f in files:
if f.endswith(".lua"):
to_parse.append(os.path.join(root, f))
for p in to_parse:
if not os.path.isfile(p):
print("ERROR: {} is not a file".format(p))
else:
parse_file(p)
for t in armor_types:
topic = armor_types[t]["topic"]
items = armor_types[t]["values"]
if len(items):
outfile = os.path.join(d_ldoc, "{}.luadoc".format(topic.lower()))
buffer = codecs.open(outfile, "w", "utf-8")
if not buffer:
print("ERROR: could not open file for writing: {}".format(outfile))
continue
buffer.write("\n--- 3D Armor {}\n--\n-- @topic {}\n\n\n{}\n".format(topic, topic.lower(), "\n\n".join(items)))
buffer.close()
print("{} exported to\t{}".format(topic.lower(), outfile))

33
.luacheckrc Normal file
View File

@ -0,0 +1,33 @@
unused_args = false
globals = {
"wieldview",
"armor",
"inventory_plus"
}
read_globals = {
-- Stdlib
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
-- Minetest
"vector", "ItemStack",
"dump", "VoxelArea",
-- deps
"default",
"player_api",
"minetest",
"unified_inventory",
"wardrobe",
"player_monoids",
"armor_monoid",
"sfinv",
"ARMOR_MATERIALS",
"ARMOR_FIRE_NODES",
"pova",
"skins",
"u_skins"
}

26
3d_armor/LICENSE.txt Normal file
View File

@ -0,0 +1,26 @@
[mod] 3d Armor [3d_armor]
=========================
License Source Code
-------------------
Copyright (C) 2012-2019 stujones11, Stuart Jones <stujones111@gmail.com>
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 Textures
----------------
Copyright (C) 2017-2019 davidthecreator - CC-BY-SA 3.0

530
3d_armor/README.md Normal file
View File

@ -0,0 +1,530 @@
# [mod] Visible Player Armor [3d_armor]
| | | | |
|--|--|--|--|
|-[Overview](#overview) |||-[API](#api)
|-[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)
|- - [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)
|- - [armor_destroy](#destroy-armor-when-a-player-dies) |||- - - [Durability](#durability)
|- - [armor_level_multiplier](#armor-level-multiplyer) |||- - - [Armor Material](#armor-material)
|- - [armor_heal_multiplier](#armor-healing-multiplyer) |||- - [Armour Functions](#armor-functions)
|- - [armor_set_elements](#allows-the-customisation-of-armor-set) |||- - - [armor:set_player_armor](#armor-set_player_armor)
|- - [armor_set_bonus](#armor-set-bonus-multiplier) |||- - - [armor:punch](#armor-punch)
|- - [armor_water_protect](#enable-water-protection) |||- - - [armor:damage](#armor-damage)
|- - [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)
|-[Credits](#credits) |||- - [Callbacks](#Callbacks)
| |||- - - [Item callbacks](#item-callbacks)
| |||- - - [Global callbacks](#global-callbacks)
# Overview
**Depends:** default
**Recommends:** sfinv, unified_inventory or smart_inventory (use only one to avoid conflicts)
**Supports:** player_monoids, armor_monoid and POVA
Adds craftable armor that is visible to other players. Each armor item worn contributes to
a player's armor group level making them less vulnerable to weapons.
Armor takes damage when a player is hurt but also offers a percentage chance of healing.
Overall level is boosted by 10% when wearing a full matching set.
# Armor Configuration
Change the following default settings by going to Main Menu>>Settings(Tab)>>All Settings(Button)>>Mods>>minetest-3d_Armor>>3d_Armor
### To disable individual armor materials
**set the below to false**
armor_material_wood = true
armor_material_cactus = true
armor_material_steel = true
armor_material_bronze = true
armor_material_diamond = true
armor_material_gold = true
armor_material_mithril = true
armor_material_crystal = true
armor_material_nether = true
### Initialization glitches when a player first joins
**Increase to prevent glitches**
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**
armor_bones_delay = 1
### How often player armor items are updated
**Number represents how often per second update is performed, higher value means less performance hit for servers but armor items maybe delayed in updating when switching.Fractional seconds also supported eg 0.1**
armor_update_time = 1
### Drop armor when a player dies
**Uses bones mod if present, otherwise items are dropped around the player when false.**
armor_drop = true
### Destroy armor when a player dies
**overrides armor_drop.**
armor_destroy = false
### Armor level multiplyer
**Increase to make armor more effective and decrease to make armor less effective**
**eg: level_multiplier = 0.5 will reduce armor level by half.**
armor_level_multiplier = 1
### Armor healing multiplyer
**Increase to make armor healing more effective and decrease to make healing less effective**
**eg: armor_heal_multiplier = 0 will disable healing altogether.**
armor_heal_multiplier = 1
### Allows the customisation of armor set
**Shields already configured as need to be worn to complete an armor set**
**These names come from [Element names](#groups-used-by-3d_armor), the second half of the element name only is used eg armor_head is head**
armor_set_elements = head torso legs feet shield
### Armor set bonus multiplier
**Set to 1 to disable set bonus**
armor_set_multiplier = 1.1
### Enable water protection
**periodically restores breath when activated**
armor_water_protect = true
### Enable fire protection
**defaults to true if using ethereal mod**
armor_fire_protect = false
### Fire protection enabled, disable torch fire damage
**when fire protection is enabled allows you to disable fire damage from torches**
**defaults to true if using ethereal mod**
armor_fire_protect_torch = false
### Enable punch damage effects
armor_punch_damage = true
### Migration of old armor inventories
armor_migrate_old_inventory = true
### How often player wield items are updated
**Number represents how often per second update is performed, higher value means less performance hit for servers but wield items maybe delayed in updating when switching. Fractional seconds also supported eg 0.1**
***Note this is MT engine functionality but included for completness***
wieldview_update_time = 1
# API
## 3d_Armor item storage
3d_Armor stores each armor piece a player currently has equiped in a ***detached*** inventory. The easiest way to access this inventory if needed is using this line of code
local _, armor_inv = armor:get_valid_player(player, "3d_armor")
**Example**
armor:register_on_equip(function(player, index, stack)
local _, armor_inv = armor:get_valid_player(player, "3d_armor")
for i = 1, 6 do
local stack = armor_inv:get_stack("armor", i)
if stack:get_name() == "3d_armor:chestplate_gold" then
minetest.chat_send_player(player:get_player_name(),"Got to love the Bling!!!")
end
end
end)
## Armor Registration
armor:register_armor(name, def)
Wrapper function for `minetest.register_tool`, which enables the easy registration of new armor items. While registering armor as a tool item is still supported, this may be deprecated in future so all armor items should be registered using *armor:register_armor(name,def)*.
### Additional fields supported by 3d_armor
texture = <filename>
preview = <filename>
armor_groups = <table>
damage_groups = <table>
reciprocate_damage = <bool>
on_equip = <function>
on_unequip = <function>
on_destroy = <function>
on_damage = <function>
on_punched = <function>
***Reciprocal tool*** damage will apply damage back onto the attacking tool/weapon, however this will only be done by the first armor inventory item with `reciprocate_damage = true`, damage does not stack.
**Example Simple:**
armor:register_armor("mod_name:chestplate_leather", {
description = "Leather Chestplate",
inventory_image = "mod_name_inv_chestplate_leather.png",
texture = "mod_name_leather_chestplate.png",
preview = "mod_name_leather_chestplate_preview.png",
groups = {armor_torso=1, armor_heal=0, armor_use=2000, flammable=1},
armor_groups = {fleshy=10},
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1}
})
*See ***armor.lua*** under **3d_armor>>3d_armor** for further examples*
**Extended functionality**
The values for ***texture*** and ***preview*** do not need to be included when registering armor if they follow the naming convention in the textures mod folder of:
***texture:*** *mod_name_leather_chestplate.png*
***preview:*** *mod_name_leather_chestplate_preview.png*
## Registering Armor Groups
3d armor has a built in armor group which is ***fleshy*** all players base vulnerability to being fleshy is ***100***.
3d armour allows for the easy registration/addition of new armor groups::
armor:register_armor_group(group, base)
***group:*** Is the name of the new armor group
***base*** Is the starting vulnerability that all players have to that new group. This dosent need to be 100.
**Example**
armor:register_armor_group("radiation", 100)
New armor group is registered called *radiation* and all players start off with a base vulnerability of *100* to radiation.
**Example** *Showing armor reg, new group usage and custom function*
armor:register_armor("mod_name:speed_boots", {
description = "Speed Boots",
inventory_image = "mod_name_speed_boots_inv.png",
texture = "mod_name_speed_boots.png",
preview = "mod_name_speed_boots_preview.png",
groups = {armor_feet=1, armor_use=500, physics_speed=1.2, flammable=1},
armor_groups = {fleshy=10, radiation=10},
damage_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1},
reciprocate_damage = true,
on_destroy = function(player, index, stack)
local pos = player:get_pos()
if pos then
minetest.sound_play({
name = "mod_name_break_sound",
pos = pos,
gain = 0.5,
})
end
end,
})
### Tools/weapons and new armor groups
The above allows armor to block/prevent new damage types but you also need to assign the new damage group to a tool/weapon or even a node (see technic mod) to make wearing the armor item meaningful. Simply add the ***armor_groups*** name to the tool items ***damage_groups***.
**Example**
minetest.register_tool("mod_name:glowing_sword", {
description = "Glowing Sword",
inventory_image = "mod_name_tool_glowingsword.png",
tool_capabilities = {full_punch_interval = 1.2,max_drop_level=0,
groupcaps={
cracky = {times={[3]=1.60}, uses=10, maxlevel=1},},
damage_groups = {fleshy=10,radiation=20},
},
sound = {breaks = "default_tool_breaks"},
groups = {pickaxe = 1, flammable = 2}
})
## Groups used by 3d_Armor
3d_armor has many default groups already registered, these are categorized under 4 main headings
- **Elements:** armor_head, armor_torso, armor_legs, armor_feet
- **Attributes:** armor_heal, armor_fire, armor_water, armor_feather
- **Physics:** physics_jump, physics_speed, physics_gravity
- **Durability:** armor_use, flammable
***Note: for calculation purposes "Attributes" and "Physics" values stack***
### Elements
Additional armor elements can be added by dependant mods, for example shields adds the group armor_shield which has by default a limit that only 1 shield can be worn at a time.
Adding Elements is more complex but the below code can be used to add new elements;
if minetest.global_exists("armor") and armor.elements then
table.insert(armor.elements, "hands")
end
**1st line** not strictly needed but checks that the global table "armor" and subtable "elements" exists
**2nd line** adds a new value to the armor.elements table called "hands"
See ***init.lua*** under **3d_armor>>shields** for a further example
The new armor item can now be registered using the new element
**Example**
armor:register_armor("mod_name:gloves_wood", {
description = "Wood Gauntlets",
inventory_image = "mod_name_inv_gloves_wood.png",
texture = "mod_name_gloves_wood.png",
preview = "mod_name_gloves_wood_preview.png",
groups = {armor_hands=1, armor_heal=0, armor_use=2000, flammable=1},
armor_groups = {fleshy=5},
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
})
### Attributes
Three attributes are avaliable in 3d_armor these are armor_heal, armor_fire and armor_water. Although possible to add additional attributes they would do nothing as code needs to be provide to specifiy the behaviour this could be done in a dependant mod
#### Armor_heal
This isn't how much the armor will heal but relates to the chance the armor will completely block the damage. For each point of ***armor_heal*** there is a 1% chance that damage will be completely blocked, this value will stack between all armor pieces
**Example**
The below Diamond chestplate has a 12% chance to completely block all damage (armor_heal=12), however so do boots, helmet and trousers so if the player was wearing all 4 pieces they would have a 48% chance of blocking all damage each attack.
armor:register_armor("3d_armor:chestplate_diamond", {
description = S("Diamond Chestplate"),
inventory_image = "3d_armor_inv_chestplate_diamond.png",
groups = {armor_torso=1, armor_heal=12, armor_use=200},
armor_groups = {fleshy=20},
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
})
#### Armor_fire
***"Armor_fire"*** provides 5 levels of fire protection
- level 1 protects against torches
- level 2 protects against crystal spike (Ethereal mod)
- level 3 protects against fire
- level 4 unused
- level 5 protects against lava
**Example**
armor:register_armor("mod_name:fire_proof_jacket", {
description = "Fire Proof Jacket",
inventory_image = "mod_name_inv_fire_proof_jacket.png",
groups = {armor_torso=1, armor_fire=3, armor_use=1000},
armor_groups = {fleshy=10},
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
})
#### Armor_water
***"Armor_water"*** will periodically restore a players breath when underwater. This only has one level or state, which is armor_water=1
**Example**
armor:register_armor("mod_name:helmet_underwater_breath", {
description = "Helmet of Underwater Breathing",
inventory_image = "mod_name_inv_helmet_underwater_breath.png",
groups = {armor_head=1, armor_water=1, armor_use=1000},
armor_groups = {fleshy=5},
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
})
#### Armor_feather
***"Armor_feather"*** will slow a player when falling. This only has one level or state, which is armor_feather=1
### Physics
The physics attributes supported by 3d_armor are ***physics_jump, physics_speed and physics_gravity***. Although 3d_armor supports the use of this with no other mods it is recommended that the mod [player_monoids](https://forum.minetest.net/viewtopic.php?t=14895) is used to help with intermod compatability.
***physics_jump*** - Will increase/decrease the jump strength of the player so they can jump more/less. The base number is "1" and any value is added or subtracted, supports fractional so "physics_jump=1" will increase jump strength by 100%. "physics_jump= -0.5" will decrease jump by 50%.
***physics_speed*** - Will increase/decrease the walk speed of the player so they walk faster/slower. The base number is "1" and any value is added or subtracted, supports fractional so "physics_speed=1.5" will increase speed by 150%, "physics_speed= -0.5" will decrease speed by 50%.
***physics_gravity*** - Will increase/decrease gravity the player experiences so it's higher/lower. The base number is "1" and any value is added or subtracted, supports fractional so "physics_gravity=2" will increase gravity by 200%, "physics_gravity= -1" will decrease gravity by 100%.
*Note: The player physics modifications won't be applied via `set_physics_override` if `player_physics_locked` is set to 1 in the respective player's meta.*
### Durability
Durability is determined by the value assigned to the group ***armor_use***. The higher the ***armor_use*** value the faster/more quickly it is damaged/degrades. This is calculated using the formula:
Total uses = approx(65535/armor_use)
**Example**
All wood armor items have an ***armor_use=2000***;
65535/2000 = 32.76 (32)
After 32 uses(hits) the armor item will break.
All diamond armor items have an ***armor_use=200***;
65535/2000 = 327.6 (327)
After 327 uses(hits) the armor item will break.
### Armor Material
The material the armor is made from is defined by adding the material to the end of registered armor item name. It is very important the material is the last item in the registered item name and it is preceeded by an "_" eg "_materialname".
The material name is what 3d_armor uses to determine if a player is wearing a set of armor. To recieve the set bonus all items worn must be made of the same material.
So to get a set bonus under the default set settings the players armor items listed below must be made of the same material:
* head - Helmet
* torso - Chestplate
* legs - Leggings
* feet - Boots
* shield - Shields
If all of the above were made of material "wood" the player would recieve an ***armor_set_bonus*** of armor_level * 1.1, essentially +10%
**Example One**
armor:register_armor("3d_armor:helmet_bronze", {
description = S("Bronze Helmet"),
inventory_image = "3d_armor_inv_helmet_bronze.png",
groups = {armor_head=1, armor_heal=6, armor_use=400, physics_speed=-0.01, physics_gravity=0.01},
armor_groups = {fleshy=10},
damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
})
**Example Two**
armor:register_armor("new_mod:helmet_spartan_bronze", {
description = S("Spartan Helmet"),
inventory_image = "new_mod_inv_helmet_spartan_bronze.png",
groups = {armor_head=1, armor_heal=6, armor_use=350, physics_speed=-0.01, physics_gravity=0.01},
armor_groups = {fleshy=12},
damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
})
***Note: At the moment an armor item can only be made of one material***
## Armor Functions
See also: [API Reference](https://minetest-mods.github.io/3d_armor/reference/)
### armor set_player_armor
armor:set_player_armor(player)
Primarily an internal function but can be called externally to apply any
changes that might not otherwise get handled.
### armor punch
armor:punch(player, hitter, time_from_last_punch, tool_capabilities)
Used to apply damage to all equipped armor based on the damage groups of
each individual item.`hitter`, `time_from_last_punch` and `tool_capabilities`
are optional but should be valid if included.
### armor damage
armor:damage(player, index, stack, use)
Adds wear to a single armor itemstack, triggers `on_damage` callbacks and
updates the necessary inventories. Also handles item destruction callbacks
and so should NOT be called from `on_unequip` to avoid an infinite loop.
### armor remove_all
armor:remove_all(player)
Removes all armors from the player's inventory without triggering any callback.
### armor equip
armor:equip(player, armor_name)
Equip the armor, removing the itemstack from the main inventory if there's one.
### armor unequip
armor:unequip(player, armor_name)
Unequip the armor, adding the itemstack to the main inventory.
### armor update_skin
armor:update_skin(player_name)
Triggers a skin update with the same action as if a field with `skins_set` was submitted.
## Callbacks
### Item Callbacks
In all of the below when armor is destroyed `stack` will contain a copy of the previous stack.
*unsure what this note means may apply to all item callbacks or just on_punched*
Return `false` to override armor damage effects.
#### on_equip
on_equip = func(player, index, stack)
#### on_unequip
on_unequip = func(player, index, stack)
#### on_destroy
on_destroy = func(player, index, stack)
#### on_damage
on_damage = func(player, index, stack)
#### on_punched
on_punched = func(player, hitter, time_from_last_punch, tool_capabilities)
`on_punched` is called every time a player is punched or takes damage, `hitter`, `time_from_last_punch` and `tool_capabilities` can be `nil` and will be in the case of fall damage.
When fire protection is enabled, hitter == "fire" in the event of fire damage.
### Global Callbacks
#### armor register_on_update
armor:register_on_update(function(player))
#### armor register_on_equip
armor:register_on_equip(function(player, index, stack))
#### armor register_on_unequip
armor:register_on_unequip(function(player, index, stack))
#### armor register_on_destroy
armor:register_on_destroy(function(player, index, stack))
**Example**
armor:register_on_update(function(player)
print(player:get_player_name().." armor updated!")
end)
# Credits
### The below have added too, tested or in other ways contributed to the development and ongoing support of 3d_Armor
|Stu |Stujones11 |Stu |Github Ghosts |
|:---------------:|:---------------:|:---------------:|:---------------:|
|Pavel_S |BlockMen |Tenplus1 |donat-b |
|JPRuehmann |BrandonReese |Megaf |Zeg9 |
|poet.nohit |Echoes91 |Adimgar |Khonkhortisan |
|VanessaE |CraigyDavi |proller |Thomasrudin |
|Byakuren |kilbith (jp) |afflatus |G1ov4 |
|Thomas-S |Dragonop |Napiophelios |Emojigit |
|rubenwardy |daviddoesminetest|bell07 |OgelGames |
|tobyplowy |crazyginger72 |fireglow |bhree |
|Lone_Wolf(HT) |Wuzzy(2) |numberZero |Monte48 |
|AntumDeluge |Terumoc |runsy |Dacmot |
|codexp |davidthecreator |SmallJoker |orbea |
|BuckarooBanzay |daret |Exeterdad |Calinou |
|Pilcrow182 |indriApollo |HybridDog |CraigyDavi |
|Paly-2 |Diogogomes | | |
*Note: Names gathered from 3d_armor forum thread and github, I may have missed some people, apologises if I have - S01*

View File

@ -1,15 +0,0 @@
[mod] Visible Player Armor [3d_armor]
=====================================
depends: default, inventory_plus, unified_skins
Adds craftable armor that is visible to other players. Each armor item worn contibutes to
a player's armor group level making them less vulnerable to weapons.
Armor takes damage when a player is hurt but also offers a percentage chance of healing.
default settings: [minetest.conf]
# Set number of seconds between armor updates.
3d_armor_update_time = 1

983
3d_armor/api.lua Normal file
View File

@ -0,0 +1,983 @@
--- 3D Armor API
--
-- @topic api
local transparent_armor = minetest.settings:get_bool("armor_transparent", false)
--- Tables
--
-- @section tables
--- Armor definition table used for registering armor.
--
-- @table ArmorDef
-- @tfield string description Human-readable name/description.
-- @tfield string inventory_image Image filename used for icon.
-- @tfield table groups See: `ArmorDef.groups`
-- @tfield table armor_groups See: `ArmorDef.armor_groups`
-- @tfield table damage_groups See: `ArmorDef.damage_groups`
-- @see ItemDef
-- @usage local def = {
-- description = "Wood Helmet",
-- inventory_image = "3d_armor_inv_helmet_wood.png",
-- groups = {armor_head=1, armor_heal=0, armor_use=2000, flammable=1},
-- armor_groups = {fleshy=5},
-- damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
-- }
--- Groups table.
--
-- General groups defining item behavior.
--
-- Some commonly used groups: ***armor\_&lt;type&gt;***, ***armor\_heal***, ***armor\_use***
--
-- @table ArmorDef.groups
-- @tfield int armor_type The armor type. "head", "torso", "hands", "shield", etc.
-- (**Note:** replace "type" with actual type).
-- @tfield int armor_heal Healing value of armor when equipped.
-- @tfield int armor_use Amount of uses/damage before armor "breaks".
-- @see groups
-- @usage groups = {
-- armor_head = 1,
-- armor_heal = 5,
-- armor_use = 2000,
-- flammable = 1,
-- }
--- Armor groups table.
--
-- Groups that this item is effective against when taking damage.
--
-- Some commonly used groups: ***fleshy***
--
-- @table ArmorDef.armor_groups
-- @usage armor_groups = {
-- fleshy = 5,
-- }
--- Damage groups table.
--
-- Groups that this item is effective on when used as a weapon/tool.
--
-- Some commonly used groups: ***cracky***, ***snappy***, ***choppy***, ***crumbly***, ***level***
--
-- @table ArmorDef.damage_groups
-- @see entity_damage_mechanism
-- @usage damage_groups = {
-- cracky = 3,
-- snappy = 2,
-- choppy = 3,
-- crumbly = 2,
-- level = 1,
-- }
--- @section end
-- support for i18n
local S = minetest.get_translator(minetest.get_current_modname())
local skin_previews = {}
local use_player_monoids = minetest.global_exists("player_monoids")
local use_armor_monoid = minetest.global_exists("armor_monoid")
local use_pova_mod = minetest.get_modpath("pova")
local armor_def = setmetatable({}, {
__index = function()
return setmetatable({
groups = setmetatable({}, {
__index = function()
return 0
end})
}, {
__index = function()
return 0
end
})
end,
})
local armor_textures = setmetatable({}, {
__index = function()
return setmetatable({}, {
__index = function()
return "blank.png"
end
})
end
})
armor = {
timer = 0,
elements = {"head", "torso", "legs", "feet"},
physics = {"jump", "speed", "gravity"},
attributes = {"heal", "fire", "water", "feather"},
formspec = "image[2.5,0;2,4;armor_preview]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
default.get_hotbar_bg(0, 4.7)..
"list[current_player;main;0,4.7;8,1;]"..
"list[current_player;main;0,5.85;8,3;8]",
def = armor_def,
textures = armor_textures,
default_skin = "character",
materials = {
wood = "group:wood",
cactus = "default:cactus",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
diamond = "default:diamond",
gold = "default:gold_ingot",
mithril = "moreores:mithril_ingot",
crystal = "ethereal:crystal_ingot",
nether = "nether:nether_ingot",
},
fire_nodes = {
{"nether:lava_source", 5, 8},
{"default:lava_source", 5, 8},
{"default:lava_flowing", 5, 8},
{"fire:basic_flame", 3, 4},
{"fire:permanent_flame", 3, 4},
{"ethereal:crystal_spike", 2, 1},
{"ethereal:fire_flower", 2, 1},
{"nether:lava_crust", 2, 1},
{"default:torch", 1, 1},
{"default:torch_ceiling", 1, 1},
{"default:torch_wall", 1, 1},
},
registered_groups = {["fleshy"]=100},
registered_callbacks = {
on_update = {},
on_equip = {},
on_unequip = {},
on_damage = {},
on_destroy = {},
},
migrate_old_inventory = true,
version = "0.4.13",
get_translator = S
}
armor.config = {
init_delay = 2,
init_times = 10,
bones_delay = 1,
update_time = 1,
drop = minetest.get_modpath("bones") ~= nil,
destroy = false,
level_multiplier = 1,
heal_multiplier = 1,
material_wood = true,
material_cactus = true,
material_steel = true,
material_bronze = true,
material_diamond = true,
material_gold = true,
material_mithril = true,
material_crystal = true,
material_nether = true,
set_elements = "head torso legs feet shield",
set_multiplier = 1.1,
water_protect = true,
fire_protect = minetest.get_modpath("ethereal") ~= nil,
fire_protect_torch = minetest.get_modpath("ethereal") ~= nil,
feather_fall = true,
punch_damage = true,
}
--- Methods
--
-- @section methods
--- Registers a new armor item.
--
-- @function armor:register_armor
-- @tparam string name Armor item technical name (ex: "3d\_armor:helmet\_gold").
-- @tparam ArmorDef def Armor definition table.
-- @usage armor:register_armor("3d_armor:helmet_wood", {
-- description = "Wood Helmet",
-- inventory_image = "3d_armor_inv_helmet_wood.png",
-- groups = {armor_head=1, armor_heal=0, armor_use=2000, flammable=1},
-- armor_groups = {fleshy=5},
-- damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
-- })
armor.register_armor = function(self, name, def)
def.on_secondary_use = function(itemstack, player)
return armor:equip(player, itemstack)
end
def.on_place = function(itemstack, player, pointed_thing)
if pointed_thing.type == "node" and player and not player:get_player_control().sneak then
local node = minetest.get_node(pointed_thing.under)
local ndef = minetest.registered_nodes[node.name]
if ndef and ndef.on_rightclick then
return ndef.on_rightclick(pointed_thing.under, node, player, itemstack, pointed_thing)
end
end
return armor:equip(player, itemstack)
end
-- The below is a very basic check to try and see if a material name exists as part
-- of the item name. However this check is very simple and just checks theres "_something"
-- at the end of the item name and logging an error to debug if not.
local check_mat_exists = string.match(name, "%:.+_(.+)$")
if check_mat_exists == nil then
minetest.log("warning:[3d_armor] Registered armor "..name..
" does not have \"_material\" specified at the end of the item registration name")
end
minetest.register_tool(name, def)
end
--- Registers a new armor group.
--
-- @function armor:register_armor_group
-- @tparam string group Group ID.
-- @tparam int base Base armor value.
armor.register_armor_group = function(self, group, base)
base = base or 100
self.registered_groups[group] = base
if use_armor_monoid then
armor_monoid.register_armor_group(group, base)
end
end
--- Armor Callbacks Registration
--
-- @section callbacks
--- Registers a callback for when player visuals are update.
--
-- @function armor:register_on_update
-- @tparam function func Function to be executed.
-- @see armor:update_player_visuals
-- @usage armor:register_on_update(function(player, index, stack)
-- -- code to execute
-- end)
armor.register_on_update = function(self, func)
if type(func) == "function" then
table.insert(self.registered_callbacks.on_update, func)
end
end
--- Registers a callback for when armor is equipped.
--
-- @function armor:register_on_equip
-- @tparam function func Function to be executed.
-- @usage armor:register_on_equip(function(player, index, stack)
-- -- code to execute
-- end)
armor.register_on_equip = function(self, func)
if type(func) == "function" then
table.insert(self.registered_callbacks.on_equip, func)
end
end
--- Registers a callback for when armor is unequipped.
--
-- @function armor:register_on_unequip
-- @tparam function func Function to be executed.
-- @usage armor:register_on_unequip(function(player, index, stack)
-- -- code to execute
-- end)
armor.register_on_unequip = function(self, func)
if type(func) == "function" then
table.insert(self.registered_callbacks.on_unequip, func)
end
end
--- Registers a callback for when armor is damaged.
--
-- @function armor:register_on_damage
-- @tparam function func Function to be executed.
-- @see armor:damage
-- @usage armor:register_on_damage(function(player, index, stack)
-- -- code to execute
-- end)
armor.register_on_damage = function(self, func)
if type(func) == "function" then
table.insert(self.registered_callbacks.on_damage, func)
end
end
--- Registers a callback for when armor is destroyed.
--
-- @function armor:register_on_destroy
-- @tparam function func Function to be executed.
-- @see armor:damage
-- @usage armor:register_on_destroy(function(player, index, stack)
-- -- code to execute
-- end)
armor.register_on_destroy = function(self, func)
if type(func) == "function" then
table.insert(self.registered_callbacks.on_destroy, func)
end
end
--- @section end
--- Methods
--
-- @section methods
--- Runs callbacks.
--
-- @function armor:run_callbacks
-- @tparam function callback Function to execute.
-- @tparam ObjectRef player First parameter passed to callback.
-- @tparam int index Second parameter passed to callback.
-- @tparam ItemStack stack Callback owner.
armor.run_callbacks = function(self, callback, player, index, stack)
if stack then
local def = stack:get_definition() or {}
if type(def[callback]) == "function" then
def[callback](player, index, stack)
end
end
local callbacks = self.registered_callbacks[callback]
if callbacks then
for _, func in pairs(callbacks) do
func(player, index, stack)
end
end
end
--- Updates visuals.
--
-- @function armor:update_player_visuals
-- @tparam ObjectRef player
armor.update_player_visuals = function(self, player)
if not player then
return
end
local name = player:get_player_name()
if self.textures[name] then
default.player_set_textures(player, {
self.textures[name].skin,
self.textures[name].armor,
self.textures[name].wielditem,
})
end
self:run_callbacks("on_update", player)
end
--- Sets player's armor attributes.
--
-- @function armor:set_player_armor
-- @tparam ObjectRef player
armor.set_player_armor = function(self, player)
local name, armor_inv = self:get_valid_player(player, "[set_player_armor]")
if not name then
return
end
local state = 0
local count = 0
local preview = armor:get_preview(name)
local texture = "3d_armor_trans.png"
local physics = {}
local attributes = {}
local levels = {}
local groups = {}
local change = {}
local set_worn = {}
local armor_multi = 0
local worn_armor = armor:get_weared_armor_elements(player)
for _, phys in pairs(self.physics) do
physics[phys] = 1
end
for _, attr in pairs(self.attributes) do
attributes[attr] = 0
end
for group, _ in pairs(self.registered_groups) do
change[group] = 1
levels[group] = 0
end
local list = armor_inv:get_list("armor")
if type(list) ~= "table" then
return
end
for i, stack in pairs(list) do
if stack:get_count() == 1 then
local def = stack:get_definition()
for _, element in pairs(self.elements) do
if def.groups["armor_"..element] then
if def.armor_groups then
for group, level in pairs(def.armor_groups) do
if levels[group] then
levels[group] = levels[group] + level
end
end
else
local level = def.groups["armor_"..element]
levels["fleshy"] = levels["fleshy"] + level
end
break
end
-- DEPRECATED, use armor_groups instead
if def.groups["armor_radiation"] and levels["radiation"] then
levels["radiation"] = def.groups["armor_radiation"]
end
end
local item = stack:get_name()
local tex = def.texture or item:gsub("%:", "_")
tex = tex:gsub(".png$", "")
local prev = def.preview or tex.."_preview"
prev = prev:gsub(".png$", "")
if not transparent_armor then
texture = texture.."^"..tex..".png"
end
preview = preview.."^"..prev..".png"
state = state + stack:get_wear()
count = count + 1
for _, phys in pairs(self.physics) do
local value = def.groups["physics_"..phys] or 0
physics[phys] = physics[phys] + value
end
for _, attr in pairs(self.attributes) do
local value = def.groups["armor_"..attr] or 0
attributes[attr] = attributes[attr] + value
end
end
end
-- The following code compares player worn armor items against requirements
-- of which armor pieces are needed to be worn to meet set bonus requirements
for loc,item in pairs(worn_armor) do
local item_mat = string.match(item, "%:.+_(.+)$")
local worn_key = item_mat or "unknown"
-- Perform location checks to ensure the armor is worn correctly
for k,set_loc in pairs(armor.config.set_elements)do
if set_loc == loc then
if set_worn[worn_key] == nil then
set_worn[worn_key] = 0
set_worn[worn_key] = set_worn[worn_key] + 1
else
set_worn[worn_key] = set_worn[worn_key] + 1
end
end
end
end
-- Apply the armor multiplier only if the player is wearing a full set of armor
for mat_name,arm_piece_num in pairs(set_worn) do
if arm_piece_num == #armor.config.set_elements then
armor_multi = armor.config.set_multiplier
end
end
for group, level in pairs(levels) do
if level > 0 then
level = level * armor.config.level_multiplier
if armor_multi ~= 0 then
level = level * armor.config.set_multiplier
end
end
local base = self.registered_groups[group]
self.def[name].groups[group] = level
if level > base then
level = base
end
groups[group] = base - level
change[group] = groups[group] / base
end
for _, attr in pairs(self.attributes) do
local mult = attr == "heal" and self.config.heal_multiplier or 1
self.def[name][attr] = attributes[attr] * mult
end
for _, phys in pairs(self.physics) do
self.def[name][phys] = physics[phys]
end
if use_armor_monoid then
armor_monoid.monoid:add_change(player, change, "3d_armor:armor")
else
-- Preserve immortal group (damage disabled for player)
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
player_monoids.speed:add_change(player, physics.speed,
"3d_armor:physics")
player_monoids.jump:add_change(player, physics.jump,
"3d_armor:physics")
player_monoids.gravity:add_change(player, physics.gravity,
"3d_armor:physics")
elseif use_pova_mod then
-- only add the changes, not the default 1.0 for each physics setting
pova.add_override(name, "3d_armor", {
speed = physics.speed - 1,
jump = physics.jump - 1,
gravity = physics.gravity - 1,
})
pova.do_override(player)
else
local player_physics_locked = player:get_meta():get_int("player_physics_locked")
if player_physics_locked == nil or player_physics_locked == 0 then
player:set_physics_override(physics)
end
end
self.textures[name].armor = texture
self.textures[name].preview = preview
self.def[name].level = self.def[name].groups.fleshy or 0
self.def[name].state = state
self.def[name].count = count
self:update_player_visuals(player)
end
--- Action when armor is punched.
--
-- @function armor:punch
-- @tparam ObjectRef player Player wearing the armor.
-- @tparam ObjectRef hitter Entity attacking player.
-- @tparam[opt] int time_from_last_punch Time in seconds since last punch action.
-- @tparam[opt] table tool_capabilities See `entity_damage_mechanism`.
armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabilities)
local name, armor_inv = self:get_valid_player(player, "[punch]")
if not name then
return
end
local set_state
local set_count
local state = 0
local count = 0
local recip = true
local default_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1}
local list = armor_inv:get_list("armor")
for i, stack in pairs(list) do
if stack:get_count() == 1 then
local itemname = stack:get_name()
local use = minetest.get_item_group(itemname, "armor_use") or 0
local damage = use > 0
local def = stack:get_definition() or {}
if type(def.on_punched) == "function" then
damage = def.on_punched(player, hitter, time_from_last_punch,
tool_capabilities) ~= false and damage == true
end
if damage == true and tool_capabilities then
local damage_groups = def.damage_groups or default_groups
local level = damage_groups.level or 0
local groupcaps = tool_capabilities.groupcaps or {}
local uses = 0
damage = false
if next(groupcaps) == nil then
damage = true
end
for group, caps in pairs(groupcaps) do
local maxlevel = caps.maxlevel or 0
local diff = maxlevel - level
if diff == 0 then
diff = 1
end
if diff > 0 and caps.times then
local group_level = damage_groups[group]
if group_level then
local time = caps.times[group_level]
if time then
local dt = time_from_last_punch or 0
if dt > time / diff then
if caps.uses then
uses = caps.uses * math.pow(3, diff)
end
damage = true
break
end
end
end
end
end
if damage == true and recip == true and hitter and
def.reciprocate_damage == true and uses > 0 then
local item = hitter:get_wielded_item()
if item and item:get_name() ~= "" then
item:add_wear(65535 / uses)
hitter:set_wielded_item(item)
end
-- reciprocate tool damage only once
recip = false
end
end
if damage == true and hitter == "fire" then
damage = minetest.get_item_group(itemname, "flammable") > 0
end
if damage == true then
self:damage(player, i, stack, use)
set_state = self.def[name].state
set_count = self.def[name].count
end
state = state + stack:get_wear()
count = count + 1
end
end
if set_count and set_count ~= count then
state = set_state or state
count = set_count or count
end
self.def[name].state = state
self.def[name].count = count
end
--- Action when armor is damaged.
--
-- @function armor:damage
-- @tparam ObjectRef player
-- @tparam int index Inventory index where armor is equipped.
-- @tparam ItemStack stack Armor item receiving damaged.
-- @tparam int use Amount of wear to add to armor item.
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
end
use = math.ceil(use/armor_worn_cnt)
stack:add_wear(use)
self:run_callbacks("on_damage", player, index, stack)
self:set_inventory_stack(player, index, stack)
if stack:get_count() == 0 then
self:run_callbacks("on_unequip", player, index, old_stack)
self:run_callbacks("on_destroy", player, index, old_stack)
self:set_player_armor(player)
end
end
--- Get elements of equipped armor.
--
-- @function armor:get_weared_armor_elements
-- @tparam ObjectRef player
-- @treturn table List of equipped armors.
armor.get_weared_armor_elements = function(self, player)
local name, inv = self:get_valid_player(player, "[get_weared_armor]")
local weared_armor = {}
if not name then
return
end
for i=1, inv:get_size("armor") do
local item_name = inv:get_stack("armor", i):get_name()
local element = self:get_element(item_name)
if element ~= nil then
weared_armor[element] = item_name
end
end
return weared_armor
end
--- Equips a piece of armor to a player.
--
-- @function armor:equip
-- @tparam ObjectRef player Player to whom item is equipped.
-- @tparam ItemStack itemstack Armor item to be equipped.
-- @treturn ItemStack Leftover item stack.
armor.equip = function(self, player, itemstack)
local name, armor_inv = self:get_valid_player(player, "[equip]")
local armor_element = self:get_element(itemstack:get_name())
if name and armor_element then
local index
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
elseif not index and stack:is_empty() then
index = i
end
end
local stack = itemstack:take_item()
armor_inv:set_stack("armor", index, stack)
self:run_callbacks("on_equip", player, index, stack)
self:set_player_armor(player)
self:save_armor_inventory(player)
end
return itemstack
end
--- Unequips a piece of armor from a player.
--
-- @function armor:unequip
-- @tparam ObjectRef player Player from whom item is removed.
-- @tparam string armor_element Armor type identifier associated with the item
-- to be removed ("head", "torso", "hands", "shield", "legs", "feet", etc.).
armor.unequip = function(self, player, armor_element)
local name, armor_inv = self:get_valid_player(player, "[unequip]")
if not name then
return
end
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
armor_inv:set_stack("armor", i, "")
minetest.after(0, function()
local inv = player:get_inventory()
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
minetest.add_item(player:get_pos(), stack)
end
end)
self:run_callbacks("on_unequip", player, i, stack)
self:set_player_armor(player)
self:save_armor_inventory(player)
return
end
end
end
--- Removes all armor worn by player.
--
-- @function armor:remove_all
-- @tparam ObjectRef player
armor.remove_all = function(self, player)
local name, inv = self:get_valid_player(player, "[remove_all]")
if not name then
return
end
inv:set_list("armor", {})
self:set_player_armor(player)
self:save_armor_inventory(player)
end
local skin_mod
--- Retrieves player's current skin.
--
-- @function armor:get_player_skin
-- @tparam string name Player name.
-- @treturn string Skin filename.
armor.get_player_skin = function(self, name)
if (skin_mod == "skins" or skin_mod == "simple_skins") and skins.skins[name] then
return skins.skins[name]..".png"
elseif skin_mod == "u_skins" and u_skins.u_skins[name] then
return u_skins.u_skins[name]..".png"
elseif skin_mod == "wardrobe" and wardrobe.playerSkins and wardrobe.playerSkins[name] then
return wardrobe.playerSkins[name]
end
return armor.default_skin..".png"
end
--- Updates skin.
--
-- @function armor:update_skin
-- @tparam string name Player name.
armor.update_skin = function(self, name)
minetest.after(0, function()
local pplayer = minetest.get_player_by_name(name)
if pplayer then
self.textures[name].skin = self:get_player_skin(name)
self:set_player_armor(pplayer)
end
end)
end
--- Adds preview for armor inventory.
--
-- @function armor:add_preview
-- @tparam string preview Preview image filename.
armor.add_preview = function(self, preview)
skin_previews[preview] = true
end
--- Retrieves preview for armor inventory.
--
-- @function armor:get_preview
-- @tparam string name Player name.
-- @treturn string Preview image filename.
armor.get_preview = function(self, name)
local preview = string.gsub(armor:get_player_skin(name), ".png", "_preview.png")
if skin_previews[preview] then
return preview
end
return "character_preview.png"
end
--- Retrieves armor formspec.
--
-- @function armor:get_armor_formspec
-- @tparam string name Player name.
-- @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
formspec = formspec.."listring[current_player;main]"..
"listring[detached:"..name.."_armor;armor]"
end
formspec = formspec:gsub("armor_preview", armor.textures[name].preview)
formspec = formspec:gsub("armor_level", armor.def[name].level)
for _, attr in pairs(self.attributes) do
formspec = formspec:gsub("armor_attr_"..attr, armor.def[name][attr])
end
for group, _ in pairs(self.registered_groups) do
formspec = formspec:gsub("armor_group_"..group,
armor.def[name].groups[group])
end
return formspec
end
--- Retrieves element.
--
-- @function armor:get_element
-- @tparam string item_name
-- @return Armor element.
armor.get_element = function(self, item_name)
for _, element in pairs(armor.elements) do
if minetest.get_item_group(item_name, "armor_"..element) > 0 then
return element
end
end
end
--- Serializes armor inventory.
--
-- @function armor:serialize_inventory_list
-- @tparam table list Inventory contents.
-- @treturn string
armor.serialize_inventory_list = function(self, list)
local list_table = {}
for _, stack in ipairs(list) do
table.insert(list_table, stack:to_string())
end
return minetest.serialize(list_table)
end
--- Deserializes armor inventory.
--
-- @function armor:deserialize_inventory_list
-- @tparam string list_string Serialized inventory contents.
-- @treturn table
armor.deserialize_inventory_list = function(self, list_string)
local list_table = minetest.deserialize(list_string)
local list = {}
for _, stack in ipairs(list_table or {}) do
table.insert(list, ItemStack(stack))
end
return list
end
--- Loads armor inventory.
--
-- @function armor:load_armor_inventory
-- @tparam ObjectRef player
-- @treturn bool
armor.load_armor_inventory = function(self, player)
local _, inv = self:get_valid_player(player, "[load_armor_inventory]")
if inv then
local meta = player:get_meta()
local armor_list_string = meta:get_string("3d_armor_inventory")
if armor_list_string then
inv:set_list("armor",
self:deserialize_inventory_list(armor_list_string))
return true
end
end
end
--- Saves armor inventory.
--
-- Inventory is stored in `PlayerMetaRef` string "3d\_armor\_inventory".
--
-- @function armor:save_armor_inventory
-- @tparam ObjectRef player
armor.save_armor_inventory = function(self, player)
local _, inv = self:get_valid_player(player, "[save_armor_inventory]")
if inv then
local meta = player:get_meta()
meta:set_string("3d_armor_inventory",
self:serialize_inventory_list(inv:get_list("armor")))
end
end
--- Updates inventory.
--
-- DEPRECATED: Legacy inventory support.
--
-- @function armor:update_inventory
-- @param player
armor.update_inventory = function(self, player)
-- DEPRECATED: Legacy inventory support
end
--- Sets inventory stack.
--
-- @function armor:set_inventory_stack
-- @tparam ObjectRef player
-- @tparam int i Armor inventory index.
-- @tparam ItemStack stack Armor item.
armor.set_inventory_stack = function(self, player, i, stack)
local _, inv = self:get_valid_player(player, "[set_inventory_stack]")
if inv then
inv:set_stack("armor", i, stack)
self:save_armor_inventory(player)
end
end
--- Checks for a player that can use armor.
--
-- @function armor:get_valid_player
-- @tparam ObjectRef player
-- @tparam string msg Additional info for log messages.
-- @treturn list Player name & armor inventory.
-- @usage local name, inv = armor:get_valid_player(player, "[equip]")
armor.get_valid_player = function(self, player, msg)
msg = msg or ""
if not player then
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))
return
end
local inv = minetest.get_inventory({type="detached", name=name.."_armor"})
if not inv then
-- This check may fail when called inside `on_joinplayer`
-- in that case, the armor will be initialized/updated later on
minetest.log("warning", ("3d_armor%s: Detached armor inventory is nil"):format(msg))
return
end
return name, inv
end
--- Drops armor item at given position.
--
-- @tparam vector pos
-- @tparam ItemStack stack Armor item to be dropped.
armor.drop_armor = function(pos, stack)
local node = minetest.get_node_or_nil(pos)
if node then
local obj = minetest.add_item(pos, stack)
if obj then
obj:set_velocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)})
end
end
end
--- Allows skin mod to be set manually.
--
-- Useful for skin mod forks that do not use the same name.
--
-- @tparam string mod Name of skin mod. Recognized names are "simple\_skins", "u\_skins", & "wardrobe".
armor.set_skin_mod = function(mod)
skin_mod = mod
end

View File

@ -0,0 +1,66 @@
-- DEPRECATED, will not be supported in future versions
-- See README.txt for new configuration options.
-- Armor Configuration (defaults)
-- You can remove any unwanted armor materials from this table.
-- Note that existing armor that is removed will show up as an unknown item.
ARMOR_MATERIALS = {
wood = "group:wood",
cactus = "default:cactus",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
diamond = "default:diamond",
gold = "default:gold_ingot",
mithril = "moreores:mithril_ingot",
crystal = "ethereal:crystal_ingot",
nether = "nether:nether_ingot",
}
-- Enable fire protection (defaults true if using ethereal mod)
ARMOR_FIRE_PROTECT = false
-- Fire protection nodes, (name, protection level, damage)
ARMOR_FIRE_NODES = {
{"default:lava_source", 5, 4},
{"default:lava_flowing", 5, 4},
{"fire:basic_flame", 3, 4},
{"fire:permanent_flame", 3, 4},
{"ethereal:crystal_spike", 2, 1},
{"ethereal:fire_flower", 2, 1},
{"default:torch", 1, 1},
}
-- 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
-- How often player armor/wield items are updated.
ARMOR_UPDATE_TIME = 1
-- Drop armor when a player dies.
-- Uses bones mod if present, otherwise items are dropped around the player.
ARMOR_DROP = true
-- Pulverise armor when a player dies, overrides ARMOR_DROP.
ARMOR_DESTROY = false
-- You can use this to increase or decrease overall armor effectiveness,
-- eg: ARMOR_LEVEL_MULTIPLIER = 0.5 will reduce armor level by half.
ARMOR_LEVEL_MULTIPLIER = 1
-- You can use this to increase or decrease overall armor healing,
-- eg: ARMOR_HEAL_MULTIPLIER = 0 will disable healing altogether.
ARMOR_HEAL_MULTIPLIER = 1
-- You can use this to increase or decrease overall armor radiation protection,
-- eg: ARMOR_RADIATION_MULTIPLIER = 0 will completely disable radiation protection.
-- Note: patched technic mod is required
ARMOR_RADIATION_MULTIPLIER = 1

View File

@ -1,91 +0,0 @@
armor_api = {
player_hp = {},
}
armor_api.get_armor_textures = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local textures = {}
local player_inv = player:get_inventory()
for _,v in ipairs({"head", "torso", "legs"}) do
local stack = player_inv:get_stack("armor_"..v, 1)
if stack:get_definition().groups["armor_"..v] then
local item = stack:get_name()
textures[v] = item:gsub("%:", "_")..".png"
end
end
local stack = player_inv:get_stack("armor_shield", 1)
if stack:get_definition().groups["armor_shield"] then
local item = stack:get_name()
textures["shield"] = minetest.registered_items[item].inventory_image
end
return textures
end
armor_api.set_player_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local player_inv = player:get_inventory()
local armor_level = 0
for _,v in ipairs({"head", "torso", "legs", "shield"}) do
local stack = player_inv:get_stack("armor_"..v, 1)
local armor = stack:get_definition().groups["armor_"..v] or 0
armor_level = armor_level + armor
end
local armor_groups = {fleshy=100}
if armor_level > 0 then
armor_groups.level = math.floor(armor_level / 20)
armor_groups.fleshy = 100 - armor_level
end
player:set_armor_groups(armor_groups)
uniskins:update_player_visuals(player)
end
armor_api.update_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local hp = player:get_hp()
if hp == nil or hp == 0 or hp == self.player_hp[name] then
return
end
if self.player_hp[name] > hp then
local player_inv = player:get_inventory()
local armor_inv = minetest.get_inventory({type="detached", name=name.."_outfit"})
if armor_inv == nil then
return
end
local heal_max = 0
for _,v in ipairs({"head", "torso", "legs", "shield"}) do
local stack = armor_inv:get_stack("armor_"..v, 1)
if stack:get_count() > 0 then
local use = stack:get_definition().groups["armor_use"] or 0
local heal = stack:get_definition().groups["armor_heal"] or 0
local item = stack:get_name()
stack:add_wear(use)
armor_inv:set_stack("armor_"..v, 1, stack)
player_inv:set_stack("armor_"..v, 1, stack)
if stack:get_count() == 0 then
local desc = minetest.registered_items[item].description
if desc then
minetest.chat_send_player(name, "Your "..desc.." got destroyed!")
end
self:set_player_armor(player)
end
heal_max = heal_max + heal
end
end
if heal_max > math.random(100) then
player:set_hp(self.player_hp[name])
return
end
end
self.player_hp[name] = hp
end

View File

@ -12,8 +12,14 @@ Helmets:
+---+---+---+
[3d_armor:helmet_wood] X = [default:wood]
[3d_armor:helmet_cactus] X = [default:cactus]
[3d_armor:helmet_steel] X = [default:steel_ingot]
[3d_armor:helmet_bronze] X = [default:bronze_ingot]
[3d_armor:helmet_diamond] X = [default:diamond]
[3d_armor:helmet_gold] X = [default:gold_ingot]
[3d_armor:helmet_mithril] X = [moreores:mithril_ingot] *
[3d_armor:helmet_crystal] X = [ethereal:crystal_ingot] **
[3d_armor:helmet_nether] X = [ethereal:nether_ingot] **
Chestplates:
@ -26,8 +32,14 @@ Chestplates:
+---+---+---+
[3d_armor:chestplate_wood] X = [default:wood]
[3d_armor:chestplate_cactus] X = [default:cactus]
[3d_armor:chestplate_steel] X = [default:steel_ingot]
[3d_armor:chestplate_bronze] X = [default:bronze_ingot]
[3d_armor:chestplate_diamond] X = [default:diamond]
[3d_armor:chestplate_gold] X = [default:gold_ingot]
[3d_armor:chestplate_mithril] X = [moreores:mithril_ingot] *
[3d_armor:chestplate_crystal] X = [ethereal:crystal_ingot] **
[3d_armor:chestplate_nether] X = [ethereal:nether_ingot] **
Leggings:
@ -40,35 +52,33 @@ Leggings:
+---+---+---+
[3d_armor:leggings_wood] X = [default:wood]
[3d_armor:leggings_cactus] X = [default:cactus]
[3d_armor:leggings_steel] X = [default:steel_ingot]
[3d_armor:leggings_bronze] X = [default:bronze_ingot]
[3d_armor:leggings_diamond] X = [default:diamond]
[3d_armor:leggings_gold] X = [default:gold_ingot]
[3d_armor:leggings_mithril] X = [moreores:mithril_ingot] *
[3d_armor:leggings_crystal] X = [ethereal:crystal_ingot] **
[3d_armor:leggings_nether] X = [ethereal:nether_ingot] **
Shields:
Boots:
+---+---+---+
| X | X | X |
| X | | X |
+---+---+---+
| X | X | X |
+---+---+---+
| | X | |
| X | | X |
+---+---+---+
[3d_armor:shield_wood] X = [default:wood]
[3d_armor:shield_steel] X = [default:steel_ingot]
[3d_armor:shield_bronze] X = [default:bronze_ingot
Enhanced Wooden Shield:
SI = [default:steel_ingot]
WS = [3d_armor:shield_wood]
+----+
| SI |
+----+
| WS |
+----+
| SI |
+----+
[3d_armor:shield_enhanced_wood]
[3d_armor:boots_wood] X = [default:wood]
[3d_armor:boots_cactus] X = [default:cactus]
[3d_armor:boots_steel] X = [default:steel_ingot]
[3d_armor:boots_bronze] X = [default:bronze_ingot
[3d_armor:boots_diamond] X = [default:diamond]
[3d_armor:boots_gold] X = [default:gold_ingot]
[3d_armor:boots_mithril] X = [moreores:mithril_ingot] *
[3d_armor:boots_crystal] X = [ethereal:crystal_ingot] **
[3d_armor:boots_nether] X = [ethereal:nether_ingot] **
* Requires moreores mod by Calinou - https://forum.minetest.net/viewtopic.php?id=549
** Requires ethereal mod by Chinchow & TenPlus1 - https://github.com/tenplus1/ethereal
** Requires nether mod - https://github.com/minetest-mods/nether.git

View File

@ -1,3 +0,0 @@
default
inventory_plus
unified_skins

View File

@ -1,231 +1,521 @@
dofile(minetest.get_modpath(minetest.get_current_modname()).."/armor_api.lua")
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local worldpath = minetest.get_worldpath()
local last_punch_time = {}
local pending_players = {}
local timer = 0
local time = 0
local update_time = tonumber(minetest.setting_get("3d_armor_update_time"))
if not update_time then
update_time = 1
minetest.setting_set("3d_armor_update_time", tostring(update_time))
dofile(modpath.."/api.lua")
-- local functions
local F = minetest.formspec_escape
local S = armor.get_translator
-- integration test
if minetest.settings:get_bool("enable_3d_armor_integration_test") then
dofile(modpath.."/integration_test.lua")
end
-- Regisiter Head Armor
minetest.register_tool("3d_armor:helmet_wood", {
description = "Wood Helmet",
inventory_image = "3d_armor_inv_helmet_wood.png",
groups = {armor_head=5, armor_heal=0, armor_use=1000},
wear = 0,
})
-- Legacy Config Support
minetest.register_tool("3d_armor:helmet_steel", {
description = "Steel Helmet",
inventory_image = "3d_armor_inv_helmet_steel.png",
groups = {armor_head=10, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_bronze", {
description = "Bronze Helmet",
inventory_image = "3d_armor_inv_helmet_bronze.png",
groups = {armor_head=15, armor_heal=10, armor_use=100},
wear = 0,
})
-- Regisiter Torso Armor
minetest.register_tool("3d_armor:chestplate_wood", {
description = "Wood Chestplate",
inventory_image = "3d_armor_inv_chestplate_wood.png",
groups = {armor_torso=10, armor_heal=0, armor_use=1000},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_steel", {
description = "Steel Chestplate",
inventory_image = "3d_armor_inv_chestplate_steel.png",
groups = {armor_torso=15, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_bronze", {
description = "Bronze Chestplate",
inventory_image = "3d_armor_inv_chestplate_bronze.png",
groups = {armor_torso=25, armor_heal=10, armor_use=100},
wear = 0,
})
-- Regisiter Leg Armor
minetest.register_tool("3d_armor:leggings_wood", {
description = "Wood Leggings",
inventory_image = "3d_armor_inv_leggings_wood.png",
groups = {armor_legs=5, armor_heal=0, armor_use=1000},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_steel", {
description = "Steel Leggings",
inventory_image = "3d_armor_inv_leggings_steel.png",
groups = {armor_legs=10, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_bronze", {
description = "Bronze Leggings",
inventory_image = "3d_armor_inv_leggings_bronze.png",
groups = {armor_legs=15, armor_heal=10, armor_use=100},
wear = 0,
})
-- Regisiter Shields
minetest.register_tool("3d_armor:shield_wood", {
description = "Wooden Shield",
inventory_image = "3d_armor_inv_shield_wood.png",
groups = {armor_shield=10, armor_heal=0, armor_use=1000},
wear = 0,
})
minetest.register_tool("3d_armor:shield_enhanced_wood", {
description = "Enhanced Wooden Shield",
inventory_image = "3d_armor_inv_shield_enhanced_wood.png",
groups = {armor_shield=15, armor_heal=5, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:shield_steel", {
description = "Steel Shield",
inventory_image = "3d_armor_inv_shield_steel.png",
groups = {armor_shield=20, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:shield_bronze", {
description = "Bronze Shield",
inventory_image = "3d_armor_inv_shield_bronze.png",
groups = {armor_shield=25, armor_heal=10, armor_use=100},
wear = 0,
})
-- Register Craft Recipies
local craft_ingreds = {
wood = "default:wood",
steel = "default:steel_ingot",
bronze = "default:bronze_ingot",
}
for k, v in pairs(craft_ingreds) do
minetest.register_craft({
output = "3d_armor:helmet_"..k,
recipe = {
{v, v, v},
{v, "", v},
{"", "", ""},
},
})
minetest.register_craft({
output = "3d_armor:chestplate_"..k,
recipe = {
{v, "", v},
{v, v, v},
{v, v, v},
},
})
minetest.register_craft({
output = "3d_armor:leggings_"..k,
recipe = {
{v, v, v},
{v, "", v},
{v, "", v},
},
})
minetest.register_craft({
output = "3d_armor:shield_"..k,
recipe = {
{v, v, v},
{v, v, v},
{"", v, ""},
},
})
local input = io.open(modpath.."/armor.conf", "r")
if input then
dofile(modpath.."/armor.conf")
input:close()
end
input = io.open(worldpath.."/armor.conf", "r")
if input then
dofile(worldpath.."/armor.conf")
input:close()
end
for name, _ in pairs(armor.config) do
local global = "ARMOR_"..name:upper()
if minetest.global_exists(global) then
armor.config[name] = _G[global]
end
end
if minetest.global_exists("ARMOR_MATERIALS") then
armor.materials = table.copy(ARMOR_MATERIALS)
end
if minetest.global_exists("ARMOR_FIRE_NODES") then
armor.fire_nodes = table.copy(ARMOR_FIRE_NODES)
end
minetest.register_craft({
output = "3d_armor:shield_enhanced_wood",
recipe = {
{"default:steel_ingot"},
{"3d_armor:shield_wood"},
{"default:steel_ingot"},
-- Load Configuration
for name, config in pairs(armor.config) do
local setting = minetest.settings:get("armor_"..name)
if type(config) == "number" then
setting = tonumber(setting)
elseif type(config) == "string" then
setting = tostring(setting)
elseif type(config) == "boolean" then
setting = minetest.settings:get_bool("armor_"..name)
end
if setting ~= nil then
armor.config[name] = setting
end
end
for material, _ in pairs(armor.materials) do
local key = "material_"..material
if armor.config[key] == false then
armor.materials[material] = nil
end
end
-- Convert set_elements to a Lua table splitting on blank spaces
local t_set_elements = armor.config.set_elements
armor.config.set_elements = string.split(t_set_elements, " ")
-- Remove torch damage if fire_protect_torch == false
if armor.config.fire_protect_torch == false and armor.config.fire_protect == true then
for k,v in pairs(armor.fire_nodes) do
for k2,v2 in pairs(v) do
if string.find (v2,"torch") then
armor.fire_nodes[k] = nil
end
end
end
end
-- Mod Compatibility
if minetest.get_modpath("technic") then
armor.formspec = armor.formspec..
"label[5,2.5;"..F(S("Radiation"))..": armor_group_radiation]"
armor:register_armor_group("radiation")
end
local skin_mods = {"skins", "u_skins", "simple_skins", "wardrobe"}
for _, mod in pairs(skin_mods) do
local path = minetest.get_modpath(mod)
if path then
local dir_list = minetest.get_dir_list(path.."/textures")
for _, fn in pairs(dir_list) do
if fn:find("_preview.png$") then
armor:add_preview(fn)
end
end
armor.set_skin_mod(mod)
end
end
-- Armor Initialization
armor.formspec = armor.formspec..
"label[5,1;"..F(S("Level"))..": armor_level]"..
"label[5,1.5;"..F(S("Heal"))..": armor_attr_heal]"
if armor.config.fire_protect then
armor.formspec = armor.formspec.."label[5,2;"..F(S("Fire"))..": armor_attr_fire]"
end
armor:register_on_damage(function(player, index, stack)
local name = player:get_player_name()
local def = stack:get_definition()
if name and def and def.description and stack:get_wear() > 60100 then
minetest.chat_send_player(name, S("Your @1 is almost broken!", def.description))
minetest.sound_play("default_tool_breaks", {to_player = name, gain = 2.0})
end
end)
armor:register_on_destroy(function(player, index, stack)
local name = player:get_player_name()
local def = stack:get_definition()
if name and def and def.description then
minetest.chat_send_player(name, S("Your @1 got destroyed!", def.description))
minetest.sound_play("default_tool_breaks", {to_player = name, gain = 2.0})
end
end)
local function validate_armor_inventory(player)
-- Workaround for detached inventory swap exploit
local _, inv = armor:get_valid_player(player, "[validate_armor_inventory]")
local pos = player:get_pos()
if not inv then
return
end
local armor_prev = {}
local attribute_meta = player:get_meta() -- I know, the function's name is weird but let it be like that. ;)
local armor_list_string = attribute_meta:get_string("3d_armor_inventory")
if armor_list_string then
local armor_list = armor:deserialize_inventory_list(armor_list_string)
for i, stack in ipairs(armor_list) do
if stack:get_count() > 0 then
armor_prev[stack:get_name()] = i
end
end
end
local elements = {}
local player_inv = player:get_inventory()
for i = 1, 6 do
local stack = inv:get_stack("armor", i)
if stack:get_count() > 0 then
local item = stack:get_name()
local element = armor:get_element(item)
if element and not elements[element] then
if armor_prev[item] then
armor_prev[item] = nil
else
-- Item was not in previous inventory
armor:run_callbacks("on_equip", player, i, stack)
end
elements[element] = true;
else
inv:remove_item("armor", stack)
minetest.item_drop(stack, player, pos)
-- The following code returns invalid items to the player's main
-- inventory but could open up the possibity for a hacked client
-- to receive items back they never really had. I am not certain
-- so remove the is_singleplayer check at your own risk :]
if minetest.is_singleplayer() and player_inv and
player_inv:room_for_item("main", stack) then
player_inv:add_item("main", stack)
end
end
end
end
for item, i in pairs(armor_prev) do
local stack = ItemStack(item)
-- Previous item is not in current inventory
armor:run_callbacks("on_unequip", player, i, stack)
end
end
local function init_player_armor(initplayer)
local name = initplayer:get_player_name()
local pos = initplayer:get_pos()
if not name or not pos then
return false
end
local armor_inv = minetest.create_detached_inventory(name.."_armor", {
on_put = function(inv, listname, index, stack, player)
validate_armor_inventory(player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
end,
on_take = function(inv, listname, index, stack, player)
validate_armor_inventory(player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
validate_armor_inventory(player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
end,
allow_put = function(inv, listname, index, put_stack, player)
if player:get_player_name() ~= name then
return 0
end
local element = armor:get_element(put_stack:get_name())
if not element then
return 0
end
for i = 1, 6 do
local stack = inv:get_stack("armor", i)
local def = stack:get_definition() or {}
if def.groups and def.groups["armor_"..element]
and i ~= index then
return 0
end
end
return 1
end,
allow_take = function(inv, listname, index, stack, player)
if player:get_player_name() ~= name then
return 0
end
--cursed items cannot be unequiped by the player
local is_cursed = minetest.get_item_group(stack:get_name(), "cursed") ~= 0
if not minetest.is_creative_enabled(player) and is_cursed then
return 0
end
return stack:get_count()
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
if player:get_player_name() ~= name then
return 0
end
return count
end,
}, name)
armor_inv:set_size("armor", 6)
if not armor:load_armor_inventory(initplayer) and armor.migrate_old_inventory then
local player_inv = initplayer:get_inventory()
player_inv:set_size("armor", 6)
for i=1, 6 do
local stack = player_inv:get_stack("armor", i)
armor_inv:set_stack("armor", i, stack)
end
armor:save_armor_inventory(initplayer)
player_inv:set_size("armor", 0)
end
for i=1, 6 do
local stack = armor_inv:get_stack("armor", i)
if stack:get_count() > 0 then
armor:run_callbacks("on_equip", initplayer, i, stack)
end
end
armor.def[name] = {
init_time = minetest.get_gametime(),
level = 0,
state = 0,
count = 0,
groups = {},
}
for _, phys in pairs(armor.physics) do
armor.def[name][phys] = 1
end
for _, attr in pairs(armor.attributes) do
armor.def[name][attr] = 0
end
for group, _ in pairs(armor.registered_groups) do
armor.def[name].groups[group] = 0
end
local skin = armor:get_player_skin(name)
armor.textures[name] = {
skin = skin,
armor = "3d_armor_trans.png",
wielditem = "3d_armor_trans.png",
preview = armor.default_skin.."_preview.png",
}
local texture_path = minetest.get_modpath("player_textures")
if texture_path then
local dir_list = minetest.get_dir_list(texture_path.."/textures")
for _, fn in pairs(dir_list) do
if fn == "player_"..name..".png" then
armor.textures[name].skin = fn
break
end
end
end
armor:set_player_armor(initplayer)
return true
end
-- Armor Player Model
player_api.register_model("3d_armor_character.b3d", {
animation_speed = 30,
textures = {
armor.default_skin..".png",
"3d_armor_trans.png",
"3d_armor_trans.png",
},
animations = {
stand = {x=0, y=79},
lay = {x=162, y=166},
walk = {x=168, y=187},
mine = {x=189, y=198},
walk_mine = {x=200, y=219},
sit = {x=81, y=160},
-- compatibility w/ the emote mod
wave = {x = 192, y = 196, override_local = true},
point = {x = 196, y = 196, override_local = true},
freeze = {x = 205, y = 205, override_local = true},
},
})
-- Register Callbacks
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
if fields.outfit then
inventory_plus.set_inventory_formspec(player, "size[8,7.5]"
.."button[0,0;2,0.5;main;Back]"
.."list[current_player;main;0,3.5;8,4;]"
.."list[detached:"..name.."_outfit;armor_head;3,0;1,1;]"
.."list[detached:"..name.."_outfit;armor_torso;3,1;1,1;]"
.."list[detached:"..name.."_outfit;armor_legs;3,2;1,1;]"
.."list[detached:"..name.."_outfit;armor_shield;4,1;1,1;]")
local name = armor:get_valid_player(player, "[on_player_receive_fields]")
if not name then
return
end
local player_name = player:get_player_name()
for field, _ in pairs(fields) do
if string.sub(field,0,string.len("skins_set_")) == "skins_set_" then
minetest.after(0, function(player)
armor_api:set_player_armor(player)
end, player)
if string.find(field, "skins_set") then
armor:update_skin(player_name)
end
end
end)
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player,"outfit", "Outfit")
local player_inv = player:get_inventory()
local name = player:get_player_name()
local armor_inv = minetest.create_detached_inventory(name.."_outfit",{
on_put = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, stack)
armor_api:set_player_armor(player)
end,
on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, nil)
armor_api:set_player_armor(player)
end,
allow_put = function(inv, listname, index, stack, player)
if inv:is_empty(listname) then
return 1
end
return 0
end,
allow_take = function(inv, listname, index, stack, player)
return stack:get_count()
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
for _,v in ipairs({"head", "torso", "legs", "shield"}) do
local armor = "armor_"..v
player_inv:set_size(armor, 1)
armor_inv:set_size(armor, 1)
armor_inv:set_stack(armor, 1, player_inv:get_stack(armor, 1))
end
armor_api.player_hp[name] = 0
minetest.after(0, function(player)
armor_api:set_player_armor(player)
end, player)
default.player_set_model(player, "3d_armor_character.b3d")
local player_name = player:get_player_name()
minetest.after(0, function()
-- TODO: Added in 7566ecc - What's the prupose?
local pplayer = minetest.get_player_by_name(player_name)
if pplayer and init_player_armor(pplayer) == false then
pending_players[pplayer] = 0
end
end)
end)
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
if name then
armor.def[name] = nil
armor.textures[name] = nil
end
pending_players[player] = nil
end)
if armor.config.drop == true or armor.config.destroy == true then
minetest.register_on_dieplayer(function(player)
local name, armor_inv = armor:get_valid_player(player, "[on_dieplayer]")
if not name then
return
end
local drop = {}
for i=1, armor_inv:get_size("armor") do
local stack = armor_inv:get_stack("armor", i)
if stack:get_count() > 0 then
--soulbound armors remain equipped after death
if minetest.get_item_group(stack:get_name(), "soulbound") == 0 then
table.insert(drop, stack)
armor:run_callbacks("on_unequip", player, i, stack)
armor_inv:set_stack("armor", i, nil)
end
end
end
armor:save_armor_inventory(player)
armor:set_player_armor(player)
local pos = player:get_pos()
if pos and armor.config.destroy == false then
minetest.after(armor.config.bones_delay, function()
local meta = nil
local maxp = vector.add(pos, 16)
local minp = vector.subtract(pos, 16)
local bones = minetest.find_nodes_in_area(minp, maxp, {"bones:bones"})
for _, p in pairs(bones) do
local m = minetest.get_meta(p)
if m:get_string("owner") == name then
meta = m
break
end
end
if meta then
local inv = meta:get_inventory()
for _,stack in ipairs(drop) do
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
armor.drop_armor(pos, stack)
end
end
else
for _,stack in ipairs(drop) do
armor.drop_armor(pos, stack)
end
end
end)
end
end)
minetest.register_on_respawnplayer(function(player)
-- reset un-dropped armor and it's effects
armor:set_player_armor(player)
end)
end
if armor.config.punch_damage == true then
minetest.register_on_punchplayer(function(player, hitter,
time_from_last_punch, tool_capabilities)
local name = player:get_player_name()
local hit_ip = hitter:is_player()
if name and hit_ip and minetest.is_protected(player:get_pos(), "") then
return
elseif name then
armor:punch(player, hitter, time_from_last_punch, tool_capabilities)
last_punch_time[name] = minetest.get_gametime()
end
end)
end
minetest.register_on_player_hpchange(function(player, hp_change, reason)
if not minetest.is_player(player) then
return hp_change
end
if reason.type == "drown" or reason.hunger or hp_change >= 0 then
return hp_change
end
local name = player:get_player_name()
local properties = player:get_properties()
local hp = player:get_hp()
if hp + hp_change < properties.hp_max then
local heal = armor.def[name].heal
if heal >= math.random(100) then
hp_change = 0
end
-- check if armor damage was handled by fire or on_punchplayer
local time = last_punch_time[name] or 0
if time == 0 or time + 1 < minetest.get_gametime() then
armor:punch(player)
end
end
return hp_change
end, true)
minetest.register_globalstep(function(dtime)
time = time + dtime
if time > update_time then
for _,player in ipairs(minetest.get_connected_players()) do
armor_api:update_armor(player)
timer = timer + dtime
if armor.config.feather_fall == true then
for _,player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name()
if armor.def[name].feather > 0 then
local vel_y = player:get_velocity().y
if vel_y < 0 and vel_y < 3 then
vel_y = -(vel_y * 0.05)
player:add_velocity({x = 0, y = vel_y, z = 0})
end
end
end
end
if timer <= armor.config.init_delay then
return
end
timer = 0
for player, count in pairs(pending_players) do
local remove = init_player_armor(player) == true
pending_players[player] = count + 1
if remove == false and count > armor.config.init_times then
minetest.log("warning", "3d_armor: Failed to initialize player")
remove = true
end
if remove == true then
pending_players[player] = nil
end
end
-- water breathing protection, added by TenPlus1
if armor.config.water_protect == true then
for _,player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name()
if armor.def[name].water > 0 and
player:get_breath() < 10 then
player:set_breath(10)
end
end
time = 0
end
end)
if armor.config.fire_protect == true then
-- make torches hurt
minetest.override_item("default:torch", {damage_per_second = 1})
minetest.override_item("default:torch_wall", {damage_per_second = 1})
minetest.override_item("default:torch_ceiling", {damage_per_second = 1})
-- check player damage for any hot nodes we may be protected against
minetest.register_on_player_hpchange(function(player, hp_change, reason)
if reason.type == "node_damage" and reason.node then
-- fire protection
if armor.config.fire_protect == true and hp_change < 0 then
local name = player:get_player_name()
for _,igniter in pairs(armor.fire_nodes) do
if reason.node == igniter[1] then
if armor.def[name].fire >= igniter[2] then
hp_change = 0
end
end
end
end
end
return hp_change
end, true)
end

View File

@ -0,0 +1,25 @@
minetest.log("warning", "[TEST] integration-test enabled!")
minetest.register_on_mods_loaded(function()
minetest.after(1, function()
local data = minetest.write_json({ success = true }, true);
local file = io.open(minetest.get_worldpath().."/integration_test.json", "w" );
if file then
file:write(data)
file:close()
end
file = io.open(minetest.get_worldpath().."/registered_nodes.txt", "w" );
if file then
for name in pairs(minetest.registered_nodes) do
file:write(name .. '\n')
end
file:close()
end
minetest.log("warning", "[TEST] integration tests done!")
minetest.request_shutdown("success")
end)
end)

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Strahlen
Level=Stufe
Heal=Heilen
Fire=Feuer
Your @1 is almost broken!=Deine @1 ist fast kaputt!
Your @1 got destroyed!=Deine @1 wurde zerstört!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Radiado
Level=Nivelo
Heal=Sanigi
Fire=Fajro
Your @1 is almost broken!=Via @1 estas preskaŭ rompita!
Your @1 got destroyed!=Via @1 detruiĝis!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Radiación
Level=Nivel
Heal=Salud
Fire=Fuego
Your @1 is almost broken!=¡Tu @1 esta a punto de romperse!
Your @1 got destroyed!=¡Tu @1 fue destruído!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Radiation
Level=Niveau
Heal=Soins
Fire=Fire
Your @1 is almost broken!=Une partie de votre armure est presque détruite : @1 !
Your @1 got destroyed!=Une partie de votre armure a été détruite : @1 !

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Radiazione
Level=Livello
Heal=Guarigione
Fire=Fuoco
Your @1 is almost broken!=@1 quasi in frantumi!
Your @1 got destroyed!=@1 in frantumi!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Radiasi
Level=Tahap
Heal=Pulih
Fire=Api
Your @1 is almost broken!=
Your @1 got destroyed!=@1 anda telah musnah!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Radiação
Level=Nível
Heal=Saúde
Fire=Fogo
Your @1 is almost broken!=
Your @1 got destroyed!=@1 foi destruído(a)!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Radiação
Level=Nível
Heal=Saúde
Fire=Fogo
Your @1 is almost broken!=
Your @1 got destroyed!=@1 foi destruído(a)!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=излучение
Level=уровень
Heal=исцеление
Fire=огонь
Your @1 is almost broken!=
Your @1 got destroyed!=твой(и) @1 был(и) разрушен(ы)!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=Strålning
Level=Nivå
Heal=Läkning
Fire=Eld
Your @1 is almost broken!=Din @1 är nästan förstörd!
Your @1 got destroyed!=Din @1 blev förstörd!

View File

@ -0,0 +1,7 @@
# textdomain: 3d_armor
Radiation=
Level=
Heal=
Fire=
Your @1 is almost broken!=
Your @1 got destroyed!=

4
3d_armor/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = 3d_armor
depends = default, player_api
optional_depends = player_monoids, armor_monoid, pova, moreores
description = Adds craftable armor that is visible to other players.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

7
3d_armor/tools/README.md Normal file
View File

@ -0,0 +1,7 @@
# Intllib tool
please consider using the intllib tool to update locale files:
```../../intllib/tools/xgettext.sh ../**/*.lua```
make sure you are in `3d_armor` derectory before running this command

24
3d_armor/tools/updatepo.sh Executable file
View File

@ -0,0 +1,24 @@
#! /bin/bash
# To create a new translation:
# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot
cd "$(dirname "${BASH_SOURCE[0]}")/..";
# Extract translatable strings.
xgettext --from-code=UTF-8 \
--language=Lua \
--sort-by-file \
--keyword=S \
--keyword=NS:1,2 \
--keyword=N_ \
--add-comments='Translators:' \
--add-location=file \
-o locale/template.pot \
$(find .. -name '*.lua')
# Update translations.
find locale -name '*.po' | while read -r file; do
echo $file
msgmerge --update $file locale/template.pot;
done

18
3d_armor_ip/LICENSE.txt Normal file
View File

@ -0,0 +1,18 @@
[mod] 3d Armor integration to inventory plus [3d_armor_ip]
==========================================================
Copyright (C) 2012-2019 stujones11, Stuart Jones <stujones111@gmail.com>
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.

38
3d_armor_ip/init.lua Normal file
View File

@ -0,0 +1,38 @@
-- support for i18n
local S = minetest.get_translator(minetest.get_current_modname())
local F = minetest.formspec_escape
if not minetest.global_exists("inventory_plus") then
minetest.log("warning", "3d_armor_ip: Mod loaded but unused.")
return
end
armor.formspec = "size[8,8.5]button[6,0;2,0.5;main;"..F(S("Back")).."]"..armor.formspec
armor:register_on_update(function(player)
local name = player:get_player_name()
local formspec = armor:get_armor_formspec(name, true)
local page = player:get_inventory_formspec()
if page:find("detached:"..name.."_armor") then
inventory_plus.set_inventory_formspec(player, formspec)
end
end)
if minetest.get_modpath("crafting") then
inventory_plus.get_formspec = function(player, page)
end
end
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player,"armor", S("Armor"))
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.armor then
local name = armor:get_valid_player(player, "[on_player_receive_fields]")
if not name then
return
end
local formspec = armor:get_armor_formspec(name, true)
inventory_plus.set_inventory_formspec(player, formspec)
end
end)

View File

@ -0,0 +1,3 @@
# textdomain: 3d_armor_ip
Back=Dorso
Armor=Kiraso

View File

@ -0,0 +1,3 @@
# textdomain: 3d_armor_ip
Back=Retour
Armor=Armure

View File

@ -0,0 +1,3 @@
# textdomain: 3d_armor_ip
Back=Voltar
Armor=Armadura

View File

@ -0,0 +1,3 @@
# textdomain: 3d_armor_ip
Back=Tillbaka
Armor=Rustning

View File

@ -0,0 +1,3 @@
# textdomain: 3d_armor_ip
Back=
Armor=

4
3d_armor_ip/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = 3d_armor_ip
depends = 3d_armor
optional_depends = inventory_plus
description = Adds 3d_armor page to the inventory plus.

View File

@ -0,0 +1,18 @@
[mod] 3d Armor sfinv integration [3d_armor_sfinv]
=================================================
Copyright (C) 2012-2019 stujones11, Stuart Jones <stujones111@gmail.com>
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.

21
3d_armor_sfinv/init.lua Normal file
View File

@ -0,0 +1,21 @@
-- support for i18n
local S = minetest.get_translator(minetest.get_current_modname())
if not minetest.global_exists("sfinv") then
minetest.log("warning", "3d_armor_sfinv: Mod loaded but unused.")
return
end
sfinv.register_page("3d_armor:armor", {
title = S("Armor"),
get = function(self, player, context)
local name = player:get_player_name()
local formspec = armor:get_armor_formspec(name, true)
return sfinv.make_formspec(player, context, formspec, false)
end
})
armor:register_on_update(function(player)
if sfinv.enabled then
sfinv.set_player_inventory_formspec(player)
end
end)

View File

@ -0,0 +1,2 @@
# textdomain: 3d_armor_sfinv
Armor=Kiraso

View File

@ -0,0 +1,2 @@
# textdomain: 3d_armor_sfinv
Armor=Armadura

View File

@ -0,0 +1,2 @@
# textdomain: 3d_armor_sfinv
Armor=Armure

View File

@ -0,0 +1,2 @@
# textdomain: 3d_armor_sfinv
Armor=Armadura

View File

@ -0,0 +1,2 @@
# textdomain: 3d_armor_sfinv
Armor=Rustning

View File

@ -0,0 +1,2 @@
# textdomain: 3d_armor_sfinv
Armor=

4
3d_armor_sfinv/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = 3d_armor_sfinv
depends = 3d_armor
optional_depends = sfinv
description = Adds 3d_armor page to the sfinv inventory.

View File

@ -0,0 +1,43 @@
[mod] 3d Armor Stand [3d_armor_stand]
=====================================
License Source Code
-------------------
Copyright (C) 2012-2019 stujones11, Stuart Jones <stujones111@gmail.com>
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.
Lecense Models
--------------
Copyright (C) 2016-2019 Stuart Jones - CC BY-SA 3.0
UV model mapping by tobyplowy(aka toby109tt)
License Textures
----------------
3d_armor_stand.png
3d_armor_stand_locked.png
Copyright (C) 2017-2019 tobyplowy - CC BY-SA 3.0
3d_armor_stand_feet.png
3d_armor_stand_head.png
3d_armor_stand_legs.png
3d_armor_stand_torso.png
Copyright (C) 2016-2019 Stuart Jones - CC BY-SA 3.0

21
3d_armor_stand/README.txt Normal file
View File

@ -0,0 +1,21 @@
[mod] 3d Armor Stand [3d_armor_stand]
=====================================
Depends: 3d_armor
Adds a chest-like armor stand for armor storage and display.
Crafting
--------
F = Wooden Fence [default:fence_wood]
S = Steel Ingot [default:steel_ingot]
+---+---+---+
| | F | |
+---+---+---+
| | F | |
+---+---+---+
| S | S | S |
+---+---+---+

355
3d_armor_stand/init.lua Normal file
View File

@ -0,0 +1,355 @@
-- support for i18n
local S = minetest.get_translator(minetest.get_current_modname())
local armor_stand_formspec = "size[8,7]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
default.get_hotbar_bg(0,3) ..
"list[current_name;armor_head;3,0.5;1,1;]" ..
"list[current_name;armor_torso;4,0.5;1,1;]" ..
"list[current_name;armor_legs;3,1.5;1,1;]" ..
"list[current_name;armor_feet;4,1.5;1,1;]" ..
"image[3,0.5;1,1;3d_armor_stand_head.png]" ..
"image[4,0.5;1,1;3d_armor_stand_torso.png]" ..
"image[3,1.5;1,1;3d_armor_stand_legs.png]" ..
"image[4,1.5;1,1;3d_armor_stand_feet.png]" ..
"list[current_player;main;0,3;8,1;]" ..
"list[current_player;main;0,4.25;8,3;8]"
local elements = {"head", "torso", "legs", "feet"}
local function drop_armor(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
for _, element in pairs(elements) do
local stack = inv:get_stack("armor_"..element, 1)
if stack and stack:get_count() > 0 then
armor.drop_armor(pos, stack)
inv:set_stack("armor_"..element, 1, nil)
end
end
end
local function get_stand_object(pos)
local object = nil
local objects = minetest.get_objects_inside_radius(pos, 0.5) or {}
for _, obj in pairs(objects) do
local ent = obj:get_luaentity()
if ent then
if ent.name == "3d_armor_stand:armor_entity" then
-- Remove duplicates
if object then
obj:remove()
else
object = obj
end
end
end
end
return object
end
local function update_entity(pos)
local node = minetest.get_node(pos)
local object = get_stand_object(pos)
if object then
if not string.find(node.name, "3d_armor_stand:") then
object:remove()
return
end
else
object = minetest.add_entity(pos, "3d_armor_stand:armor_entity")
end
if object then
local texture = "3d_armor_trans.png"
local textures = {}
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local yaw = 0
if inv then
for _, element in pairs(elements) do
local stack = inv:get_stack("armor_"..element, 1)
if stack:get_count() == 1 then
local item = stack:get_name() or ""
local def = stack:get_definition() or {}
local groups = def.groups or {}
if groups["armor_"..element] then
if def.texture then
table.insert(textures, def.texture)
else
table.insert(textures, item:gsub("%:", "_")..".png")
end
end
end
end
end
if #textures > 0 then
texture = table.concat(textures, "^")
end
if node.param2 then
local rot = node.param2 % 4
if rot == 1 then
yaw = 3 * math.pi / 2
elseif rot == 2 then
yaw = math.pi
elseif rot == 3 then
yaw = math.pi / 2
end
end
object:set_yaw(yaw)
object:set_properties({textures={texture}})
end
end
local function has_locked_armor_stand_privilege(meta, player)
local name = ""
if player then
if minetest.check_player_privs(player, "protection_bypass") then
return true
end
name = player:get_player_name()
end
if name ~= meta:get_string("owner") then
return false
end
return true
end
local function add_hidden_node(pos, player)
local p = {x=pos.x, y=pos.y + 1, z=pos.z}
local name = player:get_player_name()
local node = minetest.get_node(p)
if node.name == "air" and not minetest.is_protected(pos, name) then
minetest.set_node(p, {name="3d_armor_stand:top"})
end
end
local function remove_hidden_node(pos)
local p = {x=pos.x, y=pos.y + 1, z=pos.z}
local node = minetest.get_node(p)
if node.name == "3d_armor_stand:top" then
minetest.remove_node(p)
end
end
minetest.register_node("3d_armor_stand:top", {
description = S("Armor Stand Top"),
paramtype = "light",
drawtype = "plantlike",
sunlight_propagates = true,
walkable = true,
pointable = false,
diggable = false,
buildable_to = false,
drop = "",
groups = {not_in_creative_inventory = 1},
on_blast = function() end,
tiles = {"3d_armor_trans.png"},
})
minetest.register_node("3d_armor_stand:armor_stand", {
description = S("Armor Stand"),
drawtype = "mesh",
mesh = "3d_armor_stand.obj",
tiles = {"3d_armor_stand.png"},
use_texture_alpha = "clip",
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
selection_box = {
type = "fixed",
fixed = {
{-0.25, -0.4375, -0.25, 0.25, 1.4, 0.25},
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
},
},
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", armor_stand_formspec)
meta:set_string("infotext", S("Armor Stand"))
local inv = meta:get_inventory()
for _, element in pairs(elements) do
inv:set_size("armor_"..element, 1)
end
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
for _, element in pairs(elements) do
if not inv:is_empty("armor_"..element) then
return false
end
end
return true
end,
after_place_node = function(pos, placer)
minetest.add_entity(pos, "3d_armor_stand:armor_entity")
add_hidden_node(pos, placer)
end,
allow_metadata_inventory_put = function(pos, listname, index, stack)
local def = stack:get_definition() or {}
local groups = def.groups or {}
if groups[listname] then
return 1
end
return 0
end,
allow_metadata_inventory_move = function(pos)
return 0
end,
on_metadata_inventory_put = function(pos)
update_entity(pos)
end,
on_metadata_inventory_take = function(pos)
update_entity(pos)
end,
after_destruct = function(pos)
update_entity(pos)
remove_hidden_node(pos)
end,
on_blast = function(pos)
drop_armor(pos)
armor.drop_armor(pos, "3d_armor_stand:armor_stand")
minetest.remove_node(pos)
end,
})
minetest.register_node("3d_armor_stand:locked_armor_stand", {
description = S("Locked Armor Stand"),
drawtype = "mesh",
mesh = "3d_armor_stand.obj",
tiles = {"3d_armor_stand_locked.png"},
use_texture_alpha = "clip",
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
selection_box = {
type = "fixed",
fixed = {
{-0.25, -0.4375, -0.25, 0.25, 1.4, 0.25},
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
},
},
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", armor_stand_formspec)
meta:set_string("infotext", S("Armor Stand"))
meta:set_string("owner", "")
local inv = meta:get_inventory()
for _, element in pairs(elements) do
inv:set_size("armor_"..element, 1)
end
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
for _, element in pairs(elements) do
if not inv:is_empty("armor_"..element) then
return false
end
end
return true
end,
after_place_node = function(pos, placer)
minetest.add_entity(pos, "3d_armor_stand:armor_entity")
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", S("Armor Stand (owned by @1)", meta:get_string("owner")))
add_hidden_node(pos, placer)
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_locked_armor_stand_privilege(meta, player) then
return 0
end
local def = stack:get_definition() or {}
local groups = def.groups or {}
if groups[listname] then
return 1
end
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_locked_armor_stand_privilege(meta, player) then
return 0
end
return stack:get_count()
end,
allow_metadata_inventory_move = function(pos)
return 0
end,
on_metadata_inventory_put = function(pos)
update_entity(pos)
end,
on_metadata_inventory_take = function(pos)
update_entity(pos)
end,
after_destruct = function(pos)
update_entity(pos)
remove_hidden_node(pos)
end,
on_blast = function(pos)
-- Not affected by TNT
end,
})
minetest.register_entity("3d_armor_stand:armor_entity", {
physical = true,
visual = "mesh",
mesh = "3d_armor_entity.obj",
visual_size = {x=1, y=1},
collisionbox = {0,0,0,0,0,0},
textures = {"3d_armor_trans.png"},
pos = nil,
timer = 0,
on_activate = function(self)
local pos = self.object:get_pos()
if pos then
self.pos = vector.round(pos)
update_entity(pos)
end
end,
on_blast = function(self, damage)
local drops = {}
local node = minetest.get_node(self.pos)
if node.name == "3d_armor_stand:armor_stand" then
drop_armor(self.pos)
self.object:remove()
end
return false, false, drops
end,
})
minetest.register_abm({
nodenames = {"3d_armor_stand:locked_armor_stand", "3d_armor_stand:armor_stand"},
interval = 15,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local num
num = #minetest.get_objects_inside_radius(pos, 0.5)
if num > 0 then return end
update_entity(pos)
end
})
minetest.register_craft({
output = "3d_armor_stand:armor_stand",
recipe = {
{"", "group:fence", ""},
{"", "group:fence", ""},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
}
})
minetest.register_craft({
output = "3d_armor_stand:locked_armor_stand",
recipe = {
{"3d_armor_stand:armor_stand", "default:steel_ingot"},
}
})

View File

@ -0,0 +1,5 @@
# textdomain: 3d_armor_stand
Armor Stand Top=Kirasstando Supro
Armor Stand=Kirasstando
Locked Armor Stand=Ŝlosita Kirasstando
Armor Stand (owned by @1)=Kirasstando (posedata de @1)

View File

@ -0,0 +1,5 @@
# textdomain: 3d_armor_stand
Armor Stand Top=Haut de support d'armure
Armor Stand=Support d'armure
Locked Armor Stand=Support d'armure verrouillé
Armor Stand (owned by @1)=Support d'armure (propriété de @1)

View File

@ -0,0 +1,5 @@
# textdomain: 3d_armor_stand
Armor Stand Top=Topo do suporte de armadura
Armor Stand=Suporte de Armadura
Locked Armor Stand=Suporte de armadura trancado
Armor Stand (owned by @1)=Suporte de Armadura (dono: @1)

View File

@ -0,0 +1,5 @@
# textdomain: 3d_armor_stand
Armor Stand Top=Rustningställstopp
Armor Stand=Rustningställ
Locked Armor Stand=Låst rustningställ
Armor Stand (owned by @1)=Rustningställ (ägd av @1)

View File

@ -0,0 +1,5 @@
# textdomain: 3d_armor_stand
Armor Stand Top=
Armor Stand=
Locked Armor Stand=
Armor Stand (owned by @1)=

2
3d_armor_stand/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = 3d_armor_stand
depends = 3d_armor

View File

@ -0,0 +1,193 @@
# Blender v2.73 (sub 0) OBJ File: '3d_armor_entity_3.blend'
# www.blender.org
mtllib 3d_armor_entity.mtl
o Player_Cube
v 2.200000 9.763893 1.200000
v 2.200000 9.763893 -1.200000
v 2.200000 2.663871 1.200000
v 2.200000 2.663871 -1.200000
v -2.200000 9.763893 -1.200000
v -2.200000 9.763893 1.200000
v -2.200000 2.663871 -1.200000
v -2.200000 2.663871 1.200000
v 2.300000 13.863962 2.300000
v 2.300000 13.863962 -2.300000
v 2.300000 9.263885 2.300000
v 2.300000 9.263885 -2.300000
v -2.300000 13.863962 -2.300000
v -2.300000 13.863962 2.300000
v -2.300000 9.263885 -2.300000
v -2.300000 9.263885 2.300000
v -2.322686 2.473175 -1.300000
v -2.322686 2.473175 1.300000
v -4.713554 2.682348 1.300000
v -4.713554 2.682348 -1.300000
v -1.686446 9.745432 -1.300000
v -1.686446 9.745432 1.300000
v -4.077313 9.954605 1.300000
v -4.077313 9.954605 -1.300000
v 4.077313 9.954605 -1.300000
v 4.077313 9.954605 1.300000
v 1.686446 9.745432 1.300000
v 1.686446 9.745432 -1.300000
v 4.713554 2.682348 -1.300000
v 4.713554 2.682348 1.300000
v 2.322686 2.473175 1.300000
v 2.322686 2.473175 -1.300000
v 0.139099 2.938947 -1.200000
v 0.139099 2.938947 1.200000
v 0.261266 -4.059988 1.200000
v 0.261266 -4.059988 -1.200000
v 2.660901 -4.018101 1.190000
v 2.660901 -4.018101 -1.210000
v 2.538733 2.980834 1.190000
v 2.538733 2.980834 -1.210000
v -0.139099 2.938947 -1.200000
v -0.139099 2.938947 1.200000
v -0.261266 -4.059988 1.200000
v -0.261266 -4.059988 -1.200000
v -2.538734 2.980834 -1.210000
v -2.538734 2.980834 1.190000
v -2.660901 -4.018101 -1.210000
v -2.660901 -4.018101 1.190000
v -2.799999 -4.387500 1.390000
v -2.799999 -4.387500 -1.410000
v -2.800000 -0.812499 1.390000
v -2.800000 -0.812499 -1.410000
v -0.000000 -4.387500 -1.400000
v -0.000000 -4.387500 1.400000
v -0.000000 -0.812499 1.400000
v -0.000000 -0.812499 -1.400000
v 2.800000 -0.812499 -1.410000
v 2.800000 -0.812499 1.390000
v 2.799999 -4.387500 -1.410000
v 2.799999 -4.387500 1.390000
v 0.000000 -4.387500 -1.400000
v 0.000000 -4.387500 1.400000
v 0.000000 -0.812499 1.400000
v 0.000000 -0.812499 -1.400000
v 2.267006 13.830965 2.267006
v 2.267006 13.830965 -2.267006
v 2.267006 9.296881 2.267006
v 2.267006 9.296881 -2.267006
v -2.267006 13.830965 -2.267006
v -2.267006 13.830965 2.267006
v -2.267006 9.296881 -2.267006
v -2.267006 9.296881 2.267006
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.312500 0.000000
vt 0.312500 0.375000
vt 0.437500 0.375000
vt 0.437500 0.500000
vt 0.312500 0.500000
vt 0.562500 0.375000
vt 0.562500 0.500000
vt 0.437500 0.000000
vt 0.500000 0.000000
vt 0.500000 0.375000
vt 0.625000 0.000000
vt 0.625000 0.375000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 0.625000 0.500000
vt 0.625000 0.750000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 0.500000
vt 0.875000 0.500000
vt 1.000000 0.750000
vt 1.000000 0.500000
vt 0.750000 0.375000
vt 0.812500 0.500000
vt 0.812500 0.375000
vt 0.687500 0.375000
vt 0.687500 0.500000
vt 0.687500 0.000000
vt 0.750000 0.000000
vt 0.812500 0.000000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 0.125000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.500000
vt 0.125000 0.500000
vt 0.187500 0.375000
vt 0.187500 0.500000
vt 0.000000 0.375000
vt 0.000000 0.000000
vt 0.062500 0.000000
vt 0.187500 0.000000
vt 0.125000 0.000000
vt 0.437500 0.875000
vt 0.437500 1.000000
vt 0.375000 1.000000
vt 0.375000 0.875000
vt 0.250000 0.875000
vt 0.312500 0.875000
vt 0.312500 0.656250
vt 0.250000 0.656250
vt 0.500000 0.875000
vt 0.437500 0.656250
vt 0.500000 0.656250
vt 0.375000 0.656250
vt 0.312500 1.000000
usemtl Armor
s off
f 1/1 3/2 4/3 2/4
f 5/5 6/6 1/7 2/4
f 8/6 7/5 4/8 3/9
f 5/5 2/4 4/3 7/10
f 7/10 8/11 6/12 5/5
f 8/11 3/13 1/14 6/12
f 9/15 11/16 12/17 10/18
f 13/19 14/20 9/21 10/18
f 12/22 11/23 16/20 15/19
f 13/19 10/18 12/17 15/24
f 14/22 13/19 15/24 16/25
f 9/26 14/22 16/25 11/27
f 17/28 18/24 19/29 20/30
f 24/31 23/32 22/24 21/28
f 23/31 24/14 20/13 19/33
f 24/31 21/28 17/34 20/33
f 21/28 22/30 18/35 17/34
f 22/30 23/36 19/37 18/35
f 27/30 31/35 30/37 26/36
f 28/28 32/34 31/35 27/30
f 25/31 29/33 32/34 28/28
f 26/31 30/33 29/13 25/14
f 25/31 28/28 27/24 26/32
f 32/28 29/30 30/29 31/24
f 40/38 33/39 34/40 39/41
f 36/42 38/38 37/41 35/43
f 39/44 37/45 38/46 40/39
f 34/1 35/2 37/47 39/42
f 40/38 38/48 36/46 33/39
f 33/42 36/47 35/48 34/38
f 45/38 46/41 42/40 41/39
f 41/42 42/38 43/48 44/47
f 45/38 41/39 44/46 47/48
f 42/1 46/42 48/47 43/2
f 46/44 45/39 47/46 48/45
f 44/42 43/43 48/41 47/38
f 53/49 54/50 49/51 50/52
f 51/53 52/54 50/55 49/56
f 55/57 51/49 49/58 54/59
f 52/52 56/54 53/55 50/60
f 56/49 55/52 54/60 53/58
f 52/52 51/51 55/61 56/54
f 64/49 61/58 62/60 63/52
f 57/52 59/60 61/55 64/54
f 63/57 62/59 60/58 58/49
f 58/53 60/56 59/55 57/54
f 61/49 59/52 60/51 62/50
f 57/52 64/54 63/61 58/51
f 65/15 66/18 68/17 67/16
f 69/19 66/18 65/21 70/20
f 68/22 71/19 72/20 67/23
f 69/19 71/24 68/17 66/18
f 70/22 72/25 71/24 69/19
f 65/26 67/27 72/25 70/22

View File

@ -0,0 +1,280 @@
# Blender v2.72 (sub 0) OBJ File: ''
# www.blender.org
mtllib 3d_armor_stand.mtl
o Armor_Stand_Player_Cube_Stand
v 0.062500 0.125002 -0.062500
v 0.062500 -0.437500 -0.062500
v 0.062500 -0.437500 0.062500
v 0.062500 0.125002 0.062500
v -0.187500 0.250004 0.062500
v -0.187500 0.250004 -0.062500
v -0.250000 0.250004 -0.062500
v -0.250000 0.250004 0.062500
v -0.062500 -0.437500 -0.062500
v -0.062500 -0.437500 0.062500
v -0.187500 -0.437500 0.062500
v -0.187500 -0.437500 -0.062500
v -0.187500 0.125002 0.062500
v -0.187500 0.125002 -0.062500
v -0.187500 0.937504 0.062500
v -0.187500 0.937504 -0.062500
v -0.375000 0.937504 -0.062500
v -0.375000 0.937504 0.062500
v -0.062500 0.125002 0.062500
v 0.187500 0.125002 -0.062500
v 0.187500 -0.437500 -0.062500
v -0.062500 0.125002 -0.062500
v -0.250000 0.125007 -0.062500
v -0.250000 0.125007 0.062500
v 0.187500 -0.437500 0.062500
v 0.187500 0.125002 0.062500
v -0.062500 0.937504 0.062500
v -0.187500 0.812504 0.062500
v -0.062500 0.812504 0.062500
v -0.062500 0.937504 -0.062500
v 0.187500 0.250004 -0.062500
v 0.187500 0.250004 0.062500
v 0.250000 0.250004 0.062500
v 0.250000 0.250004 -0.062500
v 0.250000 0.125007 0.062500
v 0.250000 0.125007 -0.062500
v 0.187500 0.812504 0.062500
v 0.187500 0.812504 -0.062500
v 0.375000 0.812504 -0.062500
v 0.375000 0.812504 0.062500
v 0.187500 0.937504 -0.062500
v 0.187500 0.937504 0.062500
v 0.375000 0.937504 0.062500
v 0.375000 0.937504 -0.062500
v 0.062500 0.937504 -0.062500
v 0.062500 0.937504 0.062500
v -0.062500 0.812504 -0.062500
v -0.187500 0.812504 -0.062500
v 0.062500 0.812504 -0.062500
v 0.062500 0.812504 0.062500
v -0.375000 0.812504 -0.062500
v -0.375000 0.812504 0.062500
v -0.062500 0.250004 0.062500
v 0.062500 0.250004 0.062500
v 0.062500 0.250004 -0.062500
v -0.062500 0.250004 -0.062500
v -0.062500 1.312504 -0.062500
v 0.062500 1.312504 -0.062500
v -0.062500 1.312504 0.062500
v 0.062500 1.312504 0.062500
v -0.500000 -0.437500 -0.500000
v -0.500000 -0.437500 0.500000
v 0.500000 -0.437500 0.500000
v 0.500000 -0.437500 -0.500000
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.500000
vt 0.062500 0.140625
vt 0.062500 0.000000
vt 0.093750 0.000000
vt 0.093750 0.140625
vt 0.140625 0.234375
vt 0.140625 0.203125
vt 0.156250 0.203125
vt 0.156250 0.234375
vt 0.093750 0.171875
vt 0.062500 0.171875
vt 0.218750 0.140625
vt 0.187500 0.140625
vt 0.187500 0.000000
vt 0.218750 0.000000
vt 0.078125 0.437500
vt 0.078125 0.468750
vt 0.031250 0.468750
vt 0.031250 0.437500
vt 0.250000 0.140625
vt 0.250000 0.000000
vt 0.031250 0.140625
vt 0.031250 0.000000
vt 0.156250 0.140625
vt 0.156250 0.000000
vt 0.187500 0.203125
vt 0.156250 0.171875
vt 0.187500 0.171875
vt 0.125000 0.000000
vt 0.125000 0.140625
vt 0.000000 0.140625
vt 0.000000 0.000000
vt 0.328125 0.437500
vt 0.296875 0.437500
vt 0.296875 0.406250
vt 0.328125 0.406250
vt 0.109375 0.437500
vt 0.109375 0.468750
vt 0.046875 0.203125
vt 0.046875 0.234375
vt 0.031250 0.234375
vt 0.031250 0.203125
vt 0.000000 0.203125
vt 0.000000 0.171875
vt 0.031250 0.171875
vt 0.265625 0.468750
vt 0.265625 0.437500
vt 0.218750 0.437500
vt 0.218750 0.468750
vt 0.218750 0.171875
vt 0.171875 0.468750
vt 0.171875 0.437500
vt 0.078125 0.406250
vt 0.031250 0.406250
vt 0.140625 0.468750
vt 0.140625 0.437500
vt 0.140625 0.406250
vt 0.171875 0.406250
vt 0.109375 0.406250
vt 0.359375 0.437500
vt 0.359375 0.406250
vt 0.390625 0.406250
vt 0.390625 0.437500
vt 0.437500 0.406250
vt 0.437500 0.437500
vt 0.000000 0.437500
vt 0.000000 0.406250
vt 0.250000 0.437500
vt 0.218750 0.406250
vt 0.250000 0.406250
vt 0.359375 0.468750
vt 0.406250 0.468750
vt 0.406250 0.437500
vt 0.109375 0.234375
vt 0.078125 0.234375
vt 0.078125 0.203125
vt 0.109375 0.203125
vt 0.062500 0.468750
vt 0.062500 0.562500
vt 0.031250 0.562500
vt 0.328125 0.468750
vt 0.296875 0.468750
vt 0.062500 0.593750
vt 0.031250 0.593750
vt 0.093750 0.468750
vt 0.093750 0.562500
vt 0.125000 0.468750
vt 0.125000 0.562500
vt 0.000000 0.562500
vt 0.000000 0.468750
vt 0.078125 0.171875
vt 0.046875 0.171875
vt 0.265625 0.203125
vt 0.265625 0.171875
vt 0.296875 0.171875
vt 0.296875 0.203125
vt 0.265625 0.234375
vt 0.281250 0.234375
vt 0.281250 0.203125
vt 0.312500 0.171875
vt 0.312500 0.203125
vt 0.140625 0.171875
vt 0.171875 0.234375
vt 0.171875 0.203125
vt 0.109375 0.171875
vt 0.234375 0.203125
vt 0.203125 0.203125
vt 0.203125 0.171875
vt 0.234375 0.171875
vt 0.234375 0.234375
vt 0.203125 0.234375
vt 0.062500 0.375000
vt 0.062500 0.234375
vt 0.093750 0.234375
vt 0.093750 0.375000
vt 0.031250 0.375000
vt 0.125000 0.234375
vt 0.125000 0.375000
vt 0.000000 0.375000
vt 0.000000 0.234375
vt 0.218750 0.375000
vt 0.187500 0.375000
vt 0.187500 0.234375
vt 0.218750 0.234375
vt 0.250000 0.375000
vt 0.250000 0.234375
vt 0.156250 0.375000
vt 0.250000 1.000000
vt 0.250000 0.750000
vt 0.500000 0.750000
vt 0.500000 1.000000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.750000 0.734375
vt 1.000000 0.734375
vt 1.000000 0.750000
vt 0.000000 0.750000
vt 0.000000 0.734375
vt 0.250000 0.734375
vt 0.500000 0.734375
usemtl Stand
s off
f 1/1 2/2 3/3 4/4
f 5/5 6/6 7/7 8/8
f 9/1 10/4 11/9 12/10
f 13/11 14/12 12/13 11/14
f 15/15 16/16 17/17 18/18
f 19/19 13/11 11/14 10/20
f 2/2 1/1 20/21 21/22
f 14/12 22/23 9/24 12/13
f 8/25 7/7 23/26 24/27
f 4/4 3/3 25/28 26/29
f 22/23 19/29 10/28 9/24
f 26/30 25/31 21/22 20/21
f 27/32 15/33 28/34 29/35
f 16/16 15/15 27/36 30/37
f 31/38 32/39 33/40 34/41
f 33/42 35/43 36/44 34/41
f 37/45 38/46 39/47 40/48
f 2/49 21/27 25/12 3/11
f 41/50 42/51 43/47 44/48
f 38/52 41/15 44/18 39/53
f 41/50 45/54 46/55 42/51
f 16/51 30/55 47/56 48/57
f 41/15 38/52 49/58 45/36
f 46/59 50/60 37/61 42/62
f 42/62 37/61 40/63 43/64
f 43/65 40/66 39/53 44/18
f 18/67 17/47 51/68 52/69
f 28/34 15/33 18/67 52/69
f 16/51 48/57 51/68 17/47
f 48/59 28/70 52/71 51/72
f 53/73 54/74 55/75 56/76
f 30/77 57/78 58/79 45/17
f 50/60 46/59 27/32 29/35
f 29/80 47/32 49/33 50/81
f 47/56 30/55 45/36 49/58
f 57/78 59/82 60/83 58/79
f 27/84 59/85 57/78 30/77
f 46/86 60/87 59/85 27/84
f 45/17 58/79 60/88 46/89
f 1/90 55/75 31/38 20/91
f 54/92 4/93 26/94 32/95
f 26/92 20/96 36/97 35/98
f 20/91 31/38 34/41 36/44
f 32/95 26/94 35/99 33/100
f 6/6 14/101 23/26 7/7
f 14/102 13/103 24/7 23/8
f 6/6 56/76 22/104 14/101
f 53/105 5/106 13/107 19/108
f 13/107 5/106 8/25 24/27
f 1/90 22/104 56/76 55/75
f 53/105 19/108 4/93 54/92
f 1/109 4/105 19/106 22/110
f 49/111 55/112 54/113 50/114
f 38/115 31/40 55/112 49/111
f 50/114 54/113 32/116 37/117
f 37/118 32/119 31/40 38/115
f 28/120 48/121 6/122 5/123
f 29/124 28/120 5/123 53/125
f 48/121 47/126 56/8 6/122
f 47/126 29/117 53/116 56/8
usemtl Base
f 61/127 62/128 63/129 64/130
f 65/129 66/131 67/132 68/130
f 62/131 68/133 67/134 63/135
f 63/136 67/137 66/138 64/128
f 61/129 64/128 66/138 65/139
f 62/131 61/129 65/139 68/133

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

18
3d_armor_ui/LICENSE.txt Normal file
View File

@ -0,0 +1,18 @@
[mod] 3d Armor integration to unified inventory [3d_armor_ui]
=============================================================
Copyright (C) 2012-2019 stujones11, Stuart Jones <stujones111@gmail.com>
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.

Some files were not shown because too many files have changed in this diff Show More