diff --git a/worldmods/3d_armor_modpack/.gitignore b/worldmods/3d_armor_modpack/.gitignore new file mode 100644 index 0000000..ba96b08 --- /dev/null +++ b/worldmods/3d_armor_modpack/.gitignore @@ -0,0 +1,11 @@ +## Generic ignorable patterns and files +*~ +.*.swp +*bak* +tags +*.vim +armor.conf + +## Eclipse project files & directories +.project +.settings diff --git a/worldmods/3d_armor_modpack/3d_armor/LICENSE.txt b/worldmods/3d_armor_modpack/3d_armor/LICENSE.txt new file mode 100644 index 0000000..e1949c0 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/LICENSE.txt @@ -0,0 +1,9 @@ +[mod] 3d Armor [3d_armor] +========================= + +License Source Code: (C) 2012-2017 Stuart Jones - LGPL v2.1 + +License Textures: Copyright (C) 2017 davidthecreator - CC-BY-SA 3.0 + +https://github.com/daviddoesminetest/3d-armors-new-textures + diff --git a/worldmods/3d_armor_modpack/3d_armor/README.txt b/worldmods/3d_armor_modpack/3d_armor/README.txt new file mode 100644 index 0000000..db445be --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/README.txt @@ -0,0 +1,188 @@ +[mod] Visible Player Armor [3d_armor] +===================================== + +Depends: default + +Recommends: sfinv, unified_inventory or smart_inventory (use only one to avoid conflicts) + +Supports: player_monoids and armor_monoid + +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. + +Fire protection added by TenPlus1 when using crystal armor if Ethereal mod active, level 1 +protects against torches, level 2 for crystal spike, level 3 for fire, level 5 for lava. + +Armor Configuration +------------------- + +Override the following default settings by adding them to your minetest.conf file. + +-- Set false to disable individual armor materials. +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 + +-- 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 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: 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 + +-- Enable water protection (periodically restores breath when activated) +armor_water_protect = true + +-- Enable fire protection (defaults true if using ethereal mod) +armor_fire_protect = false + +-- Enable punch damage effects. +armor_punch_damage = true + +API +--- + +Armor Registration: + +armor:register_armor(name, def) + +Wrapper function for `minetest.register_tool`, while registering armor as +a tool item is still supported, this may be deprecated in future so new code +should use this method. + +Additional fields supported by 3d_armor: + + texture = + preview = + armor_groups = + damage_groups =
+ reciprocate_damage = + on_equip = + on_unequip = + on_destroy = + on_damage = + on_punched = + +armor:register_armor_group(group, base) + +Example: + +armor:register_armor_group("radiation", 100) + +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:getpos() + if pos then + minetest.sound_play({ + name = "mod_name_break_sound", + pos = pos, + gain = 0.5, + }) + end + end, +}) + +See armor.lua, technic_armor and shields mods for more examples. + +Default groups: + +Elements: armor_head, armor_torso, armor_legs, armor_feet +Attributes: armor_heal, armor_fire, armor_water +Physics: physics_jump, physics_speed, physics_gravity +Durability: armor_use, flammable + +Notes: + +Elements may be modified by dependent mods, eg shields adds armor_shield. +Attributes and physics values are 'stackable', durability is determined +by the level of armor_use, total uses == approx (65535/armor_use), non-fleshy +damage groups need to be defined in the tool/weapon used against the player. + +Reciprocal tool damage will be done only by the first armor inventory item + with `reciprocate_damage = true` + +Armor Functions: + +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(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(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. + +Item Callbacks: + +on_equip = func(player, index, stack) +on_unequip = func(player, index, stack) +on_destroy = func(player, index, stack) +on_damage = func(player, index, stack) +on_punched = func(player, hitter, time_from_last_punch, tool_capabilities) + +Notes: + +`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, etc. When fire protection is enabled, hitter == "fire" +in the event of fire damage. Return `false` to override armor damage effects. +When armor is destroyed `stack` will contain a copy of the previous stack. + +Global Callbacks: + +armor:register_on_update(func(player)) +armor:register_on_equip(func(player, index, stack)) +armor:register_on_unequip(func(player, index, stack)) +armor:register_on_destroy(func(player, index, stack)) + +Global Callback Example: + +armor:register_on_update(function(player) + print(player:get_player_name().." armor updated!") +end) + diff --git a/worldmods/3d_armor_modpack/3d_armor/api.lua b/worldmods/3d_armor_modpack/3d_armor/api.lua new file mode 100644 index 0000000..4981f88 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/api.lua @@ -0,0 +1,470 @@ +local skin_previews = {} +local use_player_monoids = minetest.global_exists("player_monoids") +local use_armor_monoid = minetest.global_exists("armor_monoid") +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"}, + 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", + }, + fire_nodes = { + {"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}, + {"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 = {}, + }, + version = "0.4.9", +} + +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, + water_protect = true, + fire_protect = minetest.get_modpath("ethereal") ~= nil, + punch_damage = true, +} + +-- Armor Registration + +armor.register_armor = function(self, name, def) + minetest.register_tool(name, def) +end + +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 + +armor.register_on_update = function(self, func) + if type(func) == "function" then + table.insert(self.registered_callbacks.on_update, func) + end +end + +armor.register_on_equip = function(self, func) + if type(func) == "function" then + table.insert(self.registered_callbacks.on_equip, func) + end +end + +armor.register_on_unequip = function(self, func) + if type(func) == "function" then + table.insert(self.registered_callbacks.on_unequip, func) + end +end + +armor.register_on_damage = function(self, func) + if type(func) == "function" then + table.insert(self.registered_callbacks.on_damage, func) + end +end + +armor.register_on_destroy = function(self, func) + if type(func) == "function" then + table.insert(self.registered_callbacks.on_destroy, func) + end +end + +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 + +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 +end + +armor.set_player_armor = function(self, player) + local name, player_inv = self:get_valid_player(player, "[set_player_armor]") + if not name then + return + end + local state = 0 + local count = 0 + local material = {count=1} + local preview = armor:get_preview(name) + local texture = "3d_armor_trans.png" + local textures = {} + local physics = {} + local attributes = {} + local levels = {} + local groups = {} + local change = {} + 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 = player_inv:get_list("armor") + 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 + 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$", "") + texture = texture.."^"..tex..".png" + 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 + local mat = string.match(item, "%:.+_(.+)$") + if material.name then + if material.name == mat then + material.count = material.count + 1 + end + else + material.name = mat + end + end + end + for group, level in pairs(levels) do + if level > 0 then + level = level * armor.config.level_multiplier + if material.name and material.count == #self.elements then + level = level * 1.1 + 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 + self.def[name][attr] = attributes[attr] + 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 + 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") + else + player:set_physics_override(physics) + 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) + self:run_callbacks("on_update", player) +end + +armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabilities) + local name, player_inv = self:get_valid_player(player, "[punch]") + if not name then + return + end + local state = 0 + local count = 0 + local recip = true + local default_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1} + local list = player_inv:get_list("armor") + for i, stack in pairs(list) do + if stack:get_count() == 1 then + local name = stack:get_name() + local use = minetest.get_item_group(name, "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 + 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(name, "flammable") > 0 + end + if damage == true then + self:damage(player, i, stack, use) + end + state = state + stack:get_wear() + count = count + 1 + end + end + self.def[name].state = state + self.def[name].count = count +end + +armor.damage = function(self, player, index, stack, use) + local old_stack = ItemStack(stack) + 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 + +armor.get_player_skin = function(self, name) + if (self.skin_mod == "skins" or self.skin_mod == "simple_skins") and skins.skins[name] then + return skins.skins[name]..".png" + elseif self.skin_mod == "u_skins" and u_skins.u_skins[name] then + return u_skins.u_skins[name]..".png" + elseif self.skin_mod == "wardrobe" and wardrobe.playerSkins and wardrobe.playerSkins[name] then + return wardrobe.playerSkins[name] + end + return armor.default_skin..".png" +end + +armor.add_preview = function(self, preview) + skin_previews[preview] = true +end + +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 + +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.attributes) do + formspec = formspec:gsub("armor_group_"..group, armor.def[name][group]) + end + return formspec +end + +armor.update_inventory = function(self, player) + -- DEPRECATED: Legacy inventory support +end + +armor.set_inventory_stack = function(self, player, i, stack) + local msg = "[set_inventory_stack]" + local name = player:get_player_name() + if not name then + minetest.log("warning", "3d_armor: Player name is nil "..msg) + return + end + local player_inv = player:get_inventory() + local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"}) + if not player_inv then + minetest.log("warning", "3d_armor: Player inventory is nil "..msg) + return + elseif not armor_inv then + minetest.log("warning", "3d_armor: Detached armor inventory is nil "..msg) + return + end + player_inv:set_stack("armor", i, stack) + armor_inv:set_stack("armor", i, stack) +end + +armor.get_valid_player = function(self, player, msg) + msg = msg or "" + if not player then + minetest.log("warning", "3d_armor: Player reference is nil "..msg) + return + end + local name = player:get_player_name() + if not name then + minetest.log("warning", "3d_armor: Player name is nil "..msg) + return + end + local inv = player:get_inventory() + if not inv then + minetest.log("warning", "3d_armor: Player inventory is nil "..msg) + return + end + return name, inv +end + +armor.drop_armor = function(pos, stack) + local obj = minetest.add_item(pos, stack) + if obj then + obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)}) + end +end diff --git a/worldmods/3d_armor_modpack/3d_armor/armor.conf.example b/worldmods/3d_armor_modpack/3d_armor/armor.conf.example new file mode 100644 index 0000000..9ce34b4 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/armor.conf.example @@ -0,0 +1,65 @@ +-- 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", +} + +-- 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 diff --git a/worldmods/3d_armor_modpack/3d_armor/armor.lua b/worldmods/3d_armor_modpack/3d_armor/armor.lua new file mode 100644 index 0000000..306a687 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/armor.lua @@ -0,0 +1,348 @@ +local S = function(s) return s end +if minetest.global_exists("intllib") then + S = intllib.Getter() +end + +armor:register_armor("3d_armor:helmet_admin", { + description = S("Admin Helmet"), + inventory_image = "3d_armor_inv_helmet_admin.png", + armor_groups = {fleshy=100}, + groups = {armor_head=1, armor_heal=100, armor_use=0, armor_water=1, + not_in_creative_inventory=1}, + on_drop = function(itemstack, dropper, pos) + return + end, +}) + +armor:register_armor("3d_armor:chestplate_admin", { + description = S("Admin Chestplate"), + inventory_image = "3d_armor_inv_chestplate_admin.png", + armor_groups = {fleshy=100}, + groups = {armor_torso=1, armor_heal=100, armor_use=0, + not_in_creative_inventory=1}, + on_drop = function(itemstack, dropper, pos) + return + end, +}) + +armor:register_armor("3d_armor:leggings_admin", { + description = S("Admin Leggings"), + inventory_image = "3d_armor_inv_leggings_admin.png", + armor_groups = {fleshy=100}, + groups = {armor_legs=1, armor_heal=100, armor_use=0, + not_in_creative_inventory=1}, + on_drop = function(itemstack, dropper, pos) + return + end, +}) + +armor:register_armor("3d_armor:boots_admin", { + description = S("Admin Boots"), + inventory_image = "3d_armor_inv_boots_admin.png", + armor_groups = {fleshy=100}, + groups = {armor_feet=1, armor_heal=100, armor_use=0, + not_in_creative_inventory=1}, + on_drop = function(itemstack, dropper, pos) + return + end, +}) + +minetest.register_alias("adminboots", "3d_armor:boots_admin") +minetest.register_alias("adminhelmet", "3d_armor:helmet_admin") +minetest.register_alias("adminchestplate", "3d_armor:chestplate_admin") +minetest.register_alias("adminleggings", "3d_armor:leggings_admin") + +if armor.materials.wood then + armor:register_armor("3d_armor:helmet_wood", { + description = S("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("3d_armor:chestplate_wood", { + description = S("Wood Chestplate"), + inventory_image = "3d_armor_inv_chestplate_wood.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}, + }) + armor:register_armor("3d_armor:leggings_wood", { + description = S("Wood Leggings"), + inventory_image = "3d_armor_inv_leggings_wood.png", + groups = {armor_legs=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}, + }) + armor:register_armor("3d_armor:boots_wood", { + description = S("Wood Boots"), + inventory_image = "3d_armor_inv_boots_wood.png", + armor_groups = {fleshy=5}, + damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1}, + groups = {armor_feet=1, armor_heal=0, armor_use=2000, flammable=1}, + }) +end + +if armor.materials.cactus then + armor:register_armor("3d_armor:helmet_cactus", { + description = S("Cactus Helmet"), + inventory_image = "3d_armor_inv_helmet_cactus.png", + groups = {armor_head=1, armor_heal=0, armor_use=1000}, + armor_groups = {fleshy=5}, + damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1}, + }) + armor:register_armor("3d_armor:chestplate_cactus", { + description = S("Cactus Chestplate"), + inventory_image = "3d_armor_inv_chestplate_cactus.png", + groups = {armor_torso=1, armor_heal=0, armor_use=1000}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1}, + }) + armor:register_armor("3d_armor:leggings_cactus", { + description = S("Cactus Leggings"), + inventory_image = "3d_armor_inv_leggings_cactus.png", + groups = {armor_legs=1, armor_heal=0, armor_use=1000}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1}, + }) + armor:register_armor("3d_armor:boots_cactus", { + description = S("Cactus Boots"), + inventory_image = "3d_armor_inv_boots_cactus.png", + groups = {armor_feet=1, armor_heal=0, armor_use=1000}, + armor_groups = {fleshy=5}, + damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1}, + }) +end + +if armor.materials.steel then + armor:register_armor("3d_armor:helmet_steel", { + description = S("Steel Helmet"), + inventory_image = "3d_armor_inv_helmet_steel.png", + groups = {armor_head=1, armor_heal=0, armor_use=800, + physics_speed=-0.01, physics_gravity=0.01}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2}, + }) + armor:register_armor("3d_armor:chestplate_steel", { + description = S("Steel Chestplate"), + inventory_image = "3d_armor_inv_chestplate_steel.png", + groups = {armor_torso=1, armor_heal=0, armor_use=800, + physics_speed=-0.04, physics_gravity=0.04}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2}, + }) + armor:register_armor("3d_armor:leggings_steel", { + description = S("Steel Leggings"), + inventory_image = "3d_armor_inv_leggings_steel.png", + groups = {armor_legs=1, armor_heal=0, armor_use=800, + physics_speed=-0.03, physics_gravity=0.03}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2}, + }) + armor:register_armor("3d_armor:boots_steel", { + description = S("Steel Boots"), + inventory_image = "3d_armor_inv_boots_steel.png", + groups = {armor_feet=1, armor_heal=0, armor_use=800, + physics_speed=-0.01, physics_gravity=0.01}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2}, + }) +end + +if armor.materials.bronze then + 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}, + }) + armor:register_armor("3d_armor:chestplate_bronze", { + description = S("Bronze Chestplate"), + inventory_image = "3d_armor_inv_chestplate_bronze.png", + groups = {armor_torso=1, armor_heal=6, armor_use=400, + physics_speed=-0.04, physics_gravity=0.04}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2}, + }) + armor:register_armor("3d_armor:leggings_bronze", { + description = S("Bronze Leggings"), + inventory_image = "3d_armor_inv_leggings_bronze.png", + groups = {armor_legs=1, armor_heal=6, armor_use=400, + physics_speed=-0.03, physics_gravity=0.03}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2}, + }) + armor:register_armor("3d_armor:boots_bronze", { + description = S("Bronze Boots"), + inventory_image = "3d_armor_inv_boots_bronze.png", + groups = {armor_feet=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}, + }) +end + +if armor.materials.diamond then + armor:register_armor("3d_armor:helmet_diamond", { + description = S("Diamond Helmet"), + inventory_image = "3d_armor_inv_helmet_diamond.png", + groups = {armor_head=1, armor_heal=12, armor_use=200}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, choppy=1, level=3}, + }) + 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:register_armor("3d_armor:leggings_diamond", { + description = S("Diamond Leggings"), + inventory_image = "3d_armor_inv_leggings_diamond.png", + groups = {armor_legs=1, armor_heal=12, armor_use=200}, + armor_groups = {fleshy=20}, + damage_groups = {cracky=2, snappy=1, choppy=1, level=3}, + }) + armor:register_armor("3d_armor:boots_diamond", { + description = S("Diamond Boots"), + inventory_image = "3d_armor_inv_boots_diamond.png", + groups = {armor_feet=1, armor_heal=12, armor_use=200}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, choppy=1, level=3}, + }) +end + +if armor.materials.gold then + armor:register_armor("3d_armor:helmet_gold", { + description = S("Gold Helmet"), + inventory_image = "3d_armor_inv_helmet_gold.png", + groups = {armor_head=1, armor_heal=6, armor_use=300, + physics_speed=-0.02, physics_gravity=0.02}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2}, + }) + armor:register_armor("3d_armor:chestplate_gold", { + description = S("Gold Chestplate"), + inventory_image = "3d_armor_inv_chestplate_gold.png", + groups = {armor_torso=1, armor_heal=6, armor_use=300, + physics_speed=-0.05, physics_gravity=0.05}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2}, + }) + armor:register_armor("3d_armor:leggings_gold", { + description = S("Gold Leggings"), + inventory_image = "3d_armor_inv_leggings_gold.png", + groups = {armor_legs=1, armor_heal=6, armor_use=300, + physics_speed=-0.04, physics_gravity=0.04}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2}, + }) + armor:register_armor("3d_armor:boots_gold", { + description = S("Gold Boots"), + inventory_image = "3d_armor_inv_boots_gold.png", + groups = {armor_feet=1, armor_heal=6, armor_use=300, + physics_speed=-0.02, physics_gravity=0.02}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2}, + }) +end + +if armor.materials.mithril then + armor:register_armor("3d_armor:helmet_mithril", { + description = S("Mithril Helmet"), + inventory_image = "3d_armor_inv_helmet_mithril.png", + groups = {armor_head=1, armor_heal=12, armor_use=100}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, level=3}, + }) + armor:register_armor("3d_armor:chestplate_mithril", { + description = S("Mithril Chestplate"), + inventory_image = "3d_armor_inv_chestplate_mithril.png", + groups = {armor_torso=1, armor_heal=12, armor_use=100}, + armor_groups = {fleshy=20}, + damage_groups = {cracky=2, snappy=1, level=3}, + }) + armor:register_armor("3d_armor:leggings_mithril", { + description = S("Mithril Leggings"), + inventory_image = "3d_armor_inv_leggings_mithril.png", + groups = {armor_legs=1, armor_heal=12, armor_use=100}, + armor_groups = {fleshy=20}, + damage_groups = {cracky=2, snappy=1, level=3}, + }) + armor:register_armor("3d_armor:boots_mithril", { + description = S("Mithril Boots"), + inventory_image = "3d_armor_inv_boots_mithril.png", + groups = {armor_feet=1, armor_heal=12, armor_use=100}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, level=3}, + }) +end + +if armor.materials.crystal then + armor:register_armor("3d_armor:helmet_crystal", { + description = S("Crystal Helmet"), + inventory_image = "3d_armor_inv_helmet_crystal.png", + groups = {armor_head=1, armor_heal=12, armor_use=100, armor_fire=1}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, level=3}, + }) + armor:register_armor("3d_armor:chestplate_crystal", { + description = S("Crystal Chestplate"), + inventory_image = "3d_armor_inv_chestplate_crystal.png", + groups = {armor_torso=1, armor_heal=12, armor_use=100, armor_fire=1}, + armor_groups = {fleshy=20}, + damage_groups = {cracky=2, snappy=1, level=3}, + }) + armor:register_armor("3d_armor:leggings_crystal", { + description = S("Crystal Leggings"), + inventory_image = "3d_armor_inv_leggings_crystal.png", + groups = {armor_legs=1, armor_heal=12, armor_use=100, armor_fire=1}, + armor_groups = {fleshy=20}, + damage_groups = {cracky=2, snappy=1, level=3}, + }) + armor:register_armor("3d_armor:boots_crystal", { + description = S("Crystal Boots"), + inventory_image = "3d_armor_inv_boots_crystal.png", + groups = {armor_feet=1, armor_heal=12, armor_use=100, physics_speed=1, + physics_jump=0.5, armor_fire=1}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, level=3}, + }) +end + +for k, v in pairs(armor.materials) 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:boots_"..k, + recipe = { + {v, "", v}, + {v, "", v}, + }, + }) +end diff --git a/worldmods/3d_armor_modpack/3d_armor/crafting_guide.txt b/worldmods/3d_armor_modpack/3d_armor/crafting_guide.txt new file mode 100644 index 0000000..abd1519 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/crafting_guide.txt @@ -0,0 +1,79 @@ +3d_armor -- Crafting Guide +-------------------------- + +Helmets: + ++---+---+---+ +| X | X | X | ++---+---+---+ +| X | | X | ++---+---+---+ +| | | | ++---+---+---+ + +[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] ** + +Chestplates: + ++---+---+---+ +| X | | X | ++---+---+---+ +| X | X | X | ++---+---+---+ +| X | X | X | ++---+---+---+ + +[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] ** + +Leggings: + ++---+---+---+ +| X | X | X | ++---+---+---+ +| X | | X | ++---+---+---+ +| X | | X | ++---+---+---+ + +[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] ** + +Boots: + ++---+---+---+ +| X | | X | ++---+---+---+ +| X | | X | ++---+---+---+ + +[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] ** + + * Requires moreores mod by Calinou - https://forum.minetest.net/viewtopic.php?id=549 +** Requires ethereal mod by Chinchow & TenPlus1 - https://github.com/tenplus1/ethereal diff --git a/worldmods/3d_armor_modpack/3d_armor/depends.txt b/worldmods/3d_armor_modpack/3d_armor/depends.txt new file mode 100644 index 0000000..fa1b233 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/depends.txt @@ -0,0 +1,7 @@ +default +player_monoids? +armor_monoid? +fire? +ethereal? +bakedclay? +intllib? diff --git a/worldmods/3d_armor_modpack/3d_armor/description.txt b/worldmods/3d_armor_modpack/3d_armor/description.txt new file mode 100644 index 0000000..b0a9b0a --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/description.txt @@ -0,0 +1 @@ +Adds craftable armor that is visible to other players. diff --git a/worldmods/3d_armor_modpack/3d_armor/init.lua b/worldmods/3d_armor_modpack/3d_armor/init.lua new file mode 100644 index 0000000..f617e12 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/init.lua @@ -0,0 +1,409 @@ +local S = function(s) return s end +if minetest.global_exists("intllib") then + S = intllib.Getter() +end +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 + +dofile(modpath.."/api.lua") + +-- Legacy Config Support + +local input = io.open(modpath.."/armor.conf", "r") +if input then + dofile(modpath.."/armor.conf") + input:close() + input = nil +end +input = io.open(worldpath.."/armor.conf", "r") +if input then + dofile(worldpath.."/armor.conf") + input:close() + input = nil +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 + +-- 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) == "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 + +-- Mod Compatibility + +if minetest.get_modpath("technic") then + armor.formspec = armor.formspec.. + "label[5,2.5;"..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.skin_mod = mod + end +end +if not minetest.get_modpath("moreores") then + armor.materials.mithril = nil +end +if not minetest.get_modpath("ethereal") then + armor.materials.crystal = nil +end + +dofile(modpath.."/armor.lua") + +-- Armor Initialization + +armor.formspec = armor.formspec.. + "label[5,1;"..S("Level")..": armor_level]".. + "label[5,1.5;"..S("Heal")..": armor_attr_heal]" +if armor.config.fire_protect then + armor.formspec = armor.formspec.."label[5,2;"..S("Fire")..": armor_fire]" +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").." "..def.description.." ".. + S("got destroyed").."!") + end +end) + +local function init_player_armor(player) + local name = player:get_player_name() + local player_inv = player:get_inventory() + local pos = player:getpos() + if not name or not player_inv or not pos then + return false + end + local armor_inv = minetest.create_detached_inventory(name.."_armor", { + on_put = function(inv, listname, index, stack, player) + player:get_inventory():set_stack(listname, index, stack) + armor:run_callbacks("on_equip", player, index, stack) + armor:set_player_armor(player) + end, + on_take = function(inv, listname, index, stack, player) + player:get_inventory():set_stack(listname, index, nil) + armor:run_callbacks("on_unequip", player, index, stack) + armor:set_player_armor(player) + end, + on_move = function(inv, from_list, from_index, to_list, to_index, count, player) + local plaver_inv = player:get_inventory() + local stack = inv:get_stack(to_list, to_index) + player_inv:set_stack(to_list, to_index, stack) + player_inv:set_stack(from_list, from_index, nil) + armor:set_player_armor(player) + end, + allow_put = function(inv, listname, index, stack, player) + local def = stack:get_definition() or {} + local allowed = 0 + for _, element in pairs(armor.elements) do + if def.groups["armor_"..element] then + allowed = 1 + for i = 1, 6 do + local item = inv:get_stack("armor", i):get_name() + if minetest.get_item_group(item, "armor_"..element) > 0 then + return 0 + end + end + end + end + return allowed + 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 count + end, + }, name) + armor_inv:set_size("armor", 6) + 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) + armor:run_callbacks("on_equip", player, i, stack) + 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(player) + return true +end + +-- Armor Player Model + +default.player_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}, + }, +}) + +minetest.register_on_player_receive_fields(function(player, formname, fields) + local name = armor:get_valid_player(player, "[on_player_receive_fields]") + if not name then + return + end + for field, _ in pairs(fields) do + if string.find(field, "skins_set") then + minetest.after(0, function(player) + local skin = armor:get_player_skin(name) + armor.textures[name].skin = skin + armor:set_player_armor(player) + end, player) + end + end +end) + +minetest.register_on_joinplayer(function(player) + default.player_set_model(player, "3d_armor_character.b3d") + minetest.after(0, function(player) + if init_player_armor(player) == false then + pending_players[player] = 0 + end + end, player) +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, player_inv = armor:get_valid_player(player, "[on_dieplayer]") + if not name then + return + end + local drop = {} + for i=1, player_inv:get_size("armor") do + local stack = player_inv:get_stack("armor", i) + if stack:get_count() > 0 then + table.insert(drop, stack) + armor:set_inventory_stack(player, i, nil) + armor:run_callbacks("on_unequip", player, i, stack) + end + end + armor:set_player_armor(player) + local pos = player:getpos() + if pos and armor.config.destroy == false then + minetest.after(armor.config.bones_delay, function() + local meta = nil + local maxp = vector.add(pos, 8) + local minp = vector.subtract(pos, 8) + 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) +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() + if 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) + if player and hp_change < 0 then + local name = player:get_player_name() + if name then + local heal = armor.def[name].heal + heal = heal * armor.config.heal_multiplier + 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 + end + return hp_change +end, true) + +minetest.register_globalstep(function(dtime) + timer = timer + dtime + if timer > armor.config.init_delay then + 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 + timer = 0 + end +end) + +-- Fire Protection and water breating, added by TenPlus1 + +if armor.config.fire_protect == true then + -- override hot nodes so they do not hurt player anywhere but mod + for _, row in pairs(armor.fire_nodes) do + if minetest.registered_nodes[row[1]] then + minetest.override_item(row[1], {damage_per_second = 0}) + end + end +else + print ("[3d_armor] Fire Nodes disabled") +end + +if armor.config.water_protect == true or armor.config.fire_protect == true then + minetest.register_globalstep(function(dtime) + armor.timer = armor.timer + dtime + if armor.timer < armor.config.update_time then + return + end + for _,player in pairs(minetest.get_connected_players()) do + local name = player:get_player_name() + local pos = player:getpos() + local hp = player:get_hp() + if not name or not pos or not hp then + return + end + -- water breathing + if armor.config.water_protect == true then + if armor.def[name].water > 0 and + player:get_breath() < 10 then + player:set_breath(10) + end + end + -- fire protection + if armor.config.fire_protect == true then + local fire_damage = true + pos.y = pos.y + 1.4 -- head level + local node_head = minetest.get_node(pos).name + pos.y = pos.y - 1.2 -- feet level + local node_feet = minetest.get_node(pos).name + -- is player inside a hot node? + for _, row in pairs(armor.fire_nodes) do + -- check fire protection, if not enough then get hurt + if row[1] == node_head or row[1] == node_feet then + if fire_damage == true then + armor:punch(player, "fire") + last_punch_time[name] = minetest.get_gametime() + fire_damage = false + end + if hp > 0 and armor.def[name].fire < row[2] then + hp = hp - row[3] * armor.config.update_time + player:set_hp(hp) + break + end + end + end + end + end + armor.timer = 0 + end) +end diff --git a/worldmods/3d_armor_modpack/3d_armor/models/3d_armor_character.b3d b/worldmods/3d_armor_modpack/3d_armor/models/3d_armor_character.b3d new file mode 100644 index 0000000..7c27cae Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/models/3d_armor_character.b3d differ diff --git a/worldmods/3d_armor_modpack/3d_armor/models/3d_armor_character.blend b/worldmods/3d_armor_modpack/3d_armor/models/3d_armor_character.blend new file mode 100644 index 0000000..f61e222 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/models/3d_armor_character.blend differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_admin.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_admin.png new file mode 100644 index 0000000..78d60d5 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_admin.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_admin_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_admin_preview.png new file mode 100644 index 0000000..46bec8f Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_admin_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_bronze.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_bronze.png new file mode 100644 index 0000000..c4337df Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_bronze.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_bronze_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_bronze_preview.png new file mode 100644 index 0000000..5dfb5a5 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_bronze_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_cactus.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_cactus.png new file mode 100644 index 0000000..f651b48 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_cactus.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_cactus_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_cactus_preview.png new file mode 100644 index 0000000..9c9787b Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_cactus_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_crystal.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_crystal.png new file mode 100644 index 0000000..22d1fc4 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_crystal.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_crystal_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_crystal_preview.png new file mode 100644 index 0000000..c76fb9b Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_crystal_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_diamond.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_diamond.png new file mode 100644 index 0000000..c291fc6 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_diamond.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_diamond_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_diamond_preview.png new file mode 100644 index 0000000..eee8f55 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_diamond_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_gold.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_gold.png new file mode 100644 index 0000000..164634d Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_gold.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_gold_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_gold_preview.png new file mode 100644 index 0000000..0f9ac5e Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_gold_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_mithril.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_mithril.png new file mode 100644 index 0000000..72f1664 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_mithril.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_mithril_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_mithril_preview.png new file mode 100644 index 0000000..84dcc2f Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_mithril_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_steel.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_steel.png new file mode 100644 index 0000000..4028cbf Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_steel.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_steel_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_steel_preview.png new file mode 100644 index 0000000..386467b Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_steel_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_wood.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_wood.png new file mode 100644 index 0000000..7e36022 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_wood.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_wood_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_wood_preview.png new file mode 100644 index 0000000..0e76cd5 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_boots_wood_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_admin.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_admin.png new file mode 100644 index 0000000..9dbb7e4 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_admin.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_admin_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_admin_preview.png new file mode 100644 index 0000000..3b094b6 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_admin_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_bronze.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_bronze.png new file mode 100644 index 0000000..ea3adf8 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_bronze.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_bronze_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_bronze_preview.png new file mode 100644 index 0000000..1692604 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_bronze_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_cactus.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_cactus.png new file mode 100644 index 0000000..2833e17 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_cactus.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_cactus_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_cactus_preview.png new file mode 100644 index 0000000..570ff85 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_cactus_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_crystal.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_crystal.png new file mode 100644 index 0000000..b652910 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_crystal.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_crystal_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_crystal_preview.png new file mode 100644 index 0000000..ee042ef Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_crystal_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_diamond.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_diamond.png new file mode 100644 index 0000000..15e6034 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_diamond.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_diamond_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_diamond_preview.png new file mode 100644 index 0000000..96fc70e Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_diamond_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_gold.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_gold.png new file mode 100644 index 0000000..962b735 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_gold.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_gold_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_gold_preview.png new file mode 100644 index 0000000..2a5161a Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_gold_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_mithril.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_mithril.png new file mode 100644 index 0000000..01d6a31 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_mithril.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_mithril_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_mithril_preview.png new file mode 100644 index 0000000..a33522a Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_mithril_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_steel.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_steel.png new file mode 100644 index 0000000..03d0406 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_steel.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_steel_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_steel_preview.png new file mode 100644 index 0000000..9b682bf Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_steel_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_wood.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_wood.png new file mode 100644 index 0000000..91ecaf6 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_wood.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_wood_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_wood_preview.png new file mode 100644 index 0000000..bb6b2bc Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_chestplate_wood_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_admin.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_admin.png new file mode 100644 index 0000000..8a26c81 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_admin.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_admin_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_admin_preview.png new file mode 100644 index 0000000..fbd6929 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_admin_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_bronze.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_bronze.png new file mode 100644 index 0000000..b620e0a Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_bronze.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_bronze_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_bronze_preview.png new file mode 100644 index 0000000..813578e Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_bronze_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_cactus.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_cactus.png new file mode 100644 index 0000000..6f2561f Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_cactus.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_cactus_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_cactus_preview.png new file mode 100644 index 0000000..c1291c4 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_cactus_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_crystal.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_crystal.png new file mode 100644 index 0000000..e447f2c Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_crystal.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_crystal_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_crystal_preview.png new file mode 100644 index 0000000..33c596b Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_crystal_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_diamond.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_diamond.png new file mode 100644 index 0000000..a6551da Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_diamond.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_diamond_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_diamond_preview.png new file mode 100644 index 0000000..4c351b0 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_diamond_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_gold.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_gold.png new file mode 100644 index 0000000..b07ad01 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_gold.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_gold_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_gold_preview.png new file mode 100644 index 0000000..655db7c Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_gold_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_mithril.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_mithril.png new file mode 100644 index 0000000..fb4e457 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_mithril.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_mithril_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_mithril_preview.png new file mode 100644 index 0000000..477c464 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_mithril_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_steel.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_steel.png new file mode 100644 index 0000000..d7915c9 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_steel.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_steel_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_steel_preview.png new file mode 100644 index 0000000..97f024a Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_steel_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_wood.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_wood.png new file mode 100644 index 0000000..4132ce3 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_wood.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_wood_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_wood_preview.png new file mode 100644 index 0000000..b15ea19 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_helmet_wood_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_admin.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_admin.png new file mode 100644 index 0000000..5c9d1a4 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_admin.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_bronze.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_bronze.png new file mode 100644 index 0000000..4529c49 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_bronze.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_cactus.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_cactus.png new file mode 100644 index 0000000..5410c19 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_cactus.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_crystal.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_crystal.png new file mode 100644 index 0000000..715b58a Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_crystal.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_diamond.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_diamond.png new file mode 100644 index 0000000..dbae53a Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_diamond.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_gold.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_gold.png new file mode 100644 index 0000000..ad350b6 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_gold.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_mithril.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_mithril.png new file mode 100644 index 0000000..91e622d Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_mithril.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_steel.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_steel.png new file mode 100644 index 0000000..fa81cf8 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_steel.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_wood.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_wood.png new file mode 100644 index 0000000..5ad9662 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_boots_wood.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_admin.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_admin.png new file mode 100644 index 0000000..c5ddd97 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_admin.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_bronze.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_bronze.png new file mode 100644 index 0000000..f1256e4 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_bronze.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_cactus.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_cactus.png new file mode 100644 index 0000000..f8ed465 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_cactus.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_crystal.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_crystal.png new file mode 100644 index 0000000..a57bfd9 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_crystal.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_diamond.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_diamond.png new file mode 100644 index 0000000..09583ea Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_diamond.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_gold.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_gold.png new file mode 100644 index 0000000..1412697 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_gold.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_mithril.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_mithril.png new file mode 100644 index 0000000..faa9846 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_mithril.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_steel.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_steel.png new file mode 100644 index 0000000..f0222e7 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_steel.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_wood.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_wood.png new file mode 100644 index 0000000..b1f2305 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_chestplate_wood.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_admin.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_admin.png new file mode 100644 index 0000000..fe388ab Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_admin.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_bronze.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_bronze.png new file mode 100644 index 0000000..9bdc252 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_bronze.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_cactus.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_cactus.png new file mode 100644 index 0000000..03e8655 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_cactus.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_crystal.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_crystal.png new file mode 100644 index 0000000..2fede4a Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_crystal.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_diamond.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_diamond.png new file mode 100644 index 0000000..46c1f58 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_diamond.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_gold.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_gold.png new file mode 100644 index 0000000..d76a212 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_gold.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_mithril.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_mithril.png new file mode 100644 index 0000000..857d43f Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_mithril.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_steel.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_steel.png new file mode 100644 index 0000000..e705974 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_steel.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_wood.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_wood.png new file mode 100644 index 0000000..98f4d87 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_helmet_wood.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_admin.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_admin.png new file mode 100644 index 0000000..f994408 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_admin.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_bronze.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_bronze.png new file mode 100644 index 0000000..32748e9 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_bronze.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_cactus.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_cactus.png new file mode 100644 index 0000000..05f8853 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_cactus.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_crystal.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_crystal.png new file mode 100644 index 0000000..0c6da1f Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_crystal.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_diamond.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_diamond.png new file mode 100644 index 0000000..7373529 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_diamond.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_gold.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_gold.png new file mode 100644 index 0000000..29a840b Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_gold.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_mithril.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_mithril.png new file mode 100644 index 0000000..860ddae Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_mithril.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_steel.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_steel.png new file mode 100644 index 0000000..ce833d0 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_steel.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_wood.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_wood.png new file mode 100644 index 0000000..b7d042c Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_inv_leggings_wood.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_admin.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_admin.png new file mode 100644 index 0000000..22829ea Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_admin.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_admin_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_admin_preview.png new file mode 100644 index 0000000..5c70fac Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_admin_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_bronze.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_bronze.png new file mode 100644 index 0000000..a7ea904 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_bronze.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_bronze_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_bronze_preview.png new file mode 100644 index 0000000..19d247d Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_bronze_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_cactus.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_cactus.png new file mode 100644 index 0000000..0c253c0 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_cactus.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_cactus_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_cactus_preview.png new file mode 100644 index 0000000..ee5ab4c Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_cactus_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_crystal.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_crystal.png new file mode 100644 index 0000000..3572fd7 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_crystal.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_crystal_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_crystal_preview.png new file mode 100644 index 0000000..3d16482 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_crystal_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_diamond.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_diamond.png new file mode 100644 index 0000000..2f533e8 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_diamond.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_diamond_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_diamond_preview.png new file mode 100644 index 0000000..32d594a Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_diamond_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_gold.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_gold.png new file mode 100644 index 0000000..24b033c Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_gold.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_gold_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_gold_preview.png new file mode 100644 index 0000000..3ce1de8 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_gold_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_mithril.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_mithril.png new file mode 100644 index 0000000..b7fdfae Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_mithril.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_mithril_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_mithril_preview.png new file mode 100644 index 0000000..c3a68e9 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_mithril_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_steel.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_steel.png new file mode 100644 index 0000000..6bb2fbc Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_steel.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_steel_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_steel_preview.png new file mode 100644 index 0000000..f8c67c0 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_steel_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_wood.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_wood.png new file mode 100644 index 0000000..0923cd1 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_wood.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_wood_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_wood_preview.png new file mode 100644 index 0000000..b5f5667 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_leggings_wood_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_trans.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_trans.png new file mode 100644 index 0000000..4d7beb8 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_trans.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_ui_form.png b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_ui_form.png new file mode 100644 index 0000000..6e5cfee Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/3d_armor_ui_form.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/character_preview.png b/worldmods/3d_armor_modpack/3d_armor/textures/character_preview.png new file mode 100644 index 0000000..bf8e842 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/character_preview.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/inventory_plus_armor.png b/worldmods/3d_armor_modpack/3d_armor/textures/inventory_plus_armor.png new file mode 100644 index 0000000..98917ef Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor/textures/inventory_plus_armor.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor/textures/preview_index.txt b/worldmods/3d_armor_modpack/3d_armor/textures/preview_index.txt new file mode 100644 index 0000000..9e2fe9d --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor/textures/preview_index.txt @@ -0,0 +1,44 @@ +3d_armor/textures/3d_armor_helmet_wood.png:head +3d_armor/textures/3d_armor_chestplate_wood.png:torso +3d_armor/textures/3d_armor_leggings_wood.png:legs +3d_armor/textures/3d_armor_boots_wood.png:feet + +3d_armor/textures/3d_armor_helmet_cactus.png:head +3d_armor/textures/3d_armor_chestplate_cactus.png:torso +3d_armor/textures/3d_armor_leggings_cactus.png:legs +3d_armor/textures/3d_armor_boots_cactus.png:feet + +3d_armor/textures/3d_armor_helmet_steel.png:head +3d_armor/textures/3d_armor_chestplate_steel.png:torso +3d_armor/textures/3d_armor_leggings_steel.png:legs +3d_armor/textures/3d_armor_boots_steel.png:feet + +3d_armor/textures/3d_armor_helmet_bronze.png:head +3d_armor/textures/3d_armor_chestplate_bronze.png:torso +3d_armor/textures/3d_armor_leggings_bronze.png:legs +3d_armor/textures/3d_armor_boots_bronze.png:feet + +3d_armor/textures/3d_armor_helmet_gold.png:head +3d_armor/textures/3d_armor_chestplate_gold.png:torso +3d_armor/textures/3d_armor_leggings_gold.png:legs +3d_armor/textures/3d_armor_boots_gold.png:feet + +3d_armor/textures/3d_armor_helmet_diamond.png:head +3d_armor/textures/3d_armor_chestplate_diamond.png:torso +3d_armor/textures/3d_armor_leggings_diamond.png:legs +3d_armor/textures/3d_armor_boots_diamond.png:feet + +3d_armor/textures/3d_armor_helmet_mithril.png:head +3d_armor/textures/3d_armor_chestplate_mithril.png:torso +3d_armor/textures/3d_armor_leggings_mithril.png:legs +3d_armor/textures/3d_armor_boots_mithril.png:feet + +3d_armor/textures/3d_armor_helmet_crystal.png:head +3d_armor/textures/3d_armor_chestplate_crystal.png:torso +3d_armor/textures/3d_armor_leggings_crystal.png:legs +3d_armor/textures/3d_armor_boots_crystal.png:feet + +3d_armor/textures/3d_armor_helmet_admin.png:head +3d_armor/textures/3d_armor_chestplate_admin.png:torso +3d_armor/textures/3d_armor_leggings_admin.png:legs +3d_armor/textures/3d_armor_boots_admin.png:feet diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/LICENSE.txt b/worldmods/3d_armor_modpack/3d_armor_stand/LICENSE.txt new file mode 100644 index 0000000..65f46c8 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_stand/LICENSE.txt @@ -0,0 +1,22 @@ +[mod] 3d Armor Stand [3d_armor_stand] +===================================== + +License Source Code: (C) 2016-2017 Stuart Jones - LGPL v2.1 + +Lecense Models: (C) 2016-2017 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 + +(C) 2017 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 + +(C) 2016-2017 Stuart Jones - CC BY-SA 3.0 diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/README.txt b/worldmods/3d_armor_modpack/3d_armor_stand/README.txt new file mode 100644 index 0000000..6a98ab9 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_stand/README.txt @@ -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 | ++---+---+---+ + diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/depends.txt b/worldmods/3d_armor_modpack/3d_armor_stand/depends.txt new file mode 100644 index 0000000..fdbb290 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_stand/depends.txt @@ -0,0 +1,2 @@ +3d_armor + diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/init.lua b/worldmods/3d_armor_modpack/3d_armor_stand/init.lua new file mode 100644 index 0000000..8ebc851 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_stand/init.lua @@ -0,0 +1,341 @@ +local S = function(s) return s end +if minetest.global_exists("intllib") then + S = intllib.Getter() +end +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 + local texture = def.texture or item:gsub("%:", "_") + table.insert(textures, texture..".png") + 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:setyaw(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"}, + 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", "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"}, + 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", "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", "Armor Stand (owned by " .. + 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:getpos() + 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_craft({ + output = "3d_armor_stand:armor_stand", + recipe = { + {"", "default:fence_wood", ""}, + {"", "default:fence_wood", ""}, + {"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"}, + } +}) + diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_entity.obj b/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_entity.obj new file mode 100644 index 0000000..052f692 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_entity.obj @@ -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 diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand.obj b/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand.obj new file mode 100644 index 0000000..0df6dc7 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand.obj @@ -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 diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand.png b/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand.png new file mode 100644 index 0000000..aeb26de Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand_locked.png b/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand_locked.png new file mode 100644 index 0000000..3ee08b4 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor_stand/models/3d_armor_stand_locked.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_feet.png b/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_feet.png new file mode 100644 index 0000000..d04f9e3 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_feet.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_head.png b/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_head.png new file mode 100644 index 0000000..228c08e Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_head.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_legs.png b/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_legs.png new file mode 100644 index 0000000..66ec357 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_legs.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_torso.png b/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_torso.png new file mode 100644 index 0000000..af95ec7 Binary files /dev/null and b/worldmods/3d_armor_modpack/3d_armor_stand/textures/3d_armor_stand_torso.png differ diff --git a/worldmods/3d_armor_modpack/3d_armor_ui/LICENSE.txt b/worldmods/3d_armor_modpack/3d_armor_ui/LICENSE.txt new file mode 100644 index 0000000..50859b0 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_ui/LICENSE.txt @@ -0,0 +1,5 @@ +[mod] 3d Armor integration to unified inventory [3d_armor_ui] +============================================================= + +License Source Code: (C) 2012-2017 Stuart Jones - LGPL v2.1 + diff --git a/worldmods/3d_armor_modpack/3d_armor_ui/depends.txt b/worldmods/3d_armor_modpack/3d_armor_ui/depends.txt new file mode 100644 index 0000000..cf4ccf9 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_ui/depends.txt @@ -0,0 +1,2 @@ +3d_armor +unified_inventory? diff --git a/worldmods/3d_armor_modpack/3d_armor_ui/description.txt b/worldmods/3d_armor_modpack/3d_armor_ui/description.txt new file mode 100644 index 0000000..873f876 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_ui/description.txt @@ -0,0 +1 @@ +Adds 3d_armor page to the unified inventory diff --git a/worldmods/3d_armor_modpack/3d_armor_ui/init.lua b/worldmods/3d_armor_modpack/3d_armor_ui/init.lua new file mode 100644 index 0000000..763e731 --- /dev/null +++ b/worldmods/3d_armor_modpack/3d_armor_ui/init.lua @@ -0,0 +1,51 @@ +if not minetest.global_exists("unified_inventory") then + minetest.log("warning", "3d_armor_ui: Mod loaded but unused.") + return +end +local S = function(s) return s end +if minetest.global_exists("intllib") then + S = intllib.Getter() +end + +if unified_inventory.sfinv_compat_layer then + return +end + +armor:register_on_update(function(player) + local name = player:get_player_name() + if unified_inventory.current_page[name] == "armor" then + unified_inventory.set_inventory_formspec(player, "armor") + end +end) + +unified_inventory.register_button("armor", { + type = "image", + image = "inventory_plus_armor.png", +}) + +unified_inventory.register_page("armor", { + get_formspec = function(player, perplayer_formspec) + local fy = perplayer_formspec.formspec_y + local name = player:get_player_name() + if armor.def[name].init_time == 0 then + return {formspec="label[0,0;Armor not initialized!]"} + end + local formspec = "background[0.06,"..fy..";7.92,7.52;3d_armor_ui_form.png]".. + "label[0,0;Armor]".. + "list[detached:"..name.."_armor;armor;0,"..fy..";2,3;]".. + "image[2.5,"..(fy - 0.25)..";2,4;"..armor.textures[name].preview.."]".. + "label[5.0,"..(fy + 0.0)..";"..S("Level")..": "..armor.def[name].level.."]".. + "label[5.0,"..(fy + 0.5)..";"..S("Heal")..": "..armor.def[name].heal.."]".. + "listring[current_player;main]".. + "listring[detached:"..name.."_armor;armor]" + if armor.config.fire_protect then + formspec = formspec.."label[5.0,"..(fy + 1.0)..";".. + S("Fire")..": "..armor.def[name].fire.."]" + end + if minetest.global_exists("technic") then + formspec = formspec.."label[5.0,"..(fy + 1.5)..";".. + S("Radiation")..": "..armor.def[name].groups["radiation"].."]" + end + return {formspec=formspec} + end, +}) diff --git a/worldmods/3d_armor_modpack/LICENSE.md b/worldmods/3d_armor_modpack/LICENSE.md new file mode 100644 index 0000000..18df885 --- /dev/null +++ b/worldmods/3d_armor_modpack/LICENSE.md @@ -0,0 +1,9 @@ +3D Armor - Visible Player Armor +=============================== + +License Source Code: Copyright (C) 2013-2017 Stuart Jones - LGPL v2.1 + +Armor Textures: Copyright (C) 2017 davidthecreator - CC-BY-SA 3.0 + +Special credit to Jordach and MirceaKitsune for providing the default 3d character model. + diff --git a/worldmods/3d_armor_modpack/README.md b/worldmods/3d_armor_modpack/README.md new file mode 100644 index 0000000..443c70b --- /dev/null +++ b/worldmods/3d_armor_modpack/README.md @@ -0,0 +1,86 @@ +Modpack - 3d Armor [0.4.9] +========================== + +### Table of Contents + + + + +- [[mod] Visible Player Armor [3d_armor]](#mod-visible-player-armor-3d_armor) +- [[mod] Visible Wielded Items [wieldview]](#mod-visible-wielded-items-wieldview) +- [[mod] Shields [shields]](#mod-shields-shields) +- [[mod] Technic Armor [technic_armor]](#mod-technic-armor-technic_armor) +- [[mod] Hazmat Suit [hazmat_suit]](#mod-hazmat-suit-hazmat_suit) +- [[mod] 3d Armor Stand [3d_armor_stand]](#mod-3d-armor-stand-3d_armor_stand) + + + + +[mod] Visible Player Armor [3d_armor] +------------------------------------- + +Minetest Version: 0.4.15 + +Game: minetest_game and many derivatives + +Depends: default + +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 attack. + +Armor takes damage when a player is hurt, however, many armor items offer a 'stackable' +percentage chance of restoring the lost health points. Overall armor level is boosted by 10% +when wearing a full matching set (helmet, chestplate, leggings and boots of the same material) + +Fire protection has been added by TenPlus1 and in use when ethereal mod is found and crystal +armor has been enabled. each piece of armor offers 1 fire protection, level 1 protects +against torches, level 2 against crystal spikes, 3 for fire and 5 protects when in lava. + +Compatible with sfinv, inventory plus or unified inventory by enabling the appropriate +inventory module, [3d_armor_sfinv], [3d_armor_ip] and [3d_armor_ui] respectively. +Also compatible with [smart_inventory] without the need for additional modules. + +built in support player skins [skins] by Zeg9 and Player Textures [player_textures] by PilzAdam +and [simple_skins] by TenPlus1. + +Armor can be configured by adding a file called armor.conf in 3d_armor mod or world directory. +see armor.conf.example for all available options. + +[mod] Visible Wielded Items [wieldview] +--------------------------------------- + +Depends: 3d_armor + +Makes hand wielded items visible to other players. + +[mod] Shields [shields] +----------------------- + +Depends: 3d_armor + +Originally a part of 3d_armor, shields have been re-included as an optional extra. +If you do not want shields then simply remove the shields folder from the modpack. + +[mod] Technic Armor [technic_armor] +----------------------------------- + +Depends: 3d_armor, technic_worldgen + +Adds tin, silver and technic materials to 3d_armor. +Requires technic (technic_worldgen at least) mod. + +[mod] Hazmat Suit [hazmat_suit] +------------------------------- + +Depends: 3d_armor, technic + +Adds hazmat suit to 3d_armor. It protects rather well from fire (if enabled in configuration) and radiation*, and it has built-in oxygen supply. + +Requires technic mod. + +[mod] 3d Armor Stand [3d_armor_stand] +------------------------------------- + +Depends: 3d_armor + +Adds a chest-like armor stand for armor storage and display. diff --git a/worldmods/3d_armor_modpack/description.txt b/worldmods/3d_armor_modpack/description.txt new file mode 100644 index 0000000..2da5ba4 --- /dev/null +++ b/worldmods/3d_armor_modpack/description.txt @@ -0,0 +1 @@ +Visible player armor & wielded items. diff --git a/worldmods/3d_armor_modpack/modpack.txt b/worldmods/3d_armor_modpack/modpack.txt new file mode 100644 index 0000000..e69de29 diff --git a/worldmods/3d_armor_modpack/preview_gen.py b/worldmods/3d_armor_modpack/preview_gen.py new file mode 100755 index 0000000..a18954d --- /dev/null +++ b/worldmods/3d_armor_modpack/preview_gen.py @@ -0,0 +1,81 @@ +#!/usr/bin/python + +import os +import sys +import Image + +try : + arg = sys.argv[1] +except IndexError : + print "Usage: preview_gen.py " + sys.exit(1) + +try : + index = open(arg, "r") +except IOError : + print "Failed to open index file%s" %s (arg) + sys.exit(1) + +preview = [] + +for line in index.readlines() : + if ":" in line : + line = line.rstrip('\n') + preview.append(line.split(':')) + +print "Generating preview images..." +for fn, place in preview : + try : + imi = Image.open(fn) + except IOError : + print "Failed to open %s" % (fn) + sys.exit(1) + + w, h = imi.size + if h != w / 2: + print "Incompatible texture size %s" % (fn) + sys.exit(1) + + s = w / 64 + imo = Image.new("RGBA", (16 * s, 32 * s)) + + if place == "all" or place == "head" : + face = (40 * s, 8 * s, 48 * s, 16 * s) + side_l = (56 * s, 8 * s, 57 * s, 16 * s) + side_r = (63 * s, 8 * s, 64 * s, 16 * s) + imo.paste(imi.crop(side_l), (4 * s, 0, 5 * s, 8 * s)) + imo.paste(imi.crop(side_r), (11 * s, 0, 12 * s, 8 * s)) + imo.paste(imi.crop(face), (4 * s, 0, 12 * s, 8 * s)) + + if place == "all" or place == "torso" : + arm = (44 * s, 20 * s, 48 * s, 32 * s) + body = (20 * s, 20 * s, 28 * s, 32 * s) + imo.paste(imi.crop(arm), (0 * s, 8 * s, 4 * s, 20 * s)) + imo.paste(imi.crop(arm).transpose(Image.FLIP_LEFT_RIGHT), + (12 * s, 8 * s, 16 * s, 20 * s)) + imo.paste(imi.crop(body), (4 * s, 8 * s, 12 * s, 20 * s)) + + if place == "all" or place == "legs" : + leg = (4 * s, 20 * s, 8 * s, 32 * s) + imo.paste(imi.crop(leg), (4 * s, 20 * s, 8 * s, 32 * s)) + imo.paste(imi.crop(leg).transpose(Image.FLIP_LEFT_RIGHT), + (8 * s, 20 * s, 12 * s, 32 * s)) + + if place == "all" or place == "feet" : + boot = (20 * s, 4 * s, 24 * s, 11 * s) + imo.paste(imi.crop(boot), (4 * s, 25 * s, 8 * s, 32 * s)) + imo.paste(imi.crop(boot).transpose(Image.FLIP_LEFT_RIGHT), + (8 * s, 25 * s, 12 * s, 32 * s)) + + size = (32 * s, 64 * s) + imo = imo.resize(size) + + if place == "shield" : + shield = (0, 0, 16 * s, 16 * s) + imo.paste(imi.crop(shield), (16 * s, 32 * s, 32 * s, 48 * s)) + + outfile = fn.replace(".png", "_preview.png") + imo.save(outfile) + print outfile + + diff --git a/worldmods/3d_armor_modpack/screenshot.png b/worldmods/3d_armor_modpack/screenshot.png new file mode 100644 index 0000000..f568cea Binary files /dev/null and b/worldmods/3d_armor_modpack/screenshot.png differ diff --git a/worldmods/3d_armor_modpack/shields/LICENSE.txt b/worldmods/3d_armor_modpack/shields/LICENSE.txt new file mode 100644 index 0000000..316bc89 --- /dev/null +++ b/worldmods/3d_armor_modpack/shields/LICENSE.txt @@ -0,0 +1,8 @@ +[mod] Shields [shields] +======================= + +License Source Code: Copyright (C) 2013-2017 Stuart Jones - LGPL v2.1 + +License Textures: Copyright (C) 2017 davidthecreator - CC-BY-SA 3.0 + +https://github.com/daviddoesminetest/3d-armors-new-textures diff --git a/worldmods/3d_armor_modpack/shields/README.txt b/worldmods/3d_armor_modpack/shields/README.txt new file mode 100644 index 0000000..d71626d --- /dev/null +++ b/worldmods/3d_armor_modpack/shields/README.txt @@ -0,0 +1,9 @@ +[mod] Shields [shields] +======================= + +Adds shields to 3d_armor + +Depends: 3d_armor + +Originally a part of 3d_armor, shields have been re-included as an optional extra. +If you do not what shields then simply remove the shields folder from the modpack. diff --git a/worldmods/3d_armor_modpack/shields/crafting_guide.txt b/worldmods/3d_armor_modpack/shields/crafting_guide.txt new file mode 100644 index 0000000..9b61dde --- /dev/null +++ b/worldmods/3d_armor_modpack/shields/crafting_guide.txt @@ -0,0 +1,36 @@ +Shields -- Crafting Guide +-------------------------- + ++---+---+---+ +| X | X | X | ++---+---+---+ +| X | X | X | ++---+---+---+ +| | X | | ++---+---+---+ + +[shields:shield_wood] X = [default:wood] +[shields:shield_cactus] X = [default:cactus] +[shields:shield_steel] X = [default:steel_ingot] +[shields:shield_bronze] X = [default:bronze_ingot] +[shields:shield_diamond] X = [default:diamond] +[shields:shield_gold] X = [default:gold_ingot] +[shields:shield_mithril] X = [moreores:mithril_ingot] +[shields:shield_crystal] X = [ethereal:crystal_ingot] + +Enhanced Shields +---------------- + ++---+ +| S | ++---+ +| X | ++---+ +| S | ++---+ + +[shields:shield_enhanced_wood] X = [shields:shield_wood] +[shields:shield_enhanced_cactus] X = [shields:shield_cactus] + +S = [default:steel_ingot] + diff --git a/worldmods/3d_armor_modpack/shields/depends.txt b/worldmods/3d_armor_modpack/shields/depends.txt new file mode 100644 index 0000000..585cc7a --- /dev/null +++ b/worldmods/3d_armor_modpack/shields/depends.txt @@ -0,0 +1,2 @@ +default +3d_armor diff --git a/worldmods/3d_armor_modpack/shields/description.txt b/worldmods/3d_armor_modpack/shields/description.txt new file mode 100644 index 0000000..cb378bb --- /dev/null +++ b/worldmods/3d_armor_modpack/shields/description.txt @@ -0,0 +1 @@ +Adds visible shields to 3d armor. diff --git a/worldmods/3d_armor_modpack/shields/init.lua b/worldmods/3d_armor_modpack/shields/init.lua new file mode 100644 index 0000000..3128eff --- /dev/null +++ b/worldmods/3d_armor_modpack/shields/init.lua @@ -0,0 +1,237 @@ +local S = function(s) return s end +if minetest.global_exists("intllib") then + S = intllib.Getter() +end +local use_moreores = minetest.get_modpath("moreores") +local function play_sound_effect(player, name) + if player then + local pos = player:getpos() + if pos then + minetest.sound_play({ + pos = pos, + name = name, + max_hear_distance = 10, + gain = 0.5, + }) + end + end +end + +if minetest.global_exists("armor") and armor.elements then + table.insert(armor.elements, "shield") + local mult = armor.config.level_multiplier or 1 + armor.config.level_multiplier = mult * 0.9 +end + +-- Regisiter Shields + +armor:register_armor("shields:shield_admin", { + description = S("Admin Shield"), + inventory_image = "shields_inv_shield_admin.png", + groups = {armor_shield=1000, armor_heal=100, armor_use=0, not_in_creative_inventory=1}, + on_punched = function(player, hitter, time_from_last_punch, tool_capabilities) + if type(hitter) == "userdata" then + if hitter:is_player() then + hitter:set_wielded_item("") + end + play_sound_effect(player, "default_dig_metal") + end + return false + end, +}) + +minetest.register_alias("adminshield", "shields:shield_admin") + +if armor.materials.wood then + armor:register_armor("shields:shield_wood", { + description = S("Wooden Shield"), + inventory_image = "shields_inv_shield_wood.png", + groups = {armor_shield=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}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_wood_footstep") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_wood_footstep") + end, + }) + armor:register_armor("shields:shield_enhanced_wood", { + description = S("Enhanced Wood Shield"), + inventory_image = "shields_inv_shield_enhanced_wood.png", + groups = {armor_shield=1, armor_heal=0, armor_use=2000}, + armor_groups = {fleshy=8}, + damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=2}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_dig_metal") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_dug_metal") + end, + }) + minetest.register_craft({ + output = "shields:shield_enhanced_wood", + recipe = { + {"default:steel_ingot"}, + {"shields:shield_wood"}, + {"default:steel_ingot"}, + }, + }) +end + +if armor.materials.cactus then + armor:register_armor("shields:shield_cactus", { + description = S("Cactus Shield"), + inventory_image = "shields_inv_shield_cactus.png", + groups = {armor_shield=1, armor_heal=0, armor_use=1000}, + armor_groups = {fleshy=5}, + damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_wood_footstep") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_wood_footstep") + end, + }) + armor:register_armor("shields:shield_enhanced_cactus", { + description = S("Enhanced Cactus Shield"), + inventory_image = "shields_inv_shield_enhanced_cactus.png", + groups = {armor_shield=1, armor_heal=0, armor_use=1000}, + armor_groups = {fleshy=8}, + damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=2}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_dig_metal") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_dug_metal") + end, + }) + minetest.register_craft({ + output = "shields:shield_enhanced_cactus", + recipe = { + {"default:steel_ingot"}, + {"shields:shield_cactus"}, + {"default:steel_ingot"}, + }, + }) +end + +if armor.materials.steel then + armor:register_armor("shields:shield_steel", { + description = S("Steel Shield"), + inventory_image = "shields_inv_shield_steel.png", + groups = {armor_shield=1, armor_heal=0, armor_use=800, + physics_speed=-0.03, physics_gravity=0.03}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_dig_metal") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_dug_metal") + end, + }) +end + +if armor.materials.bronze then + armor:register_armor("shields:shield_bronze", { + description = S("Bronze Shield"), + inventory_image = "shields_inv_shield_bronze.png", + groups = {armor_shield=1, armor_heal=6, armor_use=400, + physics_speed=-0.03, physics_gravity=0.03}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_dig_metal") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_dug_metal") + end, + }) +end + +if armor.materials.diamond then + armor:register_armor("shields:shield_diamond", { + description = S("Diamond Shield"), + inventory_image = "shields_inv_shield_diamond.png", + groups = {armor_shield=1, armor_heal=12, armor_use=200}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, choppy=1, level=3}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_glass_footstep") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_break_glass") + end, + }) +end + +if armor.materials.gold then + armor:register_armor("shields:shield_gold", { + description = S("Gold Shield"), + inventory_image = "shields_inv_shield_gold.png", + groups = {armor_shield=1, armor_heal=6, armor_use=300, + physics_speed=-0.04, physics_gravity=0.04}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_dig_metal") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_dug_metal") + end, + }) +end + +if armor.materials.mithril then + armor:register_armor("shields:shield_mithril", { + description = S("Mithril Shield"), + inventory_image = "shields_inv_shield_mithril.png", + groups = {armor_shield=1, armor_heal=12, armor_use=100}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, level=3}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_glass_footstep") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_break_glass") + end, + }) +end + +if armor.materials.crystal then + armor:register_armor("shields:shield_crystal", { + description = S("Crystal Shield"), + inventory_image = "shields_inv_shield_crystal.png", + groups = {armor_shield=1, armor_heal=12, armor_use=100, armor_fire=1}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=2, snappy=1, level=3}, + reciprocate_damage = true, + on_damage = function(player, index, stack) + play_sound_effect(player, "default_glass_footstep") + end, + on_destroy = function(player, index, stack) + play_sound_effect(player, "default_break_glass") + end, + }) +end + +for k, v in pairs(armor.materials) do + minetest.register_craft({ + output = "shields:shield_"..k, + recipe = { + {v, v, v}, + {v, v, v}, + {"", v, ""}, + }, + }) +end diff --git a/worldmods/3d_armor_modpack/shields/textures/preview_index.txt b/worldmods/3d_armor_modpack/shields/textures/preview_index.txt new file mode 100644 index 0000000..4408c61 --- /dev/null +++ b/worldmods/3d_armor_modpack/shields/textures/preview_index.txt @@ -0,0 +1,11 @@ +shields/textures/shields_shield_wood.png:shield +shields/textures/shields_shield_enhanced_wood.png:shield +shields/textures/shields_shield_cactus.png:shield +shields/textures/shields_shield_enhanced_cactus.png:shield +shields/textures/shields_shield_steel.png:shield +shields/textures/shields_shield_bronze.png:shield +shields/textures/shields_shield_gold.png:shield +shields/textures/shields_shield_diamond.png:shield +shields/textures/shields_shield_mithril.png:shield +shields/textures/shields_shield_crystal.png:shield +shields/textures/shields_shield_admin.png:shield diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_admin.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_admin.png new file mode 100644 index 0000000..434adae Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_admin.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_bronze.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_bronze.png new file mode 100644 index 0000000..dab60e3 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_bronze.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_cactus.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_cactus.png new file mode 100644 index 0000000..37d0ec6 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_cactus.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_crystal.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_crystal.png new file mode 100644 index 0000000..f32e2dd Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_crystal.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_diamond.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_diamond.png new file mode 100644 index 0000000..bfcd1fe Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_diamond.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_enhanced_cactus.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_enhanced_cactus.png new file mode 100644 index 0000000..923e42d Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_enhanced_cactus.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_enhanced_wood.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_enhanced_wood.png new file mode 100644 index 0000000..b4d4256 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_enhanced_wood.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_gold.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_gold.png new file mode 100644 index 0000000..cf11e2c Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_gold.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_mithril.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_mithril.png new file mode 100644 index 0000000..e377428 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_mithril.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_steel.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_steel.png new file mode 100644 index 0000000..1b9bb00 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_steel.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_wood.png b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_wood.png new file mode 100644 index 0000000..6876414 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_inv_shield_wood.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_admin.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_admin.png new file mode 100644 index 0000000..61e1ae0 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_admin.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_admin_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_admin_preview.png new file mode 100644 index 0000000..b61896f Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_admin_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_bronze.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_bronze.png new file mode 100644 index 0000000..d2cb2e4 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_bronze.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_bronze_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_bronze_preview.png new file mode 100644 index 0000000..1dd4747 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_bronze_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_cactus.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_cactus.png new file mode 100644 index 0000000..36341cb Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_cactus.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_cactus_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_cactus_preview.png new file mode 100644 index 0000000..385273b Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_cactus_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_crystal.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_crystal.png new file mode 100644 index 0000000..db53560 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_crystal.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_crystal_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_crystal_preview.png new file mode 100644 index 0000000..e3b6823 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_crystal_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_diamond.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_diamond.png new file mode 100644 index 0000000..af490ce Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_diamond.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_diamond_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_diamond_preview.png new file mode 100644 index 0000000..ebe82e4 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_diamond_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_cactus.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_cactus.png new file mode 100644 index 0000000..a5bea43 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_cactus.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_cactus_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_cactus_preview.png new file mode 100644 index 0000000..22413f6 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_cactus_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_wood.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_wood.png new file mode 100644 index 0000000..ebeacfe Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_wood.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_wood_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_wood_preview.png new file mode 100644 index 0000000..95fed1d Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_enhanced_wood_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_gold.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_gold.png new file mode 100644 index 0000000..d8d4ae3 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_gold.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_gold_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_gold_preview.png new file mode 100644 index 0000000..4cdac6e Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_gold_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_mithril.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_mithril.png new file mode 100644 index 0000000..76b9312 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_mithril.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_mithril_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_mithril_preview.png new file mode 100644 index 0000000..640de99 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_mithril_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_steel.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_steel.png new file mode 100644 index 0000000..8c77ee4 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_steel.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_steel_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_steel_preview.png new file mode 100644 index 0000000..c795a95 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_steel_preview.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_wood.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_wood.png new file mode 100644 index 0000000..695d12b Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_wood.png differ diff --git a/worldmods/3d_armor_modpack/shields/textures/shields_shield_wood_preview.png b/worldmods/3d_armor_modpack/shields/textures/shields_shield_wood_preview.png new file mode 100644 index 0000000..d7695d3 Binary files /dev/null and b/worldmods/3d_armor_modpack/shields/textures/shields_shield_wood_preview.png differ diff --git a/worldmods/3d_armor_modpack/wieldview/LICENSE.txt b/worldmods/3d_armor_modpack/wieldview/LICENSE.txt new file mode 100644 index 0000000..4e8d524 --- /dev/null +++ b/worldmods/3d_armor_modpack/wieldview/LICENSE.txt @@ -0,0 +1,5 @@ +[mod] visible wielded items [wieldview] +======================================= + +License Source Code: Copyright (C) 2013-2017 Stuart Jones - LGPL v2.1 + diff --git a/worldmods/3d_armor_modpack/wieldview/README.txt b/worldmods/3d_armor_modpack/wieldview/README.txt new file mode 100644 index 0000000..ffa5ef0 --- /dev/null +++ b/worldmods/3d_armor_modpack/wieldview/README.txt @@ -0,0 +1,23 @@ +[mod] visible wielded items [wieldview] +======================================= + +Depends on: 3d_armor + +Makes hand wielded items visible to other players. + +default settings: [minetest.conf] + +# Set number of seconds between visible wielded item updates. +wieldview_update_time = 2 + +# Show nodes as tiles, disabled by default +wieldview_node_tiles = false + + +Info for modders +################ + +Wield image transformation: To apply a simple transformation to the item in +hand, add the group “wieldview_transform” to the item definition. The group +rating equals one of the numbers used for the [transform texture modifier +of the Lua API. diff --git a/worldmods/3d_armor_modpack/wieldview/depends.txt b/worldmods/3d_armor_modpack/wieldview/depends.txt new file mode 100644 index 0000000..b6cac21 --- /dev/null +++ b/worldmods/3d_armor_modpack/wieldview/depends.txt @@ -0,0 +1 @@ +3d_armor diff --git a/worldmods/3d_armor_modpack/wieldview/description.txt b/worldmods/3d_armor_modpack/wieldview/description.txt new file mode 100644 index 0000000..0d51ad9 --- /dev/null +++ b/worldmods/3d_armor_modpack/wieldview/description.txt @@ -0,0 +1 @@ +Makes hand wielded items visible to other players. diff --git a/worldmods/3d_armor_modpack/wieldview/init.lua b/worldmods/3d_armor_modpack/wieldview/init.lua new file mode 100644 index 0000000..45f9fca --- /dev/null +++ b/worldmods/3d_armor_modpack/wieldview/init.lua @@ -0,0 +1,83 @@ +local time = 0 +local update_time = tonumber(minetest.settings:get("wieldview_update_time")) +if not update_time then + update_time = 2 + minetest.settings:set("wieldview_update_time", tostring(update_time)) +end +local node_tiles = minetest.settings:get_bool("wieldview_node_tiles") +if not node_tiles then + node_tiles = false + minetest.settings:set("wieldview_node_tiles", "false") +end + +wieldview = { + wielded_item = {}, + transform = {}, +} + +dofile(minetest.get_modpath(minetest.get_current_modname()).."/transform.lua") + +wieldview.get_item_texture = function(self, item) + local texture = "3d_armor_trans.png" + if item ~= "" then + if minetest.registered_items[item] then + if minetest.registered_items[item].inventory_image ~= "" then + texture = minetest.registered_items[item].inventory_image + elseif node_tiles == true and minetest.registered_items[item].tiles + and type(minetest.registered_items[item].tiles[1]) == "string" + and minetest.registered_items[item].tiles[1] ~= "" then + texture = minetest.inventorycube(minetest.registered_items[item].tiles[1]) + end + end + -- Get item image transformation, first from group, then from transform.lua + local transform = minetest.get_item_group(item, "wieldview_transform") + if transform == 0 then + transform = wieldview.transform[item] + end + if transform then + -- This actually works with groups ratings because transform1, transform2, etc. + -- have meaning and transform0 is used for identidy, so it can be ignored + texture = texture.."^[transform"..tostring(transform) + end + end + return texture +end + +wieldview.update_wielded_item = function(self, player) + if not player then + return + end + local name = player:get_player_name() + local stack = player:get_wielded_item() + local item = stack:get_name() + if not item then + return + end + if self.wielded_item[name] then + if self.wielded_item[name] == item then + return + end + armor.textures[name].wielditem = self:get_item_texture(item) + armor:update_player_visuals(player) + end + self.wielded_item[name] = item +end + +minetest.register_on_joinplayer(function(player) + local name = player:get_player_name() + wieldview.wielded_item[name] = "" + minetest.after(0, function(player) + wieldview:update_wielded_item(player) + end, player) +end) + +minetest.register_globalstep(function(dtime) + time = time + dtime + if time > update_time then + for _,player in ipairs(minetest.get_connected_players()) do + wieldview:update_wielded_item(player) + end + time = 0 + end +end) + diff --git a/worldmods/3d_armor_modpack/wieldview/transform.lua b/worldmods/3d_armor_modpack/wieldview/transform.lua new file mode 100644 index 0000000..4d5133e --- /dev/null +++ b/worldmods/3d_armor_modpack/wieldview/transform.lua @@ -0,0 +1,24 @@ +-- Wielded Item Transformations - http://dev.minetest.net/texture + +wieldview.transform = { + ["default:torch"]="R270", + ["default:sapling"]="R270", + ["flowers:dandelion_white"]="R270", + ["flowers:dandelion_yellow"]="R270", + ["flowers:geranium"]="R270", + ["flowers:rose"]="R270", + ["flowers:tulip"]="R270", + ["flowers:viola"]="R270", + ["bucket:bucket_empty"]="R270", + ["bucket:bucket_water"]="R270", + ["bucket:bucket_lava"]="R270", + ["screwdriver:screwdriver"]="R270", + ["screwdriver:screwdriver1"]="R270", + ["screwdriver:screwdriver2"]="R270", + ["screwdriver:screwdriver3"]="R270", + ["screwdriver:screwdriver4"]="R270", + ["vessels:glass_bottle"]="R270", + ["vessels:drinking_glass"]="R270", + ["vessels:steel_bottle"]="R270", +} +