Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add compatibility with frame mod #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions 3d_armor/armor.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-- support for i18n
local S = armor_i18n.gettext

-- frame compatibility
local use_frame = minetest.get_modpath("frame")

armor:register_armor("3d_armor:helmet_admin", {
description = S("Admin Helmet"),
inventory_image = "3d_armor_inv_helmet_admin.png",
Expand Down Expand Up @@ -344,3 +347,17 @@ for k, v in pairs(armor.materials) do
},
})
end

-- add frame compatibility
if use_frame then
frame.register("3d_armor:helmet_admin")
frame.register("3d_armor:chestplate_admin")
frame.register("3d_armor:leggings_admin")
frame.register("3d_armor:boots_admin")
for k, v in pairs(armor.materials) do
frame.register("3d_armor:helmet_"..k)
frame.register("3d_armor:chestplate_"..k)
frame.register("3d_armor:leggings_"..k)
frame.register("3d_armor:boots_"..k)
end
end
1 change: 1 addition & 0 deletions 3d_armor/depends.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ player_monoids?
armor_monoid?
pova?
fire?
frame?
ethereal?
bakedclay?
intllib?
1 change: 0 additions & 1 deletion 3d_armor_stand/depends.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
3d_armor

1 change: 1 addition & 0 deletions shields/depends.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
default
3d_armor
frame?
16 changes: 15 additions & 1 deletion shields/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local S = armor_i18n.gettext

local disable_sounds = minetest.settings:get_bool("shields_disable_sounds")
local use_moreores = minetest.get_modpath("moreores")
local use_frame = minetest.get_modpath("frame")
local function play_sound_effect(player, name)
if not disable_sounds and player then
local pos = player:get_pos()
Expand Down Expand Up @@ -225,3 +225,17 @@ for k, v in pairs(armor.materials) do
},
})
end

-- Add compatibility with frame
if use_frame then
frame.register("shields:shield_admin")
if armor.materials.wood then
frame.register("shields:shield_enhanced_wood")
end
if armor.materials.cactus then
frame.register("shields:shield_enhanced_cactus")
end
for k, v in pairs(armor.materials) do
frame.register("shields:shield_"..k)
end
end