commit c571a48fcb853b1c8e7539b71567512fffd6c4ab Author: Giov4 Date: Sun May 2 01:11:56 2021 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba96b08 --- /dev/null +++ b/.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/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..88349af --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,32 @@ + +unused_args = false + +globals = { + "wieldview", + "armor", + "inventory_plus" +} + +read_globals = { + -- Stdlib + string = {fields = {"split"}}, + table = {fields = {"copy", "getn"}}, + + -- Minetest + "vector", "ItemStack", + "dump", "VoxelArea", + + -- deps + "default", + "minetest", + "unified_inventory", + "wardrobe", + "player_monoids", + "armor_monoid", + "sfinv", + "ARMOR_MATERIALS", + "ARMOR_FIRE_NODES", + "pova", + "skins", + "u_skins" +} diff --git a/3d_armor/LICENSE.txt b/3d_armor/LICENSE.txt new file mode 100644 index 0000000..f253f29 --- /dev/null +++ b/3d_armor/LICENSE.txt @@ -0,0 +1,26 @@ +[mod] 3d Armor [3d_armor] +========================= + +License Source Code +------------------- + +Copyright (C) 2012-2019 stujones11, Stuart Jones + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +License Textures +---------------- + +Copyright (C) 2017-2019 davidthecreator - CC-BY-SA 3.0 diff --git a/3d_armor/README.txt b/3d_armor/README.txt new file mode 100644 index 0000000..b8980b5 --- /dev/null +++ b/3d_armor/README.txt @@ -0,0 +1,212 @@ +[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 = 2 + +-- Number of initialization attempts. +-- Use in conjunction with armor_init_delay if initialization problems persist. +armor_init_times = 10 + +-- 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 + +-- Enable migration of old armor inventories +armor_migrate_old_inventory = 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:get_pos() + 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. + +armor:remove_all(player) + +Removes all armors from the player's inventory without triggering any callback. + +armor:equip(player, armor_name) + +Equip the armor, removing the itemstack from the main inventory if there's one. + +armor:unequip(player, armor_name) + +Unequip the armor, adding the itemstack to the main inventory. + +armor:update_skin(player_name) + +Triggers a skin update with the same action as if a field with `skins_set` was submitted. + +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) + + +Note: + +The player physics modifications won't be applied via `set_physics_override` if `player_physics_locked` is set to 1 +in the respective player's meta. diff --git a/3d_armor/api.lua b/3d_armor/api.lua new file mode 100644 index 0000000..1c9cd98 --- /dev/null +++ b/3d_armor/api.lua @@ -0,0 +1,631 @@ +-- support for i18n +local S = minetest.get_translator(minetest.get_current_modname()) + +local skin_previews = {} +local use_player_monoids = minetest.global_exists("player_monoids") +local use_armor_monoid = minetest.global_exists("armor_monoid") +local use_pova_mod = minetest.get_modpath("pova") +local armor_def = setmetatable({}, { + __index = function() + return setmetatable({ + groups = setmetatable({}, { + __index = function() + return 0 + end}) + }, { + __index = function() + return 0 + end + }) + end, +}) +local armor_textures = setmetatable({}, { + __index = function() + return setmetatable({}, { + __index = function() + return "blank.png" + end + }) + end +}) + +armor = { + timer = 0, + elements = {"head", "torso", "legs", "feet"}, + physics = {"jump", "speed", "gravity"}, + attributes = {"heal", "fire", "water"}, + 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 = {}, + }, + migrate_old_inventory = true, + version = "0.4.13", + get_translator = S +} + +armor.config = { + init_delay = 2, + init_times = 10, + bones_delay = 1, + update_time = 1, + drop = minetest.get_modpath("bones") ~= nil, + destroy = false, + level_multiplier = 1, + heal_multiplier = 1, + material_wood = true, + material_cactus = true, + material_steel = true, + material_bronze = true, + material_diamond = true, + material_gold = true, + material_mithril = true, + material_crystal = true, + water_protect = true, + fire_protect = minetest.get_modpath("ethereal") ~= nil, + punch_damage = true, +} + +-- Armor Registration + +armor.register_armor = function(self, name, def) + def.on_secondary_use = function(itemstack, player) + return armor:equip(player, itemstack) + end + def.on_place = function(itemstack, player, pointed_thing) + if pointed_thing.type == "node" and player and not player:get_player_control().sneak then + local node = minetest.get_node(pointed_thing.under) + local ndef = minetest.registered_nodes[node.name] + if ndef and ndef.on_rightclick then + return ndef.on_rightclick(pointed_thing.under, node, player, itemstack, pointed_thing) + end + end + return armor:equip(player, itemstack) + end + 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() + self.textures[name].skin = armor:get_player_skin(name) + if self.textures[name] then + player:set_properties({ + textures = { + self.textures[name].skin, + self.textures[name].armor, + self.textures[name].wielditem, + } + }) + end + self:run_callbacks("on_update", player) +end + +armor.set_player_armor = function(self, player) + local name, armor_inv = self:get_valid_player(player, "[set_player_armor]") + if not name then + return + end + local state = 0 + local count = 0 + local material = {count=1} + local preview = armor:get_preview(name) + local texture = "3d_armor_trans.png" + 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 = armor_inv:get_list("armor") + if type(list) ~= "table" then + return + end + for i, stack in pairs(list) do + if stack:get_count() == 1 then + local def = stack:get_definition() + for _, element in pairs(self.elements) do + if def.groups["armor_"..element] then + if def.armor_groups then + for group, level in pairs(def.armor_groups) do + if levels[group] then + levels[group] = levels[group] + level + end + end + else + local level = def.groups["armor_"..element] + levels["fleshy"] = levels["fleshy"] + level + end + break + end + -- DEPRECATED, use armor_groups instead + if def.groups["armor_radiation"] and levels["radiation"] then + levels["radiation"] = def.groups["armor_radiation"] + end + end + local item = stack:get_name() + local tex = def.texture or item:gsub("%:", "_") + tex = tex:gsub(".png$", "") + local prev = def.preview or tex.."_preview" + prev = prev:gsub(".png$", "") + 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 + local mult = attr == "heal" and self.config.heal_multiplier or 1 + self.def[name][attr] = attributes[attr] * mult + end + for _, phys in pairs(self.physics) do + self.def[name][phys] = physics[phys] + end + if use_armor_monoid then + armor_monoid.monoid:add_change(player, change, "3d_armor:armor") + else + -- Preserve immortal group (damage disabled for player) + local immortal = player:get_armor_groups().immortal + if immortal and immortal ~= 0 then + groups.immortal = 1 + end + player:set_armor_groups(groups) + end + if use_player_monoids then + player_monoids.speed:add_change(player, physics.speed, + "3d_armor:physics") + player_monoids.jump:add_change(player, physics.jump, + "3d_armor:physics") + player_monoids.gravity:add_change(player, physics.gravity, + "3d_armor:physics") + elseif use_pova_mod then + -- only add the changes, not the default 1.0 for each physics setting + pova.add_override(name, "3d_armor", { + speed = physics.speed - 1, + jump = physics.jump - 1, + gravity = physics.gravity - 1, + }) + pova.do_override(player) + else + local player_physics_locked = player:get_meta():get_int("player_physics_locked") + if player_physics_locked == nil or player_physics_locked == 0 then + --player:set_physics_override(physics) + end + end + self.textures[name].armor = texture + self.textures[name].preview = preview + self.def[name].level = self.def[name].groups.fleshy or 0 + self.def[name].state = state + self.def[name].count = count + self:update_player_visuals(player) +end + +armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabilities) + local name, armor_inv = self:get_valid_player(player, "[punch]") + if not name then + return + end + local set_state + local set_count + local state = 0 + local count = 0 + local recip = true + local default_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1} + local list = armor_inv:get_list("armor") + for i, stack in pairs(list) do + if stack:get_count() == 1 then + local itemname = stack:get_name() + local use = minetest.get_item_group(itemname, "armor_use") or 0 + local damage = use > 0 + local def = stack:get_definition() or {} + if type(def.on_punched) == "function" then + damage = def.on_punched(player, hitter, time_from_last_punch, + tool_capabilities) ~= false and damage == true + end + if damage == true and tool_capabilities then + local damage_groups = def.damage_groups or default_groups + local level = damage_groups.level or 0 + local groupcaps = tool_capabilities.groupcaps or {} + local uses = 0 + damage = false + for group, caps in pairs(groupcaps) do + local maxlevel = caps.maxlevel or 0 + local diff = maxlevel - level + if diff == 0 then + diff = 1 + end + if diff > 0 and caps.times then + local group_level = damage_groups[group] + if group_level then + local time = caps.times[group_level] + if time then + local dt = time_from_last_punch or 0 + if dt > time / diff then + if caps.uses then + uses = caps.uses * math.pow(3, diff) + end + damage = true + break + end + end + end + end + end + if damage == true and recip == true and hitter and + def.reciprocate_damage == true and uses > 0 then + local item = hitter:get_wielded_item() + if item and item:get_name() ~= "" then + item:add_wear(65535 / uses) + hitter:set_wielded_item(item) + end + -- reciprocate tool damage only once + recip = false + end + end + if damage == true and hitter == "fire" then + damage = minetest.get_item_group(itemname, "flammable") > 0 + end + if damage == true then + self:damage(player, i, stack, use) + set_state = self.def[name].state + set_count = self.def[name].count + end + state = state + stack:get_wear() + count = count + 1 + end + end + if set_count and set_count ~= count then + state = set_state or state + count = set_count or count + end + self.def[name].state = state + self.def[name].count = count +end + +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_weared_armor_elements = function(self, player) + local name, inv = self:get_valid_player(player, "[get_weared_armor]") + local weared_armor = {} + if not name then + return + end + for i=1, inv:get_size("armor") do + local item_name = inv:get_stack("armor", i):get_name() + local element = self:get_element(item_name) + if element ~= nil then + weared_armor[element] = item_name + end + end + return weared_armor +end + +armor.equip = function(self, player, itemstack) + local name, armor_inv = self:get_valid_player(player, "[equip]") + local weared_armor = self:get_weared_armor_elements(player) + local armor_element = self:get_element(itemstack:get_name()) + if name and armor_element then + if weared_armor[armor_element] ~= nil then + self:unequip(player, armor_element) + end + armor_inv:add_item("armor", itemstack:take_item()) + self:set_player_armor(player) + self:save_armor_inventory(player) + end + minetest.sound_play("3d_armor_equip", {max_hear_distance = 5, pos = player:get_pos()}) + return itemstack +end + +armor.unequip = function(self, player, armor_element) + local name, armor_inv = self:get_valid_player(player, "[unequip]") + local weared_armor = self:get_weared_armor_elements(player) + if not name or not weared_armor[armor_element] then + return + end + local itemstack = armor_inv:remove_item("armor", ItemStack(weared_armor[armor_element])) + minetest.after(0, function() + local inv = player:get_inventory() + if inv:room_for_item("main", itemstack) then + inv:add_item("main", itemstack) + else + minetest.add_item(player:get_pos(), itemstack) + end + end) + self:set_player_armor(player) + self:save_armor_inventory(player) +end + +armor.remove_all = function(self, player) + local name, inv = self:get_valid_player(player, "[remove_all]") + if not name then + return + end + inv:set_list("armor", {}) + self:set_player_armor(player) + self:save_armor_inventory(player) +end + +armor.get_player_skin = function(self, name) + local player = minetest.get_player_by_name(name) + if not player then return end + local pl_texture = player:get_properties().textures[1] + + if not pl_texture or pl_texture == "blank.png" then + return skins_collectible.get_player_skin(name).texture + end + + return pl_texture +end + +armor.update_skin = function(self, name) + minetest.after(0, function() + local pplayer = minetest.get_player_by_name(name) + if pplayer then + self.textures[name].skin = self:get_player_skin(name) + self:set_player_armor(pplayer) + end + end) +end + +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.registered_groups) do + formspec = formspec:gsub("armor_group_"..group, + armor.def[name].groups[group]) + end + return formspec +end + +armor.get_element = function(self, item_name) + for _, element in pairs(armor.elements) do + if minetest.get_item_group(item_name, "armor_"..element) > 0 then + return element + end + end +end + +armor.serialize_inventory_list = function(self, list) + local list_table = {} + for _, stack in ipairs(list) do + table.insert(list_table, stack:to_string()) + end + return minetest.serialize(list_table) +end + +armor.deserialize_inventory_list = function(self, list_string) + local list_table = minetest.deserialize(list_string) + local list = {} + for _, stack in ipairs(list_table or {}) do + table.insert(list, ItemStack(stack)) + end + return list +end + +armor.load_armor_inventory = function(self, player) + local _, inv = self:get_valid_player(player, "[load_armor_inventory]") + if inv then + local meta = player:get_meta() + local armor_list_string = meta:get_string("3d_armor_inventory") + if armor_list_string then + inv:set_list("armor", + self:deserialize_inventory_list(armor_list_string)) + return true + end + end +end + +armor.save_armor_inventory = function(self, player) + local _, inv = self:get_valid_player(player, "[save_armor_inventory]") + if inv then + local meta = player:get_meta() + meta:set_string("3d_armor_inventory", + self:serialize_inventory_list(inv:get_list("armor"))) + end +end + +armor.update_inventory = function(self, player) + -- DEPRECATED: Legacy inventory support +end + +armor.set_inventory_stack = function(self, player, i, stack) + local _, inv = self:get_valid_player(player, "[set_inventory_stack]") + if inv then + inv:set_stack("armor", i, stack) + self:save_armor_inventory(player) + end +end + +armor.get_valid_player = function(self, player, msg) + msg = msg or "" + if not player then + minetest.log("warning", S("3d_armor: Player reference is nil @1", msg)) + return + end + local name = player:get_player_name() + if not name then + minetest.log("warning", S("3d_armor: Player name is nil @1", msg)) + return + end + local inv = minetest.get_inventory({type="detached", name=name.."_armor"}) + if not inv then + minetest.log("warning", S("3d_armor: Detached armor inventory is nil @1", msg)) + return + end + return name, inv +end + +armor.drop_armor = function(pos, stack) + local node = minetest.get_node_or_nil(pos) + if node then + local obj = minetest.add_item(pos, stack) + if obj then + obj:set_velocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)}) + end + end +end diff --git a/3d_armor/armor.lua b/3d_armor/armor.lua new file mode 100644 index 0000000..f791239 --- /dev/null +++ b/3d_armor/armor.lua @@ -0,0 +1,372 @@ +-- support for i18n +local S = armor.get_translator + +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}, + }) + local wood_armor_fuel = { + helmet = 6, + chestplate = 8, + leggings = 7, + boots = 5 + } + for armor, burn in pairs(wood_armor_fuel) do + minetest.register_craft({ + type = "fuel", + recipe = "3d_armor:" .. armor .. "_wood", + burntime = burn, + }) + end +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}, + }) + local cactus_armor_fuel = { + helmet = 14, + chestplate = 16, + leggings = 15, + boots = 13 + } + for armor, burn in pairs(cactus_armor_fuel) do + minetest.register_craft({ + type = "fuel", + recipe = "3d_armor:" .. armor .. "_cactus", + burntime = burn, + }) + end +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/3d_armor/crafting_guide.txt b/3d_armor/crafting_guide.txt new file mode 100644 index 0000000..abd1519 --- /dev/null +++ b/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/3d_armor/depends.txt b/3d_armor/depends.txt new file mode 100644 index 0000000..855baa9 --- /dev/null +++ b/3d_armor/depends.txt @@ -0,0 +1,7 @@ +default +player_monoids? +armor_monoid? +pova? +fire? +ethereal? +bakedclay? diff --git a/3d_armor/description.txt b/3d_armor/description.txt new file mode 100644 index 0000000..b0a9b0a --- /dev/null +++ b/3d_armor/description.txt @@ -0,0 +1 @@ +Adds craftable armor that is visible to other players. diff --git a/3d_armor/init.lua b/3d_armor/init.lua new file mode 100644 index 0000000..c356234 --- /dev/null +++ b/3d_armor/init.lua @@ -0,0 +1,491 @@ +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") + +-- local functions +local F = minetest.formspec_escape +local S = armor.get_translator + +-- integration test +if minetest.settings:get_bool("enable_3d_armor_integration_test") then + dofile(modpath.."/integration_test.lua") +end + + +-- Legacy Config Support + +local input = io.open(modpath.."/armor.conf", "r") +if input then + dofile(modpath.."/armor.conf") + input:close() +end +input = io.open(worldpath.."/armor.conf", "r") +if input then + dofile(worldpath.."/armor.conf") + input:close() +end +for name, _ in pairs(armor.config) do + local global = "ARMOR_"..name:upper() + if minetest.global_exists(global) then + armor.config[name] = _G[global] + end +end +if minetest.global_exists("ARMOR_MATERIALS") then + armor.materials = table.copy(ARMOR_MATERIALS) +end +if minetest.global_exists("ARMOR_FIRE_NODES") then + armor.fire_nodes = table.copy(ARMOR_FIRE_NODES) +end + +-- 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;"..F(S("Radiation"))..": armor_group_radiation]" + armor:register_armor_group("radiation") +end +local skin_mods = {"skins", "u_skins", "simple_skins", "wardrobe"} +for _, mod in pairs(skin_mods) do + local path = minetest.get_modpath(mod) + if path then + local dir_list = minetest.get_dir_list(path.."/textures") + for _, fn in pairs(dir_list) do + if fn:find("_preview.png$") then + armor:add_preview(fn) + end + end + armor.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;"..F(S("Level"))..": armor_level]".. + "label[5,1.5;"..F(S("Heal"))..": armor_attr_heal]" +if armor.config.fire_protect then + armor.formspec = armor.formspec.."label[5,2;"..F(S("Fire"))..": armor_attr_fire]" +end +armor:register_on_damage(function(player, index, stack) + local name = player:get_player_name() + local def = stack:get_definition() + if name and def and def.description and stack:get_wear() > 60100 then + minetest.chat_send_player(name, S("Your @1 is almost broken!", def.description)) + minetest.sound_play("default_tool_breaks", {to_player = name, gain = 2.0}) + end +end) +armor:register_on_destroy(function(player, index, stack) + local name = player:get_player_name() + local def = stack:get_definition() + if name and def and def.description then + minetest.chat_send_player(name, S("Your @1 got destroyed!", def.description)) + minetest.sound_play("default_tool_breaks", {to_player = name, gain = 2.0}) + end +end) + +local function validate_armor_inventory(player) + -- Workaround for detached inventory swap exploit + local _, inv = armor:get_valid_player(player, "[validate_armor_inventory]") + local pos = player:get_pos() + if not inv then + return + end + local armor_prev = {} + local attribute_meta = player:get_meta() -- I know, the function's name is weird but let it be like that. ;) + local armor_list_string = attribute_meta:get_string("3d_armor_inventory") + if armor_list_string then + local armor_list = armor:deserialize_inventory_list(armor_list_string) + for i, stack in ipairs(armor_list) do + if stack:get_count() > 0 then + armor_prev[stack:get_name()] = i + end + end + end + local elements = {} + local player_inv = player:get_inventory() + for i = 1, 6 do + local stack = inv:get_stack("armor", i) + if stack:get_count() > 0 then + local item = stack:get_name() + local element = armor:get_element(item) + if element and not elements[element] then + if armor_prev[item] then + armor_prev[item] = nil + else + -- Item was not in previous inventory + armor:run_callbacks("on_equip", player, i, stack) + end + elements[element] = true; + else + inv:remove_item("armor", stack) + minetest.item_drop(stack, player, pos) + -- The following code returns invalid items to the player's main + -- inventory but could open up the possibity for a hacked client + -- to receive items back they never really had. I am not certain + -- so remove the is_singleplayer check at your own risk :] + if minetest.is_singleplayer() and player_inv and + player_inv:room_for_item("main", stack) then + player_inv:add_item("main", stack) + end + end + end + end + for item, i in pairs(armor_prev) do + local stack = ItemStack(item) + -- Previous item is not in current inventory + armor:run_callbacks("on_unequip", player, i, stack) + end +end + +local function init_player_armor(initplayer) + local name = initplayer:get_player_name() + local pos = initplayer:get_pos() + if not name or not pos then + return false + end + local armor_inv = minetest.create_detached_inventory(name.."_armor", { + on_put = function(inv, listname, index, stack, player) + validate_armor_inventory(player) + armor:save_armor_inventory(player) + armor:set_player_armor(player) + end, + on_take = function(inv, listname, index, stack, player) + validate_armor_inventory(player) + armor:save_armor_inventory(player) + armor:set_player_armor(player) + end, + on_move = function(inv, from_list, from_index, to_list, to_index, count, player) + validate_armor_inventory(player) + armor:save_armor_inventory(player) + armor:set_player_armor(player) + end, + allow_put = function(inv, listname, index, put_stack, player) + if player:get_player_name() ~= name then + return 0 + end + local element = armor:get_element(put_stack:get_name()) + if not element then + return 0 + end + for i = 1, 6 do + local stack = inv:get_stack("armor", i) + local def = stack:get_definition() or {} + if def.groups and def.groups["armor_"..element] + and i ~= index then + return 0 + end + end + return 1 + end, + allow_take = function(inv, listname, index, stack, player) + if player:get_player_name() ~= name then + return 0 + end + return stack:get_count() + end, + allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) + if player:get_player_name() ~= name then + return 0 + end + return count + end, + }, name) + armor_inv:set_size("armor", 6) + if not armor:load_armor_inventory(initplayer) and armor.migrate_old_inventory then + local player_inv = initplayer:get_inventory() + player_inv:set_size("armor", 6) + for i=1, 6 do + local stack = player_inv:get_stack("armor", i) + armor_inv:set_stack("armor", i, stack) + end + armor:save_armor_inventory(initplayer) + player_inv:set_size("armor", 0) + end + for i=1, 6 do + local stack = armor_inv:get_stack("armor", i) + if stack:get_count() > 0 then + armor:run_callbacks("on_equip", initplayer, i, stack) + end + end + armor.def[name] = { + init_time = minetest.get_gametime(), + level = 0, + state = 0, + count = 0, + groups = {}, + } + for _, phys in pairs(armor.physics) do + armor.def[name][phys] = 1 + end + for _, attr in pairs(armor.attributes) do + armor.def[name][attr] = 0 + end + for group, _ in pairs(armor.registered_groups) do + armor.def[name].groups[group] = 0 + end + local skin = armor:get_player_skin(name) + armor.textures[name] = { + skin = skin, + armor = "3d_armor_trans.png", + wielditem = "3d_armor_trans.png", + preview = armor.default_skin.."_preview.png", + } + local texture_path = minetest.get_modpath("player_textures") + if texture_path then + local dir_list = minetest.get_dir_list(texture_path.."/textures") + for _, fn in pairs(dir_list) do + if fn == "player_"..name..".png" then + armor.textures[name].skin = fn + break + end + end + end + armor:set_player_armor(initplayer) + return true +end + +-- Armor Player Model + +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 + local player_name = player:get_player_name() + for field, _ in pairs(fields) do + if string.find(field, "skins_set") then + armor:update_skin(player_name) + end + end +end) + +minetest.register_on_joinplayer(function(player) + default.player_set_model(player, "3d_armor_character.b3d") + local player_name = player:get_player_name() + + minetest.after(0, function() + local pplayer = minetest.get_player_by_name(player_name) + if pplayer and init_player_armor(pplayer) == false then + pending_players[pplayer] = 0 + end + end) +end) + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + if name then + armor.def[name] = nil + armor.textures[name] = nil + end + pending_players[player] = nil +end) + +if armor.config.drop == true or armor.config.destroy == true then + minetest.register_on_dieplayer(function(player) + local name, armor_inv = armor:get_valid_player(player, "[on_dieplayer]") + if not name then + return + end + local drop = {} + for i=1, armor_inv:get_size("armor") do + local stack = armor_inv:get_stack("armor", i) + if stack:get_count() > 0 then + table.insert(drop, stack) + armor:run_callbacks("on_unequip", player, i, stack) + armor_inv:set_stack("armor", i, nil) + end + end + armor:save_armor_inventory(player) + armor:set_player_armor(player) + local pos = player:get_pos() + if pos and armor.config.destroy == false then + minetest.after(armor.config.bones_delay, function() + local meta = nil + local maxp = vector.add(pos, 16) + local minp = vector.subtract(pos, 16) + local bones = minetest.find_nodes_in_area(minp, maxp, {"bones:bones"}) + for _, p in pairs(bones) do + local m = minetest.get_meta(p) + if m:get_string("owner") == name then + meta = m + break + end + end + if meta then + local inv = meta:get_inventory() + for _,stack in ipairs(drop) do + if inv:room_for_item("main", stack) then + inv:add_item("main", stack) + else + armor.drop_armor(pos, stack) + end + end + else + for _,stack in ipairs(drop) do + armor.drop_armor(pos, stack) + end + end + end) + end + end) +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, reason) + if player and reason.type ~= "drown" and reason.hunger == nil + and hp_change < 0 then + local name = player:get_player_name() + if name then + local heal = armor.def[name].heal + if heal >= math.random(100) then + hp_change = 0 + end + -- check if armor damage was handled by fire or on_punchplayer + local time = last_punch_time[name] or 0 + if time == 0 or time + 1 < minetest.get_gametime() then + armor:punch(player) + end + end + 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", S("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 breathing, 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 (S("[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:get_pos() + 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/3d_armor/integration_test.lua b/3d_armor/integration_test.lua new file mode 100644 index 0000000..65e9dfd --- /dev/null +++ b/3d_armor/integration_test.lua @@ -0,0 +1,25 @@ + +minetest.log("warning", "[TEST] integration-test enabled!") + +minetest.register_on_mods_loaded(function() + minetest.after(1, function() + + local data = minetest.write_json({ success = true }, true); + local file = io.open(minetest.get_worldpath().."/integration_test.json", "w" ); + if file then + file:write(data) + file:close() + end + + file = io.open(minetest.get_worldpath().."/registered_nodes.txt", "w" ); + if file then + for name in pairs(minetest.registered_nodes) do + file:write(name .. '\n') + end + file:close() + end + + minetest.log("warning", "[TEST] integration tests done!") + minetest.request_shutdown("success") + end) +end) diff --git a/3d_armor/locale/3d_armor.es.tr b/3d_armor/locale/3d_armor.es.tr new file mode 100644 index 0000000..ab46c03 --- /dev/null +++ b/3d_armor/locale/3d_armor.es.tr @@ -0,0 +1,107 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: La armadura desconectada es nula @1 +3d_armor: Player name is nil @1=3d_armor: El nombre del jugador es nulo @1 +3d_armor: Player reference is nil @1=3d_armor: La referencia del jugador es nula @1 + +### armor.lua ### + +Admin Boots=Botas de admin +Admin Chestplate=Peto de admin +Admin Helmet=Casco de admin +Admin Leggings=Polainas de admin +Bronze Boots=Botas de bronce +Bronze Chestplate=Peto de bronce +Bronze Helmet=Casco de bronce +Bronze Leggings=Polainas de bronce +Cactus Boots=Botas de cactus +Cactus Chestplate=Peto de cactus +Cactus Helmet=Casco de cactus +Cactus Leggings=Polainas de cactus +Crystal Boots=Botas de cristal +Crystal Chestplate=Peto de cristal +Crystal Helmet=Casco de cristal +Crystal Leggings=Polainas de cristal +Diamond Boots=Botas de diamante +Diamond Chestplate=Peto de diamante +Diamond Helmet=Casco de diamante +Diamond Leggings=Polainas de diamante +Gold Boots=Botas de oro +Gold Chestplate=Peto de oro +Gold Helmet=Casco de oro +Gold Leggings=Polainas de oro +Mithril Boots=Botas de mitrilo +Mithril Chestplate=Peto de mitrilo +Mithril Helmet=Casco de mitrilo +Mithril Leggings=Polainas de mitrilo +Steel Boots=Botas de acero +Steel Chestplate=Peto de acero +Steel Helmet=Casco de acero +Steel Leggings=Polainas de acero +Wood Boots=Botas de madera +Wood Chestplate=Peto de madera +Wood Helmet=Casco de madera +Wood Leggings=Polainas de madera + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Fallo en la inicialización del jugador +Fire=Fuego +Heal=Salud +Level=Nivel +Radiation=Radiación +Your @1 got destroyed!=¡Tu @1 fue destruído! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] Nodos de fuego desabilitados + + +##### not used anymore ##### + +3d_armor: Player inventory is nil @1=3d_armor: El inventario del jugador es nulo @1 +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod cargado, pero sin ser usado. +Back=Volver +Armor=Armadura +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod cargado, pero sin ser usado. +Armor stand top=Parte arriba maniquí armadura +Armor stand=Maniquí para armadura +Armor Stand=Maniquí para armadura +Locked Armor stand=Maniquí para armadura (bloqueado) +Armor Stand (owned by @1)=Maniquí para armadura (propiedad de @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod cargado, pero sin ser usado. +3d Armor=Armadura 3d +Armor not initialized!=¡Armadura no inicializada! +hazmat_suit: Mod loaded but unused.=hazmat_suit: Mod cargado, pero sin ser usado. +Hazmat Helmet=Casco de hazmat +Hazmat Chestplate=Peto de hazmat +Hazmat Sleeve=Manga de hazmat +Hazmat Leggins=Polainas de hazmat +Hazmat Boots=Botas de hazmat +Hazmat Suit=Traje de hazmat +Admin Shield=Escudo de admin +Wooden Shield=Escudo de madera +Enhanced Wood Shield=Escudo de madera mejorado +Cactus Shield=Escudo de cactus +Enhanced Cactus Shield=Escudo de cactus mejorado +Steel Shield=Escudo de acero +Bronze Shield=Escudo de bronce +Diamond Shield=Escudo de diamante +Gold Shield=Escudo de oro +Mithril Shield=Escudo de mitrilo +Crystal Shield=Escudo de cristal +technic_armor: Mod loaded but unused.=technic_armor: Mod cargado, pero no usado. +Lead=Plomo +Brass=Latón +Cast Iron=Hierro fundido +Carbon Steel=Acero carbono +Stainless Steel=Acero inoxidable +Tin=Estaño +Silver=Plata +Helmet=Casco +Chestplate=Peto +Leggins=Polainas +Boots=Botas +Shield=Escudo +@1 @2=@2 de @1 diff --git a/3d_armor/locale/3d_armor.fr.tr b/3d_armor/locale/3d_armor.fr.tr new file mode 100644 index 0000000..849a0f1 --- /dev/null +++ b/3d_armor/locale/3d_armor.fr.tr @@ -0,0 +1,58 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor : Inventaire détaché pour l'armure non trouvé @1 +3d_armor: Player name is nil @1=3d_armor : Nom du joueur non trouvé @1 +3d_armor: Player reference is nil @1=3d_armor : Référence au joueur non trouvée @1 + +### armor.lua ### + +Admin Boots=Bottes d'admin +Admin Chestplate=Cuirasse d'admin +Admin Helmet=Casque d'admin +Admin Leggings=Jambières d'admin +Bronze Boots=Bottes en bronze +Bronze Chestplate=Cuirasse en bronze +Bronze Helmet=Casque en bronze +Bronze Leggings=Jambières en bronze +Cactus Boots=Bottes en cactus +Cactus Chestplate=Cuirasse en cactus +Cactus Helmet=Casque en cactus +Cactus Leggings=Jambières en cactus +Crystal Boots=Bottes en cristal +Crystal Chestplate=Cuirasse en cristal +Crystal Helmet=Casque en cristal +Crystal Leggings=Jambières en cristal +Diamond Boots=Bottes en diamant +Diamond Chestplate=Cuirasse en diamant +Diamond Helmet=Casque en diamant +Diamond Leggings=Jambières en diamant +Gold Boots=Bottes en or +Gold Chestplate=Cuirasse en or +Gold Helmet=Casque en or +Gold Leggings=Jambières en or +Mithril Boots=Bottes en mithril +Mithril Chestplate=Cuirasse en mithril +Mithril Helmet=Casque en mithril +Mithril Leggings=Jambières en mithril +Steel Boots=Bottes en acier +Steel Chestplate=Cuirasse en acier +Steel Helmet=Casque en acier +Steel Leggings=Jambières en acier +Wood Boots=Bottes en bois +Wood Chestplate=Cuirasse en bois +Wood Helmet=Casque en bois +Wood Leggings=Jambières en bois + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor : Impossible d'initialiser le joueur +Fire=Fire +Heal=Soins +Level=Niveau +Radiation=Radiation +Your @1 got destroyed!=Une partie de votre armure a été détruite : @1 ! +Your @1 is almost broken!=Une partie de votre armure est presque détruite : @1 ! +[3d_armor] Fire Nodes disabled=[3d_armor] Nœuds de type feu désactivés diff --git a/3d_armor/locale/3d_armor.it.tr b/3d_armor/locale/3d_armor.it.tr new file mode 100644 index 0000000..d8be62e --- /dev/null +++ b/3d_armor/locale/3d_armor.it.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: L'inventario separato dell'armatura è nullo @1 +3d_armor: Player name is nil @1=3d_armor: Il nome dell'utente è nullo @1 +3d_armor: Player reference is nil @1=3d_armor: Il riferimento all'utente è nullo @1 + +### armor.lua ### + +Admin Boots=Stivali dell'amministratrice/tore +Admin Chestplate=Corazza dell'amministratrice/tore +Admin Helmet=Elmo dell'amministratrice/tore +Admin Leggings=Gambali dell'amministratrice/tore +Bronze Boots=Stivali di bronzo +Bronze Chestplate=Corazza di bronzo +Bronze Helmet=Elmo di bronzo +Bronze Leggings=Gambali di bronzo +Cactus Boots=Stivali di cactus +Cactus Chestplate=Corazza di cactus +Cactus Helmet=Elmo di cactus +Cactus Leggings=Gambali di cactus +Crystal Boots=Stivali di cristallo +Crystal Chestplate=Corazza di cristallo +Crystal Helmet=Elmo di cristallo +Crystal Leggings=Gambali di cristallo +Diamond Boots=Stivali di diamante +Diamond Chestplate=Corazza di diamante +Diamond Helmet=Elmo di diamante +Diamond Leggings=Gambali di diamante +Gold Boots=Stivali d'oro +Gold Chestplate=Corazza d'oro +Gold Helmet=Elmo d'oro +Gold Leggings=Gambali d'oro +Mithril Boots=Stivali di mithril +Mithril Chestplate=Corazza di mithril +Mithril Helmet=Elmo di mithril +Mithril Leggings=Gambali di mithril +Steel Boots=Stivali d'acciaio +Steel Chestplate=Corazza d'acciaio +Steel Helmet=Elmo d'acciaio +Steel Leggings=Gambali d'acciaio +Wood Boots=Stivali di legno +Wood Chestplate=Corazza di legno +Wood Helmet=Elmo di legno +Wood Leggings=Gambali di legno + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Inizializzazione dell'utente fallita +Fire=Fuoco +Heal=Guarigione +Level=Livello +Radiation=Radiazione +Your @1 got destroyed!=@1 in frantumi! +Your @1 is almost broken!=@1 quasi in frantumi! +[3d_armor] Fire Nodes disabled=[3d_armor] Nodi fuoco disabilitati + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod caricata ma inutilizzata. +Back=Indietro +Armor=Armatura +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod caricata ma inutilizzata. +Armor stand top=Parte superiore del supporto per armatura +Armor stand=Supporto per armatura +Armor Stand=Supporto per armatura +Locked Armor stand=Supporto per armatura chiuso a chiave +Armor Stand (owned by @1)=Supporto per armatura (di proprietà di @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod caricata ma inutilizzata. +3d Armor=Armatura 3D +Armor not initialized!=Armatura non inizializzata! +Admin Shield=Scudo dell'amministratrice/tore +Wooden Shield=Scudo di legno +Enhanced Wood Shield=Scudo di legno migliorato +Cactus Shield=Scudo di cactus +Enhanced Cactus Shield=Scudo di cactus migliorato +Steel Shield=Scudo d'acciaio +Bronze Shield=Scudo di bronzo +Diamond Shield=Scudo di diamante +Gold Shield=Scudo d'oro +Mithril Shield=Scudo di mithril +Crystal Shield=Scudo di cristallo diff --git a/3d_armor/locale/3d_armor.ms.tr b/3d_armor/locale/3d_armor.ms.tr new file mode 100644 index 0000000..b76dd61 --- /dev/null +++ b/3d_armor/locale/3d_armor.ms.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: Inventori perisai terpisah tiada nilai @1 +3d_armor: Player name is nil @1=3d_armor: Nama pemain tiada nilai @1 +3d_armor: Player reference is nil @1=3d_armor: Rujukan pemain tiada nilai @1 + +### armor.lua ### + +Admin Boots=But Pentadbir +Admin Chestplate=Perisai Dada Pentadbir +Admin Helmet=Helmet Pentadbir +Admin Leggings=Perisai Kaki Pentadbir +Bronze Boots=But Gangsa +Bronze Chestplate=Perisai Dada Gangsa +Bronze Helmet=Helmet Gangsa +Bronze Leggings=Perisai Kaki Gangsa +Cactus Boots=But Kaktus +Cactus Chestplate=Perisai Dada Kaktus +Cactus Helmet=Helmet Kaktus +Cactus Leggings=Perisai Kaki Kaktus +Crystal Boots=But Kristal +Crystal Chestplate=Perisai Dada Kristal +Crystal Helmet=Helmet Kristal +Crystal Leggings=Perisai Kaki Kristal +Diamond Boots=But Intan +Diamond Chestplate=Perisai Dada Intan +Diamond Helmet=Helmet Intan +Diamond Leggings=Perisai Kaki Intan +Gold Boots=But Emas +Gold Chestplate=Perisai Dada Emas +Gold Helmet=Helmet Emas +Gold Leggings=Perisai Kaki Emas +Mithril Boots=But Mithril +Mithril Chestplate=Perisai Dada Mithril +Mithril Helmet=Helmet Mithril +Mithril Leggings=Perisai Kaki Mithril +Steel Boots=But Keluli +Steel Chestplate=Perisai Dada Keluli +Steel Helmet=Helmet Keluli +Steel Leggings=Perisai Kaki Keluli +Wood Boots=But Kayu +Wood Chestplate=Perisai Dada Kayu +Wood Helmet=Helmet Kayu +Wood Leggings=Perisai Kaki Kayu + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Gagal mengasalkan pemain +Fire=Api +Heal=Pulih +Level=Tahap +Radiation=Radiasi +Your @1 got destroyed!=@1 anda telah musnah! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] Nod-nod Api dilumpuhkan + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mods dimuatkan tetapi tidak digunakan. +Back=Kembali +Armor=Perisai +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mods dimuatkan tetapi tidak digunakan. +Armor stand top=Bhg atas dirian perisai +Armor stand=Dirian perisai +Armor Stand=Dirian Perisai +Locked Armor stand=Dirian perisai Berkunci +Armor Stand (owned by @1)=Dirian Perisai (milik @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mods dimuatkan tetapi tidak digunakan. +3d Armor=Perisai 3d +Armor not initialized!=Perisai tidak diasalkan! +Admin Shield=Perisai Pegang Pentadbir +Wooden Shield=Perisai Pegang Kayu +Enhanced Wood Shield=Perisai Pegang Kayu Kukuh +Cactus Shield=Perisai Pegang Kaktus +Enhanced Cactus Shield=Perisai Pegang Kaktus Kukuh +Steel Shield=Perisai Pegang Keluli +Bronze Shield=Perisai Pegang Gangsa +Diamond Shield=Perisai Pegang Intan +Gold Shield=Perisai Pegang Emas +Mithril Shield=Perisai Pegang Mithril +Crystal Shield=Perisai Pegang Kristal diff --git a/3d_armor/locale/3d_armor.pt.tr b/3d_armor/locale/3d_armor.pt.tr new file mode 100644 index 0000000..8fc689d --- /dev/null +++ b/3d_armor/locale/3d_armor.pt.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: Inventario avulso de armadura é nulo @1 +3d_armor: Player name is nil @1=3d_armor: Nome de jogador é nulo @1 +3d_armor: Player reference is nil @1=3d_armor: Referência Jogador é nula @1 + +### armor.lua ### + +Admin Boots=Botas de Administrador +Admin Chestplate=Peitoral de Administrador +Admin Helmet=Capacete de Administrador +Admin Leggings=Calças de Administrador +Bronze Boots=Botas de Bronze +Bronze Chestplate=Peitoral de Bronze +Bronze Helmet=Capacete de Bronze +Bronze Leggings=Calças de Bronze +Cactus Boots=Botas de Madeira +Cactus Chestplate=Peitoral de Cacto +Cactus Helmet=Capacete de Cacto +Cactus Leggings=Calças de Cacto +Crystal Boots=Botas de Cristal +Crystal Chestplate=Peitoral de Cristal +Crystal Helmet=Capacete de Cristal +Crystal Leggings=Calças de Cristal +Diamond Boots=Botas de Diamante +Diamond Chestplate=Peitoral de Diamante +Diamond Helmet=Capacete de Diamante +Diamond Leggings=Calças de Diamante +Gold Boots=Botas de Ouro +Gold Chestplate=Peitoral de Ouro +Gold Helmet=Capacete de Ouro +Gold Leggings=Calças de Ouro +Mithril Boots=Botas de Mithril +Mithril Chestplate=Peitoral de Mithril +Mithril Helmet=Capacete de Mithril +Mithril Leggings=Calças de Mithril +Steel Boots=Botas de Aço +Steel Chestplate=Peitoral de Aço +Steel Helmet=Capacete de Aço +Steel Leggings=Calças de Aço +Wood Boots=Botas de Madeira +Wood Chestplate=Peitoral de Madeira +Wood Helmet=Capacete de Madeira +Wood Leggings=Calças de Madeira + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Falha ao inicializar jogador +Fire=Fogo +Heal=Saúde +Level=Nível +Radiation=Radiação +Your @1 got destroyed!=@1 foi destruído(a)! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] Nodes de gofo desabilitados + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod carregado mas inoperante. +Back=Voltar +Armor=Armadura +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod carregado mas inoperante. +Armor stand top=Topo de estande de armadura +Armor stand=Estande de armadura +Armor Stand=Estande de Armadura +Locked Armor stand=Estande de Armadura Trancada +Armor Stand (owned by @1)=Estande de Armadura (pertente a @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod carregado mas inoperante. +3d Armor=3d Armor +Armor not initialized!=Armadura não inicializada! +Admin Shield=Escudo de Administrador +Wooden Shield=Escudo de Madeira +Enhanced Wood Shield=Escudo de Madeira Melhorado +Cactus Shield=Escudo de Cacto +Enhanced Cactus Shield=Escudo de Cacto Melhorado +Steel Shield=Escudo de Aço +Bronze Shield=Escudo de Bronze +Diamond Shield=Escudo de Diamante +Gold Shield=Escudo de Ouro +Mithril Shield=Escudo de Mithril +Crystal Shield=Escudo de Cristal diff --git a/3d_armor/locale/3d_armor.pt_BR.tr b/3d_armor/locale/3d_armor.pt_BR.tr new file mode 100644 index 0000000..8fc689d --- /dev/null +++ b/3d_armor/locale/3d_armor.pt_BR.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: Inventario avulso de armadura é nulo @1 +3d_armor: Player name is nil @1=3d_armor: Nome de jogador é nulo @1 +3d_armor: Player reference is nil @1=3d_armor: Referência Jogador é nula @1 + +### armor.lua ### + +Admin Boots=Botas de Administrador +Admin Chestplate=Peitoral de Administrador +Admin Helmet=Capacete de Administrador +Admin Leggings=Calças de Administrador +Bronze Boots=Botas de Bronze +Bronze Chestplate=Peitoral de Bronze +Bronze Helmet=Capacete de Bronze +Bronze Leggings=Calças de Bronze +Cactus Boots=Botas de Madeira +Cactus Chestplate=Peitoral de Cacto +Cactus Helmet=Capacete de Cacto +Cactus Leggings=Calças de Cacto +Crystal Boots=Botas de Cristal +Crystal Chestplate=Peitoral de Cristal +Crystal Helmet=Capacete de Cristal +Crystal Leggings=Calças de Cristal +Diamond Boots=Botas de Diamante +Diamond Chestplate=Peitoral de Diamante +Diamond Helmet=Capacete de Diamante +Diamond Leggings=Calças de Diamante +Gold Boots=Botas de Ouro +Gold Chestplate=Peitoral de Ouro +Gold Helmet=Capacete de Ouro +Gold Leggings=Calças de Ouro +Mithril Boots=Botas de Mithril +Mithril Chestplate=Peitoral de Mithril +Mithril Helmet=Capacete de Mithril +Mithril Leggings=Calças de Mithril +Steel Boots=Botas de Aço +Steel Chestplate=Peitoral de Aço +Steel Helmet=Capacete de Aço +Steel Leggings=Calças de Aço +Wood Boots=Botas de Madeira +Wood Chestplate=Peitoral de Madeira +Wood Helmet=Capacete de Madeira +Wood Leggings=Calças de Madeira + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: Falha ao inicializar jogador +Fire=Fogo +Heal=Saúde +Level=Nível +Radiation=Radiação +Your @1 got destroyed!=@1 foi destruído(a)! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] Nodes de gofo desabilitados + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod carregado mas inoperante. +Back=Voltar +Armor=Armadura +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod carregado mas inoperante. +Armor stand top=Topo de estande de armadura +Armor stand=Estande de armadura +Armor Stand=Estande de Armadura +Locked Armor stand=Estande de Armadura Trancada +Armor Stand (owned by @1)=Estande de Armadura (pertente a @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod carregado mas inoperante. +3d Armor=3d Armor +Armor not initialized!=Armadura não inicializada! +Admin Shield=Escudo de Administrador +Wooden Shield=Escudo de Madeira +Enhanced Wood Shield=Escudo de Madeira Melhorado +Cactus Shield=Escudo de Cacto +Enhanced Cactus Shield=Escudo de Cacto Melhorado +Steel Shield=Escudo de Aço +Bronze Shield=Escudo de Bronze +Diamond Shield=Escudo de Diamante +Gold Shield=Escudo de Ouro +Mithril Shield=Escudo de Mithril +Crystal Shield=Escudo de Cristal diff --git a/3d_armor/locale/3d_armor.ru.tr b/3d_armor/locale/3d_armor.ru.tr new file mode 100644 index 0000000..b817c79 --- /dev/null +++ b/3d_armor/locale/3d_armor.ru.tr @@ -0,0 +1,85 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1=3d_armor: Отдельный инвентарь брони является nil @1 +3d_armor: Player name is nil @1=3d_armor: Имя игрока является nil @1 +3d_armor: Player reference is nil @1=3d_armor: Ссылка игрока является nil @1 + +### armor.lua ### + +Admin Boots=ботинки админа +Admin Chestplate=бронежилет админа +Admin Helmet=шлем админа +Admin Leggings=гамаши админа +Bronze Boots=бронзовые ботинки +Bronze Chestplate=бронзовый бронежилет +Bronze Helmet=бронзовый шлем +Bronze Leggings=бронзовые гамаши +Cactus Boots=кактусовые ботинки +Cactus Chestplate=кактусовый бронежилет +Cactus Helmet=кактусовый шлем +Cactus Leggings=кактусовые гамаши +Crystal Boots=кристалловые ботинки +Crystal Chestplate=кристалловый бронежилет +Crystal Helmet=кристалловый шлем +Crystal Leggings=кристалловые гамаши +Diamond Boots=алмазные ботинки +Diamond Chestplate=алмазный бронежилет +Diamond Helmet=алмазный шлем +Diamond Leggings=алмазные гамаши +Gold Boots=золотые ботинки +Gold Chestplate=золотой бронежилет +Gold Helmet=золотой шлем +Gold Leggings=золотые гамаши +Mithril Boots=мифриловые ботинки +Mithril Chestplate=мифриловый бронежилет +Mithril Helmet=мифриловый шлем +Mithril Leggings=мифриловые гамаши +Steel Boots=стальные ботинки +Steel Chestplate=стальной бронежилет +Steel Helmet=стальной шлем +Steel Leggings=стальные гамаши +Wood Boots=деревянные ботинки +Wood Chestplate=деревянный бронежилет +Wood Helmet=деревянный шлем +Wood Leggings=деревянные гамаши + +### init.lua ### + +3d_armor: Failed to initialize player=3d_armor: не смог подготовить игрока +Fire=огонь +Heal=исцеление +Level=уровень +Radiation=излучение +Your @1 got destroyed!=твой(и) @1 был(и) разрушен(ы)! +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled=[3d_armor] блоки огня отключены + + +##### not used anymore ##### + +3d_armor_ip: Mod loaded but unused.=3d_armor_ip: мод загружен но не используется. +Back=назад +Armor=бронь +3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: мод загружен но не используется. +Armor stand top=стойка для брони (верх) +Armor stand=стойка для брони +Armor Stand=стойка для брони +Locked Armor stand=защищенная стойка для брони +Armor Stand (owned by @1)=стойка для брони (принадлежит @1) +3d_armor_ui: Mod loaded but unused.=3d_armor_ui: мод загружен но не используется. +3d Armor=3D бронь +Armor not initialized!=бронь не подготовлена! +Admin Shield=щит админа +Wooden Shield=деревянный щит +Enhanced Wood Shield=улучшенный деревянный щит +Cactus Shield=кактусный щит +Enhanced Cactus Shield=улучшенный кактусный щит +Steel Shield=стальной щит +Bronze Shield=бронзовый щит +Diamond Shield=алмазный щит +Gold Shield=золотой щит +Mithril Shield=мифриловый щит +Crystal Shield=кристалловый щит diff --git a/3d_armor/locale/template.txt b/3d_armor/locale/template.txt new file mode 100644 index 0000000..cedd538 --- /dev/null +++ b/3d_armor/locale/template.txt @@ -0,0 +1,58 @@ +# textdomain: 3d_armor + + +### api.lua ### + +3d_armor: Detached armor inventory is nil @1= +3d_armor: Player name is nil @1= +3d_armor: Player reference is nil @1= + +### armor.lua ### + +Admin Boots= +Admin Chestplate= +Admin Helmet= +Admin Leggings= +Bronze Boots= +Bronze Chestplate= +Bronze Helmet= +Bronze Leggings= +Cactus Boots= +Cactus Chestplate= +Cactus Helmet= +Cactus Leggings= +Crystal Boots= +Crystal Chestplate= +Crystal Helmet= +Crystal Leggings= +Diamond Boots= +Diamond Chestplate= +Diamond Helmet= +Diamond Leggings= +Gold Boots= +Gold Chestplate= +Gold Helmet= +Gold Leggings= +Mithril Boots= +Mithril Chestplate= +Mithril Helmet= +Mithril Leggings= +Steel Boots= +Steel Chestplate= +Steel Helmet= +Steel Leggings= +Wood Boots= +Wood Chestplate= +Wood Helmet= +Wood Leggings= + +### init.lua ### + +3d_armor: Failed to initialize player= +Fire= +Heal= +Level= +Radiation= +Your @1 got destroyed!= +Your @1 is almost broken!= +[3d_armor] Fire Nodes disabled= diff --git a/3d_armor/mod.conf b/3d_armor/mod.conf new file mode 100644 index 0000000..311adb5 --- /dev/null +++ b/3d_armor/mod.conf @@ -0,0 +1,4 @@ +name = 3d_armor +depends = default +optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay +description = Adds craftable armor that is visible to other players. diff --git a/3d_armor/models/3d_armor_character.b3d b/3d_armor/models/3d_armor_character.b3d new file mode 100644 index 0000000..c4d45b5 Binary files /dev/null and b/3d_armor/models/3d_armor_character.b3d differ diff --git a/3d_armor/models/3d_armor_character.blend b/3d_armor/models/3d_armor_character.blend new file mode 100644 index 0000000..44f7e27 Binary files /dev/null and b/3d_armor/models/3d_armor_character.blend differ diff --git a/3d_armor/sounds/3d_armor_equip.ogg b/3d_armor/sounds/3d_armor_equip.ogg new file mode 100644 index 0000000..f307792 Binary files /dev/null and b/3d_armor/sounds/3d_armor_equip.ogg differ diff --git a/3d_armor/textures/3d_armor_boots_admin.png b/3d_armor/textures/3d_armor_boots_admin.png new file mode 100644 index 0000000..833f6b7 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_admin.png differ diff --git a/3d_armor/textures/3d_armor_boots_admin_preview.png b/3d_armor/textures/3d_armor_boots_admin_preview.png new file mode 100644 index 0000000..2487a7e Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_admin_preview.png differ diff --git a/3d_armor/textures/3d_armor_boots_bronze.png b/3d_armor/textures/3d_armor_boots_bronze.png new file mode 100644 index 0000000..2b187e5 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_bronze.png differ diff --git a/3d_armor/textures/3d_armor_boots_bronze_preview.png b/3d_armor/textures/3d_armor_boots_bronze_preview.png new file mode 100644 index 0000000..78badbb Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_bronze_preview.png differ diff --git a/3d_armor/textures/3d_armor_boots_cactus.png b/3d_armor/textures/3d_armor_boots_cactus.png new file mode 100644 index 0000000..350b065 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_cactus.png differ diff --git a/3d_armor/textures/3d_armor_boots_cactus_preview.png b/3d_armor/textures/3d_armor_boots_cactus_preview.png new file mode 100644 index 0000000..08e76c6 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_cactus_preview.png differ diff --git a/3d_armor/textures/3d_armor_boots_crystal.png b/3d_armor/textures/3d_armor_boots_crystal.png new file mode 100644 index 0000000..31c06b5 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_crystal.png differ diff --git a/3d_armor/textures/3d_armor_boots_crystal_preview.png b/3d_armor/textures/3d_armor_boots_crystal_preview.png new file mode 100644 index 0000000..01a6bfa Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_crystal_preview.png differ diff --git a/3d_armor/textures/3d_armor_boots_diamond.png b/3d_armor/textures/3d_armor_boots_diamond.png new file mode 100644 index 0000000..1870359 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_diamond.png differ diff --git a/3d_armor/textures/3d_armor_boots_diamond_preview.png b/3d_armor/textures/3d_armor_boots_diamond_preview.png new file mode 100644 index 0000000..2e4f5d3 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_diamond_preview.png differ diff --git a/3d_armor/textures/3d_armor_boots_gold.png b/3d_armor/textures/3d_armor_boots_gold.png new file mode 100644 index 0000000..cd339b6 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_gold.png differ diff --git a/3d_armor/textures/3d_armor_boots_gold_preview.png b/3d_armor/textures/3d_armor_boots_gold_preview.png new file mode 100644 index 0000000..f70f30f Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_gold_preview.png differ diff --git a/3d_armor/textures/3d_armor_boots_mithril.png b/3d_armor/textures/3d_armor_boots_mithril.png new file mode 100644 index 0000000..af7b943 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_mithril.png differ diff --git a/3d_armor/textures/3d_armor_boots_mithril_preview.png b/3d_armor/textures/3d_armor_boots_mithril_preview.png new file mode 100644 index 0000000..1ebf92a Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_mithril_preview.png differ diff --git a/3d_armor/textures/3d_armor_boots_steel.png b/3d_armor/textures/3d_armor_boots_steel.png new file mode 100644 index 0000000..ff8e8f8 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_steel.png differ diff --git a/3d_armor/textures/3d_armor_boots_steel_preview.png b/3d_armor/textures/3d_armor_boots_steel_preview.png new file mode 100644 index 0000000..968ffc5 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_steel_preview.png differ diff --git a/3d_armor/textures/3d_armor_boots_wood.png b/3d_armor/textures/3d_armor_boots_wood.png new file mode 100644 index 0000000..e62bdc5 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_wood.png differ diff --git a/3d_armor/textures/3d_armor_boots_wood_preview.png b/3d_armor/textures/3d_armor_boots_wood_preview.png new file mode 100644 index 0000000..de841b0 Binary files /dev/null and b/3d_armor/textures/3d_armor_boots_wood_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_admin.png b/3d_armor/textures/3d_armor_chestplate_admin.png new file mode 100644 index 0000000..d8df83d Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_admin.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_admin_preview.png b/3d_armor/textures/3d_armor_chestplate_admin_preview.png new file mode 100644 index 0000000..1bb10fd Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_admin_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_bronze.png b/3d_armor/textures/3d_armor_chestplate_bronze.png new file mode 100644 index 0000000..b8e6d85 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_bronze.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_bronze_preview.png b/3d_armor/textures/3d_armor_chestplate_bronze_preview.png new file mode 100644 index 0000000..8c78716 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_bronze_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_cactus.png b/3d_armor/textures/3d_armor_chestplate_cactus.png new file mode 100644 index 0000000..afcd557 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_cactus.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_cactus_preview.png b/3d_armor/textures/3d_armor_chestplate_cactus_preview.png new file mode 100644 index 0000000..b166c7c Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_cactus_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_crystal.png b/3d_armor/textures/3d_armor_chestplate_crystal.png new file mode 100644 index 0000000..4a268f4 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_crystal.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_crystal_preview.png b/3d_armor/textures/3d_armor_chestplate_crystal_preview.png new file mode 100644 index 0000000..63304f6 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_crystal_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_diamond.png b/3d_armor/textures/3d_armor_chestplate_diamond.png new file mode 100644 index 0000000..f61e28f Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_diamond.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_diamond_preview.png b/3d_armor/textures/3d_armor_chestplate_diamond_preview.png new file mode 100644 index 0000000..9ec9971 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_diamond_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_gold.png b/3d_armor/textures/3d_armor_chestplate_gold.png new file mode 100644 index 0000000..4c67491 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_gold.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_gold_preview.png b/3d_armor/textures/3d_armor_chestplate_gold_preview.png new file mode 100644 index 0000000..01d8d5c Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_gold_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_mithril.png b/3d_armor/textures/3d_armor_chestplate_mithril.png new file mode 100644 index 0000000..aa06d18 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_mithril.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_mithril_preview.png b/3d_armor/textures/3d_armor_chestplate_mithril_preview.png new file mode 100644 index 0000000..2754290 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_mithril_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_steel.png b/3d_armor/textures/3d_armor_chestplate_steel.png new file mode 100644 index 0000000..cc6d570 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_steel.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_steel_preview.png b/3d_armor/textures/3d_armor_chestplate_steel_preview.png new file mode 100644 index 0000000..162ce4b Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_steel_preview.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_wood.png b/3d_armor/textures/3d_armor_chestplate_wood.png new file mode 100644 index 0000000..2db95ce Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_wood.png differ diff --git a/3d_armor/textures/3d_armor_chestplate_wood_preview.png b/3d_armor/textures/3d_armor_chestplate_wood_preview.png new file mode 100644 index 0000000..a1431e3 Binary files /dev/null and b/3d_armor/textures/3d_armor_chestplate_wood_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_admin.png b/3d_armor/textures/3d_armor_helmet_admin.png new file mode 100644 index 0000000..862956a Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_admin.png differ diff --git a/3d_armor/textures/3d_armor_helmet_admin_preview.png b/3d_armor/textures/3d_armor_helmet_admin_preview.png new file mode 100644 index 0000000..0f344d0 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_admin_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_bronze.png b/3d_armor/textures/3d_armor_helmet_bronze.png new file mode 100644 index 0000000..17b87c9 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_bronze.png differ diff --git a/3d_armor/textures/3d_armor_helmet_bronze_preview.png b/3d_armor/textures/3d_armor_helmet_bronze_preview.png new file mode 100644 index 0000000..c711745 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_bronze_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_cactus.png b/3d_armor/textures/3d_armor_helmet_cactus.png new file mode 100644 index 0000000..f616e1e Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_cactus.png differ diff --git a/3d_armor/textures/3d_armor_helmet_cactus_preview.png b/3d_armor/textures/3d_armor_helmet_cactus_preview.png new file mode 100644 index 0000000..7e750cc Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_cactus_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_crystal.png b/3d_armor/textures/3d_armor_helmet_crystal.png new file mode 100644 index 0000000..1405a42 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_crystal.png differ diff --git a/3d_armor/textures/3d_armor_helmet_crystal_preview.png b/3d_armor/textures/3d_armor_helmet_crystal_preview.png new file mode 100644 index 0000000..7bb01ff Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_crystal_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_diamond.png b/3d_armor/textures/3d_armor_helmet_diamond.png new file mode 100644 index 0000000..9196681 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_diamond.png differ diff --git a/3d_armor/textures/3d_armor_helmet_diamond_preview.png b/3d_armor/textures/3d_armor_helmet_diamond_preview.png new file mode 100644 index 0000000..936fa66 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_diamond_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_gold.png b/3d_armor/textures/3d_armor_helmet_gold.png new file mode 100644 index 0000000..3a51908 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_gold.png differ diff --git a/3d_armor/textures/3d_armor_helmet_gold_preview.png b/3d_armor/textures/3d_armor_helmet_gold_preview.png new file mode 100644 index 0000000..fb3ba0e Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_gold_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_mithril.png b/3d_armor/textures/3d_armor_helmet_mithril.png new file mode 100644 index 0000000..2e9caef Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_mithril.png differ diff --git a/3d_armor/textures/3d_armor_helmet_mithril_preview.png b/3d_armor/textures/3d_armor_helmet_mithril_preview.png new file mode 100644 index 0000000..91e7c18 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_mithril_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_steel.png b/3d_armor/textures/3d_armor_helmet_steel.png new file mode 100644 index 0000000..f3c4a39 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_steel.png differ diff --git a/3d_armor/textures/3d_armor_helmet_steel_preview.png b/3d_armor/textures/3d_armor_helmet_steel_preview.png new file mode 100644 index 0000000..fb939c4 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_steel_preview.png differ diff --git a/3d_armor/textures/3d_armor_helmet_wood.png b/3d_armor/textures/3d_armor_helmet_wood.png new file mode 100644 index 0000000..8bda21c Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_wood.png differ diff --git a/3d_armor/textures/3d_armor_helmet_wood_preview.png b/3d_armor/textures/3d_armor_helmet_wood_preview.png new file mode 100644 index 0000000..903a018 Binary files /dev/null and b/3d_armor/textures/3d_armor_helmet_wood_preview.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_admin.png b/3d_armor/textures/3d_armor_inv_boots_admin.png new file mode 100644 index 0000000..71fd410 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_admin.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_bronze.png b/3d_armor/textures/3d_armor_inv_boots_bronze.png new file mode 100644 index 0000000..e704d50 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_bronze.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_cactus.png b/3d_armor/textures/3d_armor_inv_boots_cactus.png new file mode 100644 index 0000000..1b01395 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_cactus.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_crystal.png b/3d_armor/textures/3d_armor_inv_boots_crystal.png new file mode 100644 index 0000000..f663470 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_crystal.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_diamond.png b/3d_armor/textures/3d_armor_inv_boots_diamond.png new file mode 100644 index 0000000..e4394b8 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_diamond.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_gold.png b/3d_armor/textures/3d_armor_inv_boots_gold.png new file mode 100644 index 0000000..1102ea0 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_gold.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_mithril.png b/3d_armor/textures/3d_armor_inv_boots_mithril.png new file mode 100644 index 0000000..43e6b14 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_mithril.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_steel.png b/3d_armor/textures/3d_armor_inv_boots_steel.png new file mode 100644 index 0000000..170f0d9 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_steel.png differ diff --git a/3d_armor/textures/3d_armor_inv_boots_wood.png b/3d_armor/textures/3d_armor_inv_boots_wood.png new file mode 100644 index 0000000..a5e7863 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_boots_wood.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_admin.png b/3d_armor/textures/3d_armor_inv_chestplate_admin.png new file mode 100644 index 0000000..c65c606 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_admin.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_bronze.png b/3d_armor/textures/3d_armor_inv_chestplate_bronze.png new file mode 100644 index 0000000..f0753ee Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_bronze.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_cactus.png b/3d_armor/textures/3d_armor_inv_chestplate_cactus.png new file mode 100644 index 0000000..ca315df Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_cactus.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_crystal.png b/3d_armor/textures/3d_armor_inv_chestplate_crystal.png new file mode 100644 index 0000000..46742a1 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_crystal.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_diamond.png b/3d_armor/textures/3d_armor_inv_chestplate_diamond.png new file mode 100644 index 0000000..1fd75ae Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_diamond.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_gold.png b/3d_armor/textures/3d_armor_inv_chestplate_gold.png new file mode 100644 index 0000000..bdbea82 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_gold.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_mithril.png b/3d_armor/textures/3d_armor_inv_chestplate_mithril.png new file mode 100644 index 0000000..d2b1bd0 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_mithril.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_steel.png b/3d_armor/textures/3d_armor_inv_chestplate_steel.png new file mode 100644 index 0000000..434f1bc Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_steel.png differ diff --git a/3d_armor/textures/3d_armor_inv_chestplate_wood.png b/3d_armor/textures/3d_armor_inv_chestplate_wood.png new file mode 100644 index 0000000..fa1b24e Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_chestplate_wood.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_admin.png b/3d_armor/textures/3d_armor_inv_helmet_admin.png new file mode 100644 index 0000000..abb43a7 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_admin.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_bronze.png b/3d_armor/textures/3d_armor_inv_helmet_bronze.png new file mode 100644 index 0000000..4297d9b Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_bronze.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_cactus.png b/3d_armor/textures/3d_armor_inv_helmet_cactus.png new file mode 100644 index 0000000..7f44463 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_cactus.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_crystal.png b/3d_armor/textures/3d_armor_inv_helmet_crystal.png new file mode 100644 index 0000000..baf6bdf Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_crystal.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_diamond.png b/3d_armor/textures/3d_armor_inv_helmet_diamond.png new file mode 100644 index 0000000..424e970 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_diamond.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_gold.png b/3d_armor/textures/3d_armor_inv_helmet_gold.png new file mode 100644 index 0000000..f5f2fa6 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_gold.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_mithril.png b/3d_armor/textures/3d_armor_inv_helmet_mithril.png new file mode 100644 index 0000000..850991c Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_mithril.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_steel.png b/3d_armor/textures/3d_armor_inv_helmet_steel.png new file mode 100644 index 0000000..5414f9a Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_steel.png differ diff --git a/3d_armor/textures/3d_armor_inv_helmet_wood.png b/3d_armor/textures/3d_armor_inv_helmet_wood.png new file mode 100644 index 0000000..8fbe6a8 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_helmet_wood.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_admin.png b/3d_armor/textures/3d_armor_inv_leggings_admin.png new file mode 100644 index 0000000..1247304 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_admin.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_bronze.png b/3d_armor/textures/3d_armor_inv_leggings_bronze.png new file mode 100644 index 0000000..7252662 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_bronze.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_cactus.png b/3d_armor/textures/3d_armor_inv_leggings_cactus.png new file mode 100644 index 0000000..3f05b16 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_cactus.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_crystal.png b/3d_armor/textures/3d_armor_inv_leggings_crystal.png new file mode 100644 index 0000000..8197b01 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_crystal.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_diamond.png b/3d_armor/textures/3d_armor_inv_leggings_diamond.png new file mode 100644 index 0000000..9dac33b Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_diamond.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_gold.png b/3d_armor/textures/3d_armor_inv_leggings_gold.png new file mode 100644 index 0000000..5aeccb5 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_gold.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_mithril.png b/3d_armor/textures/3d_armor_inv_leggings_mithril.png new file mode 100644 index 0000000..3825a23 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_mithril.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_steel.png b/3d_armor/textures/3d_armor_inv_leggings_steel.png new file mode 100644 index 0000000..b4d083e Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_steel.png differ diff --git a/3d_armor/textures/3d_armor_inv_leggings_wood.png b/3d_armor/textures/3d_armor_inv_leggings_wood.png new file mode 100644 index 0000000..c46cdd9 Binary files /dev/null and b/3d_armor/textures/3d_armor_inv_leggings_wood.png differ diff --git a/3d_armor/textures/3d_armor_leggings_admin.png b/3d_armor/textures/3d_armor_leggings_admin.png new file mode 100644 index 0000000..1f7207d Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_admin.png differ diff --git a/3d_armor/textures/3d_armor_leggings_admin_preview.png b/3d_armor/textures/3d_armor_leggings_admin_preview.png new file mode 100644 index 0000000..95c973a Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_admin_preview.png differ diff --git a/3d_armor/textures/3d_armor_leggings_bronze.png b/3d_armor/textures/3d_armor_leggings_bronze.png new file mode 100644 index 0000000..26d05f0 Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_bronze.png differ diff --git a/3d_armor/textures/3d_armor_leggings_bronze_preview.png b/3d_armor/textures/3d_armor_leggings_bronze_preview.png new file mode 100644 index 0000000..12952ff Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_bronze_preview.png differ diff --git a/3d_armor/textures/3d_armor_leggings_cactus.png b/3d_armor/textures/3d_armor_leggings_cactus.png new file mode 100644 index 0000000..537adcb Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_cactus.png differ diff --git a/3d_armor/textures/3d_armor_leggings_cactus_preview.png b/3d_armor/textures/3d_armor_leggings_cactus_preview.png new file mode 100644 index 0000000..09f848e Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_cactus_preview.png differ diff --git a/3d_armor/textures/3d_armor_leggings_crystal.png b/3d_armor/textures/3d_armor_leggings_crystal.png new file mode 100644 index 0000000..6bf702f Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_crystal.png differ diff --git a/3d_armor/textures/3d_armor_leggings_crystal_preview.png b/3d_armor/textures/3d_armor_leggings_crystal_preview.png new file mode 100644 index 0000000..96a11bf Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_crystal_preview.png differ diff --git a/3d_armor/textures/3d_armor_leggings_diamond.png b/3d_armor/textures/3d_armor_leggings_diamond.png new file mode 100644 index 0000000..df3cf16 Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_diamond.png differ diff --git a/3d_armor/textures/3d_armor_leggings_diamond_preview.png b/3d_armor/textures/3d_armor_leggings_diamond_preview.png new file mode 100644 index 0000000..1bb3295 Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_diamond_preview.png differ diff --git a/3d_armor/textures/3d_armor_leggings_gold.png b/3d_armor/textures/3d_armor_leggings_gold.png new file mode 100644 index 0000000..8ee0bc4 Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_gold.png differ diff --git a/3d_armor/textures/3d_armor_leggings_gold_preview.png b/3d_armor/textures/3d_armor_leggings_gold_preview.png new file mode 100644 index 0000000..a7cf310 Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_gold_preview.png differ diff --git a/3d_armor/textures/3d_armor_leggings_mithril.png b/3d_armor/textures/3d_armor_leggings_mithril.png new file mode 100644 index 0000000..9fc78fb Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_mithril.png differ diff --git a/3d_armor/textures/3d_armor_leggings_mithril_preview.png b/3d_armor/textures/3d_armor_leggings_mithril_preview.png new file mode 100644 index 0000000..dde7b3d Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_mithril_preview.png differ diff --git a/3d_armor/textures/3d_armor_leggings_steel.png b/3d_armor/textures/3d_armor_leggings_steel.png new file mode 100644 index 0000000..974cb5d Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_steel.png differ diff --git a/3d_armor/textures/3d_armor_leggings_steel_preview.png b/3d_armor/textures/3d_armor_leggings_steel_preview.png new file mode 100644 index 0000000..99034ca Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_steel_preview.png differ diff --git a/3d_armor/textures/3d_armor_leggings_wood.png b/3d_armor/textures/3d_armor_leggings_wood.png new file mode 100644 index 0000000..9608144 Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_wood.png differ diff --git a/3d_armor/textures/3d_armor_leggings_wood_preview.png b/3d_armor/textures/3d_armor_leggings_wood_preview.png new file mode 100644 index 0000000..7e43ea5 Binary files /dev/null and b/3d_armor/textures/3d_armor_leggings_wood_preview.png differ diff --git a/3d_armor/textures/3d_armor_trans.png b/3d_armor/textures/3d_armor_trans.png new file mode 100644 index 0000000..4a31242 Binary files /dev/null and b/3d_armor/textures/3d_armor_trans.png differ diff --git a/3d_armor/textures/3d_armor_ui_form.png b/3d_armor/textures/3d_armor_ui_form.png new file mode 100644 index 0000000..993809f Binary files /dev/null and b/3d_armor/textures/3d_armor_ui_form.png differ diff --git a/3d_armor/textures/character_preview.png b/3d_armor/textures/character_preview.png new file mode 100644 index 0000000..82a0ae4 Binary files /dev/null and b/3d_armor/textures/character_preview.png differ diff --git a/3d_armor/textures/inventory_plus_armor.png b/3d_armor/textures/inventory_plus_armor.png new file mode 100644 index 0000000..7f7d63e Binary files /dev/null and b/3d_armor/textures/inventory_plus_armor.png differ diff --git a/3d_armor/textures/preview_index.txt b/3d_armor/textures/preview_index.txt new file mode 100644 index 0000000..9e2fe9d --- /dev/null +++ b/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/3d_armor/tools/README.md b/3d_armor/tools/README.md new file mode 100644 index 0000000..6aa7ffe --- /dev/null +++ b/3d_armor/tools/README.md @@ -0,0 +1,7 @@ +# Intllib tool + +please consider using the intllib tool to update locale files: + +```../../intllib/tools/xgettext.sh ../**/*.lua``` + +make sure you are in `3d_armor` derectory before running this command diff --git a/3d_armor/tools/updatepo.sh b/3d_armor/tools/updatepo.sh new file mode 100644 index 0000000..52de990 --- /dev/null +++ b/3d_armor/tools/updatepo.sh @@ -0,0 +1,24 @@ +#! /bin/bash + +# To create a new translation: +# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot + +cd "$(dirname "${BASH_SOURCE[0]}")/.."; + +# Extract translatable strings. +xgettext --from-code=UTF-8 \ + --language=Lua \ + --sort-by-file \ + --keyword=S \ + --keyword=NS:1,2 \ + --keyword=N_ \ + --add-comments='Translators:' \ + --add-location=file \ + -o locale/template.pot \ + $(find .. -name '*.lua') + +# Update translations. +find locale -name '*.po' | while read -r file; do + echo $file + msgmerge --update $file locale/template.pot; +done diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..f7793ff --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,10 @@ +3D Armor - Visible Player Armor +=============================== + +License Source Code: Copyright (C) 2013-2018 Stuart Jones - LGPL v2.1 + +Armor Textures: Copyright (C) 2017-2018 davidthecreator - CC-BY-SA 3.0 + +Special credit to Jordach and MirceaKitsune for providing the default 3d character model. + +New armor/shield textures CC-BY-SA 3.0 / davidthecreator / https://forum.minetest.net/viewtopic.php?f=11&t=4654&start=800#p356448 diff --git a/README.md b/README.md new file mode 100644 index 0000000..7bfefc0 --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +Modpack - 3d Armor [0.4.13] +=========================== + +![](https://github.com/minetest-mods/3d_armor/workflows/luacheck/badge.svg) +![](https://github.com/minetest-mods/3d_armor/workflows/integration-test/badge.svg) + +### 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] 3d Armor Stand [3d_armor_stand]](#mod-3d-armor-stand-3d_armor_stand) + + + + +[mod] Visible Player Armor [3d_armor] +------------------------------------- + +Minetest Version: 5.0.0 + +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. + +For mod installation instructions, please visit: http://wiki.minetest.com/wiki/Installing_Mods + +[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] 3d Armor Stand [3d_armor_stand] +------------------------------------- + +Depends: 3d_armor + +Adds a chest-like armor stand for armor storage and display. diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..2da5ba4 --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +Visible player armor & wielded items. diff --git a/integration-test.sh b/integration-test.sh new file mode 100644 index 0000000..9169144 --- /dev/null +++ b/integration-test.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# simple integration test + +CFG=/tmp/minetest.conf +MTDIR=/tmp/mt +WORLDDIR=${MTDIR}/worlds/world + +cat < ${CFG} + enable_3d_armor_integration_test = true +EOF + +mkdir -p ${WORLDDIR} +chmod 777 ${MTDIR} -R +docker run --rm -i \ + -v ${CFG}:/etc/minetest/minetest.conf:ro \ + -v ${MTDIR}:/var/lib/minetest/.minetest \ + -v $(pwd):/var/lib/minetest/.minetest/worlds/world/worldmods/3d_armor \ + registry.gitlab.com/minetest/minetest/server:5.2.0 + +test -f ${WORLDDIR}/integration_test.json && exit 0 || exit 1 diff --git a/modpack.conf b/modpack.conf new file mode 100644 index 0000000..c31e279 --- /dev/null +++ b/modpack.conf @@ -0,0 +1,5 @@ +name = 3d_armor +description = Visible player armor & wielded items. +author = stu +title = 3D Armor +release = 5464 diff --git a/preview_gen.py b/preview_gen.py new file mode 100644 index 0000000..a18954d --- /dev/null +++ b/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/screenshot.png b/screenshot.png new file mode 100644 index 0000000..c1f9e58 Binary files /dev/null and b/screenshot.png differ diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..c6c90de --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,65 @@ + +[3d_armor] + +armor_material_wood (Enable wood armor) bool true +armor_material_cactus (Enable cactus armor) bool true +armor_material_steel (Enable steel armor) bool true +armor_material_bronze (Enable bronze armor) bool true +armor_material_diamond (Enable diamond armor) bool true +armor_material_gold (Enable gold armor) bool true +armor_material_mithril (Enable mithril armor) bool true +armor_material_crystal (Enable crystal armor) bool true + +# Increase this if you get initialization glitches when a player first joins. +armor_init_delay (Initialization delay) int 2 + +# Number of initialization attempts. +# Use in conjunction with armor_init_delay if initialization problems persist. +armor_init_times (Initialization attempts) int 10 + +# Increase this if armor is not getting into bones due to server lag. +armor_bones_delay (Delay for bones) int 1 + +# How often player armor items are updated. +armor_update_time (Armor refresh rate [seconds]) int 1 + +# Drop armor when a player dies. +# Uses bones mod if present, otherwise items are dropped around the player. +armor_drop (Drop armor on death) bool true + +# Pulverize armor when a player dies, overrides armor_drop. +armor_destroy (Pulverize armor on death) bool 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 (Armor effectiveness multiplier) float 1 + +# You can use this to increase or decrease overall armor healing, +# eg: armor_heal_multiplier = 0 will disable healing altogether. +armor_heal_multiplier (Armor healing multiplier) float 1 + +# Enable water protection (periodically restores breath when activated). +armor_water_protect (Enable water protection) bool true + +# Enable fire protection (defaults true if using ethereal mod). +armor_fire_protect (Enable fire protection) bool false + +# Enable punch damage effects. +armor_punch_damage (Enable damage effects) bool true + +# Enable migration of old armor inventories. +armor_migrate_old_inventory (Migrate old armor inventories) bool true + + +[shields] + +shields_disable_sounds (Disable shield sounds) bool false + + +[wieldview] + +# Set number of seconds between visible wielded item updates. +wieldview_update_time (Wieldview refresh rate [seconds]) int 2 + +# Show nodes as tiles, disabled by default. +wieldview_node_tiles (Show nodes as tiles) bool false diff --git a/wieldview/LICENSE.txt b/wieldview/LICENSE.txt new file mode 100644 index 0000000..e1552c0 --- /dev/null +++ b/wieldview/LICENSE.txt @@ -0,0 +1,18 @@ +[mod] visible wielded items [wieldview] +======================================= + +Copyright (C) 2012-2019 stujones11, Stuart Jones + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/wieldview/README.txt b/wieldview/README.txt new file mode 100644 index 0000000..3a8b640 --- /dev/null +++ b/wieldview/README.txt @@ -0,0 +1,27 @@ +[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. + +Disabling the feature in-game: If you want to hide the wielded item +you can add an INT metadata to the player called "show_wielded_item" and set +it to 2 (any other value will show the wielded item again). diff --git a/wieldview/depends.txt b/wieldview/depends.txt new file mode 100644 index 0000000..b6cac21 --- /dev/null +++ b/wieldview/depends.txt @@ -0,0 +1 @@ +3d_armor diff --git a/wieldview/description.txt b/wieldview/description.txt new file mode 100644 index 0000000..0d51ad9 --- /dev/null +++ b/wieldview/description.txt @@ -0,0 +1 @@ +Makes hand wielded items visible to other players. diff --git a/wieldview/init.lua b/wieldview/init.lua new file mode 100644 index 0000000..f0edeac --- /dev/null +++ b/wieldview/init.lua @@ -0,0 +1,88 @@ +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 player:get_meta():get_int("show_wielded_item") == 2 then + item = "" + end + 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() + local pplayer = minetest.get_player_by_name(name) + if player then + wieldview:update_wielded_item(pplayer) + end + end) +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/wieldview/mod.conf b/wieldview/mod.conf new file mode 100644 index 0000000..c5f4812 --- /dev/null +++ b/wieldview/mod.conf @@ -0,0 +1,3 @@ +name = wieldview +depends = 3d_armor +description = Makes hand wielded items visible to other players. diff --git a/wieldview/transform.lua b/wieldview/transform.lua new file mode 100644 index 0000000..4d5133e --- /dev/null +++ b/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", +} +