Cleanup, preparing some mods for update

master
MoNTE48 2019-06-27 14:46:07 +02:00
parent 4ee178380a
commit 190299ceba
13 changed files with 1457 additions and 1600 deletions

View File

@ -102,10 +102,11 @@ function core.get_player_radius_area(player_name, radius)
return p1, p2
end
local mapgen_limit = tonumber(core.settings:get("mapgen_limit"))
function core.is_valid_pos(pos)
if pos then
for _, v in pairs({"x", "y", "z"}) do
if not pos[v] or pos[v] < -32000 or pos[v] > 32000 then
if not pos[v] or pos[v] < -mapgen_limit or pos[v] > mapgen_limit then
return
end
end

View File

@ -2738,7 +2738,7 @@ and `minetest.auth_reload` call the authetification handler.
* spread these updates to neighbours and can cause a cascade
of nodes to fall.
* `minetest.is_valid_pos(pos)`
* Returns `true` if the position lies within the range -32000 to 32000
* Returns `true` if the position lies within the mapgen_limit range.
### Inventory

View File

@ -1,10 +0,0 @@
3D Armor - Visible Player Armor
===============================
License Source Code: Copyright (C) 2013-2018 Stuart Jones - LGPL v3.0+
Textures:
Copyright (C) 2013 Vattic
Copyright (C) 2017-2019 Maksim Gamarnik [MoNTE48] MoNTE48@mail.ua & MultiCraft Development Team
Special credit to Jordach and MirceaKitsune for providing the default 3d character model.

View File

@ -0,0 +1,26 @@
MultiCraft Game mod: 3d_armor
=============================
License Source Code
-------------------
Copyright (C) 2012-2019 stujones11, Stuart Jones <stujones111@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3.0 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) 2013 Vattic
Copyright (C) 2017-2019 Maksim Gamarnik [MoNTE48] MoNTE48@mail.ua & MultiCraft Development Team

View File

@ -0,0 +1,449 @@
ARMOR_INIT_DELAY = 1
ARMOR_INIT_TIMES = 1
ARMOR_BONES_DELAY = 1
ARMOR_UPDATE_TIME = 1
ARMOR_DROP = minetest.get_modpath("bones") ~= nil
ARMOR_DESTROY = false
ARMOR_LEVEL_MULTIPLIER = 1
ARMOR_HEAL_MULTIPLIER = 1
local modpath = minetest.get_modpath("3d_armor")
local time = 0
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 = {
player_hp = {},
elements = {"head", "torso", "legs", "feet"},
physics = {"jump","speed","gravity"},
--[[formspec = "size[8,8.5]list[detached:player_name_armor;armor;0,1;2,3;]"
.."image[2,0.75;2,4;armor_preview]"
.."list[current_player;main;0,4.5;8,4;]"
.."list[current_player;craft;4,1;3,3;]"
.."list[current_player;craftpreview;7,2;1,1;]",]]
def = armor_def,
textures = armor_textures,
default_skin = "character",
}
armor.update_player_visuals = function(self, player)
if not player then
return
end
local name = player:get_player_name()
if self.textures[name] then
player_api.set_textures(player, {
self.textures[name].skin,
self.textures[name].armor,
self.textures[name].wielditem,
})
end
end
armor.set_player_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local armor_inv = self:get_armor_inventory(player)
if not name then
minetest.log("error", "Failed to read player name")
return
elseif not armor_inv then
minetest.log("error", "Failed to read player inventory")
return
end
local armor_texture = "blank.png"
local armor_level = 0
local armor_heal = 0
local state = 0
local items = 0
local elements = {}
local textures = {}
local physics_o = {speed=1,gravity=1,jump=1}
local material = {type=nil, count=1}
--local preview = armor:get_player_skin(name).."_preview.png"
for _,v in ipairs(self.elements) do
elements[v] = false
end
for i=1, 4 do
local stack = armor_inv:get_stack("armor", i)
local item = stack:get_name()
if stack:get_count() == 1 then
local def = stack:get_definition()
for k, v in pairs(elements) do
if v == false then
local level = def.groups["armor_"..k]
if level then
local texture = item:gsub("%:", "_")
table.insert(textures, texture..".png")
--preview = preview.."^"..texture.."_preview.png"
armor_level = armor_level + level
state = state + stack:get_wear()
items = items + 1
local heal = def.groups["armor_heal"] or 0
armor_heal = armor_heal + heal
for kk,vv in ipairs(self.physics) do
local o_value = def.groups["physics_"..vv]
if o_value then
physics_o[vv] = physics_o[vv] + o_value
end
end
local mat = string.match(item, "%:.+_(.+)$")
if material.type then
if material.type == mat then
material.count = material.count + 1
end
else
material.type = mat
end
elements[k] = true
end
end
end
end
end
--[[if minetest.get_modpath("shields") then
armor_level = armor_level * 0.9
end]]
if material.type and material.count == #self.elements then
armor_level = armor_level * 1.1
end
armor_level = armor_level * ARMOR_LEVEL_MULTIPLIER
armor_heal = armor_heal * ARMOR_HEAL_MULTIPLIER
if #textures > 0 then
armor_texture = table.concat(textures, "^")
end
local armor_groups = {fleshy=100}
if armor_level > 0 then
armor_groups.level = math.floor(armor_level / 20)
armor_groups.fleshy = 100 - armor_level
end
player:set_armor_groups(armor_groups)
player:set_physics_override(physics_o)
self.textures[name].armor = armor_texture
--self.textures[name].preview = preview
self.def[name].state = state
self.def[name].count = items
self.def[name].level = armor_level
self.def[name].heal = armor_heal
self.def[name].jump = physics_o.jump
self.def[name].speed = physics_o.speed
self.def[name].gravity = physics_o.gravity
self:update_player_visuals(player)
end
armor.update_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local hp = player:get_hp() or 0
if hp == 0 then
return
end
local armor_inv = self:get_armor_inventory(player)
if not armor_inv then
minetest.log("error", "Failed to read detached inventory")
return
end
local state = 0
local items = 0
for i=1, 4 do
local stack = armor_inv:get_stack("armor", i)
if stack:get_count() > 0 then
local use = stack:get_definition().groups["armor_use"] or 0
local item = stack:get_name()
stack:add_wear(use)
armor_inv:set_stack("armor", i, stack)
state = state + stack:get_wear()
items = items + 1
if stack:get_count() == 0 then
local desc = minetest.registered_items[item].description
if desc then
minetest.chat_send_player(name, "Your "..desc.." got destroyed!")
end
self:set_player_armor(player)
armor:update_inventory(player)
end
end
end
self:save_armor_inventory(player)
self.def[name].state = state
self.def[name].count = items
end
armor.get_player_skin = function(self, name)
local skin = nil
if skins then
skin = skins.skins[name]
elseif u_skins then
skin = u_skins.u_skins[name]
end
return skin or armor.default_skin
end
armor.get_armor_formspec = function(self, name)
local formspec = armor.formspec:gsub("player_name", name)
--formspec = formspec:gsub("armor_preview", armor.textures[name].preview)
formspec = formspec:gsub("armor_level", armor.def[name].level)
return formspec:gsub("armor_heal", armor.def[name].heal)
end
--[[armor.update_inventory = function(self, player)
local name = player:get_player_name()
if unified_inventory then
if unified_inventory.current_page[name] == "armor" then
unified_inventory.set_inventory_formspec(player, "armor")
end
else
local formspec = armor:get_armor_formspec(name)
if inventory_plus then
local page = player:get_inventory_formspec()
if page:find("detached:"..name.."_armor") then
inventory_plus.set_inventory_formspec(player, formspec)
end
else
player:set_inventory_formspec(formspec)
end
end
end]]
armor.update_inventory = function(self, player) end
armor.get_armor_inventory = function(self, player)
local name = player:get_player_name()
if name then
return minetest.get_inventory({type="detached", name=name.."_armor"})
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_armor_inventory(player)
if inv then
local armor_list_string = player:get_attribute("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_armor_inventory(player)
if inv then
player:set_attribute("3d_armor_inventory",
self:serialize_inventory_list(inv:get_list("armor")))
end
end
-- Register Callbacks
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
--if inventory_plus and fields.armor then
--local formspec = armor:get_armor_formspec(name)
--inventory_plus.set_inventory_formspec(player, formspec)
--return
--end
for field, _ in pairs(fields) do
if string.find(field, "skins_set_") then
minetest.after(0, function(player)
local skin = armor:get_player_skin(name)
armor.textures[name].skin = skin..".png"
armor:set_player_armor(player)
end, player)
end
end
end)
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
local armor_inv = minetest.create_detached_inventory(name.."_armor",{
allow_put = function(inv, listname, index, stack, player)
local item = stack:get_name()
if not minetest.registered_items[item] then return end
if not minetest.registered_items[item].groups then return end
if minetest.registered_items[item].groups['armor_head']
and index == 1
then
return 1
end
if minetest.registered_items[item].groups['armor_torso']
and index == 2
then
return 1
end
if minetest.registered_items[item].groups['armor_legs']
and index == 3
then
return 1
end
if minetest.registered_items[item].groups['armor_feet']
and index == 4
then
return 1
end
return 0
end,
on_put = function(inv, listname, index, stack, player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
--armor:update_inventory(player)
end,
on_take = function(inv, listname, index, stack, player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
--armor:update_inventory(player)
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
--armor:update_inventory(player)
end,
allow_take = function(inv, listname, index, stack, player)
return stack:get_count()
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
}, name)
armor_inv:set_size("armor", 4)
if not armor:load_armor_inventory(player) then
local player_inv = player:get_inventory()
if player_inv then
player_inv:set_size("armor", 4)
for i=1, 4 do
local stack = player_inv:get_stack("armor", i)
armor_inv:set_stack("armor", i, stack)
end
player_inv:set_size("armor", 0)
end
armor:save_armor_inventory(player)
end
armor.player_hp[name] = 0
armor.def[name] = {
state = 0,
count = 0,
level = 0,
heal = 0,
jump = 1,
speed = 1,
gravity = 1,
}
armor.textures[name] = {
skin = armor.default_skin..".png",
armor = "blank.png",
wielditem = "blank.png",
preview = armor.default_skin.."_preview.png",
}
if minetest.get_modpath("skins") then
local skin = skins.skins[name]
if skin and skins.get_type(skin) == skins.type.MODEL then
armor.textures[name].skin = skin..".png"
end
elseif minetest.get_modpath("simple_skins") then
local skin = skins.skins[name]
if skin then
armor.textures[name].skin = skin..".png"
end
--[[elseif minetest.get_modpath("u_skins") then
local skin = u_skins.u_skins[name]
if skin and u_skins.get_type(skin) == u_skins.type.MODEL then
armor.textures[name].skin = skin..".png"
end]]
end
if minetest.get_modpath("player_textures") then
local filename = minetest.get_modpath("player_textures").."/textures/player_"..name
local f = io.open(filename..".png")
if f then
f:close()
armor.textures[name].skin = "player_"..name..".png"
end
end
for i=1, ARMOR_INIT_TIMES do
minetest.after(ARMOR_INIT_DELAY * i, function(player)
armor:set_player_armor(player)
--if inventory_plus == nil and unified_inventory == nil then
--armor:update_inventory(player)
--end
end, player)
end
end)
minetest.register_on_dieplayer(function(player)
local name = player:get_player_name()
local pos = player:get_pos()
if name and pos then
local drop = {}
local armor_inv = armor:get_armor_inventory(player)
if armor_inv then
for i=1, armor_inv:get_size("armor") do
local stack = armor_inv:get_stack("armor", i)
if stack:get_count() > 0 then
minetest.item_drop(stack, player, pos)
armor_inv:set_stack("armor", i, nil)
end
end
end
armor:save_armor_inventory(player)
armor:set_player_armor(player)
end
end)
minetest.register_on_player_hpchange(function(player, hp_change)
if player and hp_change < 0 then
local name = player:get_player_name()
if name then
if armor.def[name].heal > math.random(100) then
hp_change = 0
end
end
armor:update_armor(player)
end
return hp_change
end)

View File

@ -1,462 +1,190 @@
ARMOR_INIT_DELAY = 1
ARMOR_INIT_TIMES = 1
ARMOR_BONES_DELAY = 1
ARMOR_UPDATE_TIME = 1
ARMOR_DROP = minetest.get_modpath("bones") ~= nil
ARMOR_DESTROY = false
ARMOR_LEVEL_MULTIPLIER = 1
ARMOR_HEAL_MULTIPLIER = 1
-- Regisiter Head Armor
local modpath = minetest.get_modpath("3d_armor")
local worldpath = minetest.get_worldpath()
local input = io.open(modpath.."/armor.conf", "r")
if input then
dofile(modpath.."/armor.conf")
input:close()
input = nil
end
input = io.open(worldpath.."/armor.conf", "r")
if input then
dofile(worldpath.."/armor.conf")
input:close()
input = nil
end
local time = 0
local armor_def = setmetatable({}, {
__index = function()
return setmetatable({
groups = setmetatable({}, {
__index = function()
return 0
end})
}, {
__index = function()
return 0
end
})
end,
minetest.register_tool("3d_armor:helmet_leather", {
description = "Leather Helmet",
inventory_image = "3d_armor_inv_helmet_leather.png",
groups = {armor_head=5, armor_heal=0, armor_use=100},
wear = 0,
})
local armor_textures = setmetatable({}, {
__index = function()
return setmetatable({}, {
__index = function()
return "blank.png"
end
})
end
minetest.register_tool("3d_armor:helmet_steel", {
description = "Steel Helmet",
inventory_image = "3d_armor_inv_helmet_steel.png",
groups = {armor_head=10, armor_heal=5, armor_use=250},
wear = 0,
})
armor = {
player_hp = {},
elements = {"head", "torso", "legs", "feet"},
physics = {"jump","speed","gravity"},
--[[formspec = "size[8,8.5]list[detached:player_name_armor;armor;0,1;2,3;]"
.."image[2,0.75;2,4;armor_preview]"
.."list[current_player;main;0,4.5;8,4;]"
.."list[current_player;craft;4,1;3,3;]"
.."list[current_player;craftpreview;7,2;1,1;]",]]
def = armor_def,
textures = armor_textures,
default_skin = "character",
minetest.register_tool("3d_armor:helmet_gold", {
description = "Golden Helmet",
inventory_image = "3d_armor_inv_helmet_gold.png",
groups = {armor_head=15, armor_heal=10, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_diamond",{
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_helmet_diamond.png",
groups = {armor_head=20, armor_heal=15, armor_use=750},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_chain", {
description = "Chain Helmet",
inventory_image = "3d_armor_inv_helmet_chain.png",
groups = {armor_head=15, armor_heal=10, armor_use=500},
wear = 0,
})
-- Regisiter Torso Armor
minetest.register_tool("3d_armor:chestplate_leather", {
description = "Leather Chestplate",
inventory_image = "3d_armor_inv_chestplate_leather.png",
groups = {armor_torso=15, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_steel", {
description = "Steel Chestplate",
inventory_image = "3d_armor_inv_chestplate_steel.png",
groups = {armor_torso=20, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_gold", {
description = "Golden Chestplate",
inventory_image = "3d_armor_inv_chestplate_gold.png",
groups = {armor_torso=25, armor_heal=10, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_diamond",{
description = "Diamond Chestplate",
inventory_image = "3d_armor_inv_chestplate_diamond.png",
groups = {armor_torso=30, armor_heal=15, armor_use=750},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_chain", {
description = "Chain Chestplate",
inventory_image = "3d_armor_inv_chestplate_chain.png",
groups = {armor_torso=25, armor_heal=10, armor_use=500},
wear = 0,
})
-- Regisiter Leg Armor
minetest.register_tool("3d_armor:leggings_leather", {
description = "Leather Leggings",
inventory_image = "3d_armor_inv_leggings_leather.png",
groups = {armor_legs=10, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_steel", {
description = "Steel Leggings",
inventory_image = "3d_armor_inv_leggings_steel.png",
groups = {armor_legs=15, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_gold", {
description = "Golden Leggings",
inventory_image = "3d_armor_inv_leggings_gold.png",
groups = {armor_legs=20, armor_heal=10, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_diamond",{
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_leggings_diamond.png",
groups = {armor_legs=25, armor_heal=15, armor_use=750},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_chain", {
description = "Chain Leggings",
inventory_image = "3d_armor_inv_leggings_chain.png",
groups = {armor_legs=20, armor_heal=10, armor_use=500},
wear = 0,
})
-- Regisiter Boots
minetest.register_tool("3d_armor:boots_leather", {
description = "Leather Boots",
inventory_image = "3d_armor_inv_boots_leather.png",
groups = {armor_feet=5, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:boots_steel", {
description = "Steel Boots",
inventory_image = "3d_armor_inv_boots_steel.png",
groups = {armor_feet=10, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:boots_gold", {
description = "Golden Boots",
inventory_image = "3d_armor_inv_boots_gold.png",
groups = {armor_feet=15, armor_heal=10, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:boots_diamond",{
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_boots_diamond.png",
groups = {armor_feet=20, armor_heal=15, armor_use=750},
wear = 0,
})
minetest.register_tool("3d_armor:boots_chain", {
description = "Chain Boots",
inventory_image = "3d_armor_inv_boots_chain.png",
groups = {armor_feet=15, armor_heal=10, armor_use=500},
wear = 0,
})
-- Register Craft Recipies
local craft_ingreds = {
leather = "mobs:leather",
steel = "default:steel_ingot",
gold = "default:gold_ingot",
diamond = "default:diamond",
chain = "fire:fire",
}
armor.update_player_visuals = function(self, player)
if not player then
return
end
local name = player:get_player_name()
if self.textures[name] then
player_api.set_textures(player, {
self.textures[name].skin,
self.textures[name].armor,
self.textures[name].wielditem,
})
end
end
armor.set_player_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local armor_inv = self:get_armor_inventory(player)
if not name then
minetest.log("error", "Failed to read player name")
return
elseif not armor_inv then
minetest.log("error", "Failed to read player inventory")
return
end
local armor_texture = "blank.png"
local armor_level = 0
local armor_heal = 0
local state = 0
local items = 0
local elements = {}
local textures = {}
local physics_o = {speed=1,gravity=1,jump=1}
local material = {type=nil, count=1}
--local preview = armor:get_player_skin(name).."_preview.png"
for _,v in ipairs(self.elements) do
elements[v] = false
end
for i=1, 4 do
local stack = armor_inv:get_stack("armor", i)
local item = stack:get_name()
if stack:get_count() == 1 then
local def = stack:get_definition()
for k, v in pairs(elements) do
if v == false then
local level = def.groups["armor_"..k]
if level then
local texture = item:gsub("%:", "_")
table.insert(textures, texture..".png")
--preview = preview.."^"..texture.."_preview.png"
armor_level = armor_level + level
state = state + stack:get_wear()
items = items + 1
local heal = def.groups["armor_heal"] or 0
armor_heal = armor_heal + heal
for kk,vv in ipairs(self.physics) do
local o_value = def.groups["physics_"..vv]
if o_value then
physics_o[vv] = physics_o[vv] + o_value
end
end
local mat = string.match(item, "%:.+_(.+)$")
if material.type then
if material.type == mat then
material.count = material.count + 1
end
else
material.type = mat
end
elements[k] = true
end
end
end
end
end
--[[if minetest.get_modpath("shields") then
armor_level = armor_level * 0.9
end]]
if material.type and material.count == #self.elements then
armor_level = armor_level * 1.1
end
armor_level = armor_level * ARMOR_LEVEL_MULTIPLIER
armor_heal = armor_heal * ARMOR_HEAL_MULTIPLIER
if #textures > 0 then
armor_texture = table.concat(textures, "^")
end
local armor_groups = {fleshy=100}
if armor_level > 0 then
armor_groups.level = math.floor(armor_level / 20)
armor_groups.fleshy = 100 - armor_level
end
player:set_armor_groups(armor_groups)
player:set_physics_override(physics_o)
self.textures[name].armor = armor_texture
--self.textures[name].preview = preview
self.def[name].state = state
self.def[name].count = items
self.def[name].level = armor_level
self.def[name].heal = armor_heal
self.def[name].jump = physics_o.jump
self.def[name].speed = physics_o.speed
self.def[name].gravity = physics_o.gravity
self:update_player_visuals(player)
end
armor.update_armor = function(self, player)
if not player then
return
end
local name = player:get_player_name()
local hp = player:get_hp() or 0
if hp == 0 then
return
end
local armor_inv = self:get_armor_inventory(player)
if not armor_inv then
minetest.log("error", "Failed to read detached inventory")
return
end
local state = 0
local items = 0
for i=1, 4 do
local stack = armor_inv:get_stack("armor", i)
if stack:get_count() > 0 then
local use = stack:get_definition().groups["armor_use"] or 0
local item = stack:get_name()
stack:add_wear(use)
armor_inv:set_stack("armor", i, stack)
state = state + stack:get_wear()
items = items + 1
if stack:get_count() == 0 then
local desc = minetest.registered_items[item].description
if desc then
minetest.chat_send_player(name, "Your "..desc.." got destroyed!")
end
self:set_player_armor(player)
armor:update_inventory(player)
end
end
end
self:save_armor_inventory(player)
self.def[name].state = state
self.def[name].count = items
end
armor.get_player_skin = function(self, name)
local skin = nil
if skins then
skin = skins.skins[name]
elseif u_skins then
skin = u_skins.u_skins[name]
end
return skin or armor.default_skin
end
armor.get_armor_formspec = function(self, name)
local formspec = armor.formspec:gsub("player_name", name)
--formspec = formspec:gsub("armor_preview", armor.textures[name].preview)
formspec = formspec:gsub("armor_level", armor.def[name].level)
return formspec:gsub("armor_heal", armor.def[name].heal)
end
--[[armor.update_inventory = function(self, player)
local name = player:get_player_name()
if unified_inventory then
if unified_inventory.current_page[name] == "armor" then
unified_inventory.set_inventory_formspec(player, "armor")
end
else
local formspec = armor:get_armor_formspec(name)
if inventory_plus then
local page = player:get_inventory_formspec()
if page:find("detached:"..name.."_armor") then
inventory_plus.set_inventory_formspec(player, formspec)
end
else
player:set_inventory_formspec(formspec)
end
end
end]]
armor.update_inventory = function(self, player) end
armor.get_armor_inventory = function(self, player)
local name = player:get_player_name()
if name then
return minetest.get_inventory({type="detached", name=name.."_armor"})
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_armor_inventory(player)
if inv then
local armor_list_string = player:get_attribute("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_armor_inventory(player)
if inv then
player:set_attribute("3d_armor_inventory",
self:serialize_inventory_list(inv:get_list("armor")))
end
end
-- Register Callbacks
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
--if inventory_plus and fields.armor then
--local formspec = armor:get_armor_formspec(name)
--inventory_plus.set_inventory_formspec(player, formspec)
--return
--end
for field, _ in pairs(fields) do
if string.find(field, "skins_set_") then
minetest.after(0, function(player)
local skin = armor:get_player_skin(name)
armor.textures[name].skin = skin..".png"
armor:set_player_armor(player)
end, player)
end
end
end)
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
local armor_inv = minetest.create_detached_inventory(name.."_armor",{
allow_put = function(inv, listname, index, stack, player)
local item = stack:get_name()
if not minetest.registered_items[item] then return end
if not minetest.registered_items[item].groups then return end
if minetest.registered_items[item].groups['armor_head']
and index == 1
then
return 1
end
if minetest.registered_items[item].groups['armor_torso']
and index == 2
then
return 1
end
if minetest.registered_items[item].groups['armor_legs']
and index == 3
then
return 1
end
if minetest.registered_items[item].groups['armor_feet']
and index == 4
then
return 1
end
return 0
end,
on_put = function(inv, listname, index, stack, player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
--armor:update_inventory(player)
end,
on_take = function(inv, listname, index, stack, player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
--armor:update_inventory(player)
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
armor:save_armor_inventory(player)
armor:set_player_armor(player)
--armor:update_inventory(player)
end,
allow_take = function(inv, listname, index, stack, player)
return stack:get_count()
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
}, name)
armor_inv:set_size("armor", 4)
if not armor:load_armor_inventory(player) then
local player_inv = player:get_inventory()
if player_inv then
player_inv:set_size("armor", 4)
for i=1, 4 do
local stack = player_inv:get_stack("armor", i)
armor_inv:set_stack("armor", i, stack)
end
player_inv:set_size("armor", 0)
end
armor:save_armor_inventory(player)
end
armor.player_hp[name] = 0
armor.def[name] = {
state = 0,
count = 0,
level = 0,
heal = 0,
jump = 1,
speed = 1,
gravity = 1,
}
armor.textures[name] = {
skin = armor.default_skin..".png",
armor = "blank.png",
wielditem = "blank.png",
preview = armor.default_skin.."_preview.png",
}
if minetest.get_modpath("skins") then
local skin = skins.skins[name]
if skin and skins.get_type(skin) == skins.type.MODEL then
armor.textures[name].skin = skin..".png"
end
elseif minetest.get_modpath("simple_skins") then
local skin = skins.skins[name]
if skin then
armor.textures[name].skin = skin..".png"
end
--[[elseif minetest.get_modpath("u_skins") then
local skin = u_skins.u_skins[name]
if skin and u_skins.get_type(skin) == u_skins.type.MODEL then
armor.textures[name].skin = skin..".png"
end]]
end
if minetest.get_modpath("player_textures") then
local filename = minetest.get_modpath("player_textures").."/textures/player_"..name
local f = io.open(filename..".png")
if f then
f:close()
armor.textures[name].skin = "player_"..name..".png"
end
end
for i=1, ARMOR_INIT_TIMES do
minetest.after(ARMOR_INIT_DELAY * i, function(player)
armor:set_player_armor(player)
--if inventory_plus == nil and unified_inventory == nil then
--armor:update_inventory(player)
--end
end, player)
end
end)
minetest.register_on_dieplayer(function(player)
local name = player:get_player_name()
local pos = player:get_pos()
if name and pos then
local drop = {}
local armor_inv = armor:get_armor_inventory(player)
if armor_inv then
for i=1, armor_inv:get_size("armor") do
local stack = armor_inv:get_stack("armor", i)
if stack:get_count() > 0 then
minetest.item_drop(stack, player, pos)
armor_inv:set_stack("armor", i, nil)
end
end
end
armor:save_armor_inventory(player)
armor:set_player_armor(player)
end
end)
minetest.register_on_player_hpchange(function(player, hp_change)
if player and hp_change < 0 then
local name = player:get_player_name()
if name then
if armor.def[name].heal > math.random(100) then
hp_change = 0
end
end
armor:update_armor(player)
end
return hp_change
end)
for k, v in pairs(craft_ingreds) do
minetest.register_craft({
output = "3d_armor:helmet_"..k,
recipe = {
{v, v, v},
{v, "", v},
{"", "", ""},
},
})
minetest.register_craft({
output = "3d_armor:chestplate_"..k,
recipe = {
{v, "", v},
{v, v, v},
{v, v, v},
},
})
minetest.register_craft({
output = "3d_armor:leggings_"..k,
recipe = {
{v, v, v},
{v, "", v},
{v, "", v},
},
})
minetest.register_craft({
output = "3d_armor:boots_"..k,
recipe = {
{v, "", v},
{v, "", v},
},
})
end

View File

@ -1,194 +1,4 @@
local modpath = minetest.get_modpath("3d_armor")
dofile(modpath .. "/api.lua")
dofile(modpath .. "/armor.lua")
dofile(modpath .. "/hud.lua")
-- Regisiter Head Armor
minetest.register_tool("3d_armor:helmet_leather", {
description = "Leather Helmet",
inventory_image = "3d_armor_inv_helmet_leather.png",
groups = {armor_head=5, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_steel", {
description = "Steel Helmet",
inventory_image = "3d_armor_inv_helmet_steel.png",
groups = {armor_head=10, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_gold", {
description = "Golden Helmet",
inventory_image = "3d_armor_inv_helmet_gold.png",
groups = {armor_head=15, armor_heal=10, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_diamond",{
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_helmet_diamond.png",
groups = {armor_head=20, armor_heal=15, armor_use=750},
wear = 0,
})
minetest.register_tool("3d_armor:helmet_chain", {
description = "Chain Helmet",
inventory_image = "3d_armor_inv_helmet_chain.png",
groups = {armor_head=15, armor_heal=10, armor_use=500},
wear = 0,
})
-- Regisiter Torso Armor
minetest.register_tool("3d_armor:chestplate_leather", {
description = "Leather Chestplate",
inventory_image = "3d_armor_inv_chestplate_leather.png",
groups = {armor_torso=15, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_steel", {
description = "Steel Chestplate",
inventory_image = "3d_armor_inv_chestplate_steel.png",
groups = {armor_torso=20, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_gold", {
description = "Golden Chestplate",
inventory_image = "3d_armor_inv_chestplate_gold.png",
groups = {armor_torso=25, armor_heal=10, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_diamond",{
description = "Diamond Chestplate",
inventory_image = "3d_armor_inv_chestplate_diamond.png",
groups = {armor_torso=30, armor_heal=15, armor_use=750},
wear = 0,
})
minetest.register_tool("3d_armor:chestplate_chain", {
description = "Chain Chestplate",
inventory_image = "3d_armor_inv_chestplate_chain.png",
groups = {armor_torso=25, armor_heal=10, armor_use=500},
wear = 0,
})
-- Regisiter Leg Armor
minetest.register_tool("3d_armor:leggings_leather", {
description = "Leather Leggings",
inventory_image = "3d_armor_inv_leggings_leather.png",
groups = {armor_legs=10, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_steel", {
description = "Steel Leggings",
inventory_image = "3d_armor_inv_leggings_steel.png",
groups = {armor_legs=15, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_gold", {
description = "Golden Leggings",
inventory_image = "3d_armor_inv_leggings_gold.png",
groups = {armor_legs=20, armor_heal=10, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_diamond",{
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_leggings_diamond.png",
groups = {armor_legs=25, armor_heal=15, armor_use=750},
wear = 0,
})
minetest.register_tool("3d_armor:leggings_chain", {
description = "Chain Leggings",
inventory_image = "3d_armor_inv_leggings_chain.png",
groups = {armor_legs=20, armor_heal=10, armor_use=500},
wear = 0,
})
-- Regisiter Boots
minetest.register_tool("3d_armor:boots_leather", {
description = "Leather Boots",
inventory_image = "3d_armor_inv_boots_leather.png",
groups = {armor_feet=5, armor_heal=0, armor_use=100},
wear = 0,
})
minetest.register_tool("3d_armor:boots_steel", {
description = "Steel Boots",
inventory_image = "3d_armor_inv_boots_steel.png",
groups = {armor_feet=10, armor_heal=5, armor_use=250},
wear = 0,
})
minetest.register_tool("3d_armor:boots_gold", {
description = "Golden Boots",
inventory_image = "3d_armor_inv_boots_gold.png",
groups = {armor_feet=15, armor_heal=10, armor_use=500},
wear = 0,
})
minetest.register_tool("3d_armor:boots_diamond",{
description = "Diamond Helmet",
inventory_image = "3d_armor_inv_boots_diamond.png",
groups = {armor_feet=20, armor_heal=15, armor_use=750},
wear = 0,
})
minetest.register_tool("3d_armor:boots_chain", {
description = "Chain Boots",
inventory_image = "3d_armor_inv_boots_chain.png",
groups = {armor_feet=15, armor_heal=10, armor_use=500},
wear = 0,
})
-- Register Craft Recipies
local craft_ingreds = {
leather = "mobs:leather",
steel = "default:steel_ingot",
gold = "default:gold_ingot",
diamond = "default:diamond",
chain = "fire:fire",
}
for k, v in pairs(craft_ingreds) do
minetest.register_craft({
output = "3d_armor:helmet_"..k,
recipe = {
{v, v, v},
{v, "", v},
{"", "", ""},
},
})
minetest.register_craft({
output = "3d_armor:chestplate_"..k,
recipe = {
{v, "", v},
{v, v, v},
{v, v, v},
},
})
minetest.register_craft({
output = "3d_armor:leggings_"..k,
recipe = {
{v, v, v},
{v, "", v},
{v, "", v},
},
})
minetest.register_craft({
output = "3d_armor:boots_"..k,
recipe = {
{v, "", v},
{v, "", v},
},
})
end

View File

@ -86,7 +86,6 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
"mesecons_delayer_sides_off.png"
},
wield_image = "mesecons_delayer_off.png",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },
@ -142,7 +141,6 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
"mesecons_delayer_sides_on.png",
"mesecons_delayer_sides_on.png"
},
walkable = true,
selection_box = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },

View File

@ -59,7 +59,7 @@ local boat = {
physical = true,
collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "rowboat.x",
mesh = "boat.x",
textures = {"default_acacia_wood.png"},
driver = nil,
v = 0,

View File

@ -0,0 +1,689 @@
xof 0303txt 0032
Frame Root {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000,-0.000000, 1.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;
}
Frame Cube_000 {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;
}
Mesh { // Cube_000 mesh
240;
6.000000; 3.999999; 2.376923;,
5.999998;-8.000001; 2.376923;,
5.999998;-8.000001; 4.376923;,
6.000001; 3.999999; 4.376923;,
-2.000000; 8.000000; 2.376923;,
2.000000; 8.000000; 2.376923;,
2.000001; 8.000000; 4.376923;,
-1.999999; 8.000000; 4.376923;,
-6.000000; 4.000000; 4.376923;,
-6.000001;-8.000000; 4.376923;,
-6.000001;-7.999999; 2.376923;,
-6.000000; 4.000000; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000001;-8.000002; 2.376923;,
-4.000001;-8.000000; 2.376923;,
-2.000000; 4.000000;-1.623077;,
-2.000001;-7.999999;-1.623077;,
1.999999;-8.000001;-1.623077;,
2.000000; 4.000000;-1.623077;,
-2.000000; 4.000000; 0.376923;,
2.000000; 3.999999; 0.376923;,
1.999999;-8.000001; 0.376923;,
-2.000001;-8.000000; 0.376923;,
-2.000000; 4.000000;-1.623077;,
2.000000; 4.000000;-1.623077;,
2.000000; 3.999999; 0.376923;,
-2.000000; 4.000000; 0.376923;,
2.000000; 4.000000;-1.623077;,
1.999999;-8.000001;-1.623077;,
1.999999;-8.000001; 0.376923;,
2.000000; 3.999999; 0.376923;,
1.999999;-8.000001;-1.623077;,
-2.000001;-7.999999;-1.623077;,
-2.000001;-8.000000; 0.376923;,
1.999999;-8.000001; 0.376923;,
-2.000000; 4.000000; 0.376923;,
-2.000001;-8.000000; 0.376923;,
-2.000001;-7.999999;-1.623077;,
-2.000000; 4.000000;-1.623077;,
-4.000001;-8.000000; 0.376923;,
-4.000001;-10.000000; 0.376923;,
4.000000;-10.000000; 0.376923;,
3.999999;-8.000000; 0.376923;,
-4.000000;-7.999999; 4.376923;,
4.000000;-8.000001; 4.376923;,
3.999999;-10.000001; 4.376923;,
-4.000001;-10.000000; 4.376923;,
-4.000001;-8.000000; 0.376923;,
3.999999;-8.000000; 0.376923;,
4.000000;-8.000001; 4.376923;,
-4.000000;-7.999999; 4.376923;,
3.999999;-8.000000; 0.376923;,
4.000000;-10.000000; 0.376923;,
3.999999;-10.000001; 4.376923;,
4.000000;-8.000001; 4.376923;,
4.000000;-10.000000; 0.376923;,
-4.000001;-10.000000; 0.376923;,
-4.000001;-10.000000; 4.376923;,
3.999999;-10.000001; 4.376923;,
-4.000000;-7.999999; 4.376923;,
-4.000001;-10.000000; 4.376923;,
-4.000001;-10.000000; 0.376923;,
-4.000001;-8.000000; 0.376923;,
4.000000; 4.000000; 2.376923;,
3.999999;-8.000001; 2.376923;,
5.999998;-8.000001; 2.376923;,
6.000000; 3.999999; 2.376923;,
4.000001; 4.000000; 4.376923;,
6.000001; 3.999999; 4.376923;,
5.999998;-8.000001; 4.376923;,
4.000000;-8.000001; 4.376923;,
4.000000; 4.000000; 2.376923;,
6.000000; 3.999999; 2.376923;,
6.000001; 3.999999; 4.376923;,
4.000001; 4.000000; 4.376923;,
5.999998;-8.000001; 2.376923;,
3.999999;-8.000001; 2.376923;,
4.000000;-8.000001; 4.376923;,
5.999998;-8.000001; 4.376923;,
4.000001; 4.000000; 4.376923;,
4.000000;-8.000001; 4.376923;,
3.999999;-8.000001; 2.376923;,
4.000000; 4.000000; 2.376923;,
2.000000; 6.000000; 0.376923;,
1.999999;-8.000001; 0.376923;,
3.999999;-8.000000; 0.376923;,
4.000000; 6.000000; 0.376923;,
2.000001; 6.000000; 2.376923;,
4.000001; 5.999999; 2.376923;,
3.999999;-8.000001; 2.376923;,
1.999999;-8.000000; 2.376923;,
2.000000; 6.000000; 0.376923;,
4.000000; 6.000000; 0.376923;,
4.000001; 5.999999; 2.376923;,
2.000001; 6.000000; 2.376923;,
4.000000; 6.000000; 0.376923;,
3.999999;-8.000000; 0.376923;,
3.999999;-8.000001; 2.376923;,
4.000001; 5.999999; 2.376923;,
3.999999;-8.000000; 0.376923;,
1.999999;-8.000001; 0.376923;,
1.999999;-8.000000; 2.376923;,
3.999999;-8.000001; 2.376923;,
2.000001; 6.000000; 2.376923;,
1.999999;-8.000000; 2.376923;,
1.999999;-8.000001; 0.376923;,
2.000000; 6.000000; 0.376923;,
2.000001; 6.000000; 2.376923;,
2.000000; 4.000000; 2.376923;,
4.000000; 4.000000; 2.376923;,
4.000001; 5.999999; 2.376923;,
2.000001; 6.000000; 4.376923;,
4.000001; 5.999999; 4.376923;,
4.000001; 4.000000; 4.376923;,
2.000000; 4.000000; 4.376923;,
2.000001; 6.000000; 2.376923;,
4.000001; 5.999999; 2.376923;,
4.000001; 5.999999; 4.376923;,
2.000001; 6.000000; 4.376923;,
4.000001; 5.999999; 2.376923;,
4.000000; 4.000000; 2.376923;,
4.000001; 4.000000; 4.376923;,
4.000001; 5.999999; 4.376923;,
4.000000; 4.000000; 2.376923;,
2.000000; 4.000000; 2.376923;,
2.000000; 4.000000; 4.376923;,
4.000001; 4.000000; 4.376923;,
2.000001; 6.000000; 4.376923;,
2.000000; 4.000000; 4.376923;,
2.000000; 4.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-4.000000; 4.000000; 2.376923;,
-2.000000; 4.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-3.999999; 6.000001; 4.376923;,
-1.999999; 6.000000; 4.376923;,
-2.000000; 4.000000; 4.376923;,
-4.000000; 3.999999; 4.376923;,
-3.999999; 6.000001; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-1.999999; 6.000000; 4.376923;,
-3.999999; 6.000001; 4.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000000; 4.000000; 2.376923;,
-2.000000; 4.000000; 4.376923;,
-1.999999; 6.000000; 4.376923;,
-2.000000; 4.000000; 2.376923;,
-4.000000; 4.000000; 2.376923;,
-4.000000; 3.999999; 4.376923;,
-2.000000; 4.000000; 4.376923;,
-3.999999; 6.000001; 4.376923;,
-4.000000; 3.999999; 4.376923;,
-4.000000; 4.000000; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-2.000000; 8.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
2.000000; 8.000000; 2.376923;,
-1.999999; 8.000000; 4.376923;,
2.000001; 8.000000; 4.376923;,
2.000001; 6.000000; 4.376923;,
-1.999999; 6.000000; 4.376923;,
2.000000; 8.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
2.000001; 6.000000; 4.376923;,
2.000001; 8.000000; 4.376923;,
2.000001; 6.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-1.999999; 6.000000; 4.376923;,
2.000001; 6.000000; 4.376923;,
-1.999999; 8.000000; 4.376923;,
-1.999999; 6.000000; 4.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000000; 8.000000; 2.376923;,
-2.000000; 6.000000; 0.376923;,
-2.000000; 4.000000; 0.376923;,
2.000000; 3.999999; 0.376923;,
2.000000; 6.000000; 0.376923;,
-1.999999; 6.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
2.000000; 4.000000; 2.376923;,
-2.000000; 4.000000; 2.376923;,
-2.000000; 6.000000; 0.376923;,
2.000000; 6.000000; 0.376923;,
2.000001; 6.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
2.000000; 6.000000; 0.376923;,
2.000000; 3.999999; 0.376923;,
2.000000; 4.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
2.000000; 3.999999; 0.376923;,
-2.000000; 4.000000; 0.376923;,
-2.000000; 4.000000; 2.376923;,
2.000000; 4.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000000; 4.000000; 2.376923;,
-2.000000; 4.000000; 0.376923;,
-2.000000; 6.000000; 0.376923;,
-6.000000; 4.000000; 2.376923;,
-6.000001;-7.999999; 2.376923;,
-4.000001;-8.000000; 2.376923;,
-4.000000; 4.000000; 2.376923;,
-6.000000; 4.000000; 4.376923;,
-4.000000; 3.999999; 4.376923;,
-4.000000;-7.999999; 4.376923;,
-6.000001;-8.000000; 4.376923;,
-6.000000; 4.000000; 2.376923;,
-4.000000; 4.000000; 2.376923;,
-4.000000; 3.999999; 4.376923;,
-6.000000; 4.000000; 4.376923;,
-4.000000; 4.000000; 2.376923;,
-4.000001;-8.000000; 2.376923;,
-4.000000;-7.999999; 4.376923;,
-4.000000; 3.999999; 4.376923;,
-4.000001;-8.000000; 2.376923;,
-6.000001;-7.999999; 2.376923;,
-6.000001;-8.000000; 4.376923;,
-4.000000;-7.999999; 4.376923;,
-4.000000; 6.000001; 0.376923;,
-4.000001;-8.000000; 0.376923;,
-2.000001;-8.000000; 0.376923;,
-2.000000; 6.000000; 0.376923;,
-4.000000; 6.000001; 0.376923;,
-2.000000; 6.000000; 0.376923;,
-1.999999; 6.000000; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-2.000000; 6.000000; 0.376923;,
-2.000001;-8.000000; 0.376923;,
-2.000001;-8.000002; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000001;-8.000000; 0.376923;,
-4.000001;-8.000000; 0.376923;,
-4.000001;-8.000000; 2.376923;,
-2.000001;-8.000002; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-4.000001;-8.000000; 2.376923;,
-4.000001;-8.000000; 0.376923;,
-4.000000; 6.000001; 0.376923;;
60;
4;0,1,2,3;,
4;4,5,6,7;,
4;8,9,10,11;,
4;12,13,14,15;,
4;16,17,18,19;,
4;20,21,22,23;,
4;24,25,26,27;,
4;28,29,30,31;,
4;32,33,34,35;,
4;36,37,38,39;,
4;40,41,42,43;,
4;44,45,46,47;,
4;48,49,50,51;,
4;52,53,54,55;,
4;56,57,58,59;,
4;60,61,62,63;,
4;64,65,66,67;,
4;68,69,70,71;,
4;72,73,74,75;,
4;76,77,78,79;,
4;80,81,82,83;,
4;84,85,86,87;,
4;88,89,90,91;,
4;92,93,94,95;,
4;96,97,98,99;,
4;100,101,102,103;,
4;104,105,106,107;,
4;108,109,110,111;,
4;112,113,114,115;,
4;116,117,118,119;,
4;120,121,122,123;,
4;124,125,126,127;,
4;128,129,130,131;,
4;132,133,134,135;,
4;136,137,138,139;,
4;140,141,142,143;,
4;144,145,146,147;,
4;148,149,150,151;,
4;152,153,154,155;,
4;156,157,158,159;,
4;160,161,162,163;,
4;164,165,166,167;,
4;168,169,170,171;,
4;172,173,174,175;,
4;176,177,178,179;,
4;180,181,182,183;,
4;184,185,186,187;,
4;188,189,190,191;,
4;192,193,194,195;,
4;196,197,198,199;,
4;200,201,202,203;,
4;204,205,206,207;,
4;208,209,210,211;,
4;212,213,214,215;,
4;216,217,218,219;,
4;220,221,222,223;,
4;224,225,226,227;,
4;228,229,230,231;,
4;232,233,234,235;,
4;236,237,238,239;;
MeshNormals { // Cube_000 normals
60;
-1.000000; 0.000000; 0.000000;,
0.000000;-1.000000;-0.000000;,
1.000000;-0.000000; 0.000000;,
0.000000; 0.000000;-1.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000;-0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000001;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000001;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000001;-1.000000; 0.000000;,
-1.000000; 0.000001;-0.000000;,
-0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-1.000000;-0.000000; 0.000000;,
-0.000000; 1.000000;-0.000000;,
1.000000; 0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000;-0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
0.000000; 0.000000; 1.000000;,
-0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000001; 1.000000; 0.000001;,
1.000000;-0.000000;-0.000000;;
60;
4;0,0,0,0;,
4;1,1,1,1;,
4;2,2,2,2;,
4;3,3,3,3;,
4;4,4,4,4;,
4;5,5,5,5;,
4;6,6,6,6;,
4;7,7,7,7;,
4;8,8,8,8;,
4;9,9,9,9;,
4;10,10,10,10;,
4;11,11,11,11;,
4;12,12,12,12;,
4;13,13,13,13;,
4;14,14,14,14;,
4;15,15,15,15;,
4;16,16,16,16;,
4;17,17,17,17;,
4;18,18,18,18;,
4;19,19,19,19;,
4;20,20,20,20;,
4;21,21,21,21;,
4;22,22,22,22;,
4;23,23,23,23;,
4;24,24,24,24;,
4;25,25,25,25;,
4;26,26,26,26;,
4;27,27,27,27;,
4;28,28,28,28;,
4;29,29,29,29;,
4;30,30,30,30;,
4;31,31,31,31;,
4;32,32,32,32;,
4;33,33,33,33;,
4;34,34,34,34;,
4;35,35,35,35;,
4;36,36,36,36;,
4;37,37,37,37;,
4;38,38,38,38;,
4;39,39,39,39;,
4;40,40,40,40;,
4;41,41,41,41;,
4;42,42,42,42;,
4;43,43,43,43;,
4;44,44,44,44;,
4;45,45,45,45;,
4;46,46,46,46;,
4;47,47,47,47;,
4;48,48,48,48;,
4;49,49,49,49;,
4;50,50,50,50;,
4;51,51,51,51;,
4;52,52,52,52;,
4;53,53,53,53;,
4;54,54,54,54;,
4;55,55,55,55;,
4;56,56,56,56;,
4;57,57,57,57;,
4;58,58,58,58;,
4;59,59,59,59;;
} // End of Cube_000 normals
MeshTextureCoords { // Cube_000 UV coordinates
240;
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
2.000000; 0.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
7.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
5.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
5.000000;-1.000000;,
6.000000;-1.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
2.000000; 0.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
3.000000; 0.999999;,
0.000000; 1.000000;,
0.000000; 0.000001;,
3.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000001; 1.000000;,
0.000000;-4.000000;,
1.000000;-4.000000;,
1.000000;-3.000000;,
0.999999; 1.000000;,
0.000000; 1.000000;,
0.000000;-3.000000;,
4.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
4.000000;-1.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000;-1.000000;,
5.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-0.999999;,
5.000000;-1.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000;-1.000000;,
5.375000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
5.375000; 0.000000;,
5.375000; 0.000000;,
5.375000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
7.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000;-1.000000;,
1.000000;-1.000000;,
0.999999; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000001;,
2.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000;-1.000000;,
1.000000;-1.000000;,
0.999999; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
2.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000001;,
2.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
7.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;;
} // End of Cube_000 UV coordinates
} // End of Cube_000 mesh
} // End of Cube_000
} // End of Root

View File

@ -1,760 +0,0 @@
xof 0303txt 0032
Frame Root {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000,-0.000000, 1.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;
}
Frame Cube_000 {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;
}
Mesh { // Cube_000 mesh
240;
6.000000; 3.999999; 2.376923;,
5.999998;-8.000001; 2.376923;,
5.999998;-8.000001; 4.376923;,
6.000001; 3.999999; 4.376923;,
-2.000000; 8.000000; 2.376923;,
2.000000; 8.000000; 2.376923;,
2.000001; 8.000000; 4.376923;,
-1.999999; 8.000000; 4.376923;,
-6.000000; 4.000000; 4.376923;,
-6.000001;-8.000000; 4.376923;,
-6.000001;-7.999999; 2.376923;,
-6.000000; 4.000000; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000001;-8.000002; 2.376923;,
-4.000001;-8.000000; 2.376923;,
-2.000000; 4.000000;-1.623077;,
-2.000001;-7.999999;-1.623077;,
1.999999;-8.000001;-1.623077;,
2.000000; 4.000000;-1.623077;,
-2.000000; 4.000000; 0.376923;,
2.000000; 3.999999; 0.376923;,
1.999999;-8.000001; 0.376923;,
-2.000001;-8.000000; 0.376923;,
-2.000000; 4.000000;-1.623077;,
2.000000; 4.000000;-1.623077;,
2.000000; 3.999999; 0.376923;,
-2.000000; 4.000000; 0.376923;,
2.000000; 4.000000;-1.623077;,
1.999999;-8.000001;-1.623077;,
1.999999;-8.000001; 0.376923;,
2.000000; 3.999999; 0.376923;,
1.999999;-8.000001;-1.623077;,
-2.000001;-7.999999;-1.623077;,
-2.000001;-8.000000; 0.376923;,
1.999999;-8.000001; 0.376923;,
-2.000000; 4.000000; 0.376923;,
-2.000001;-8.000000; 0.376923;,
-2.000001;-7.999999;-1.623077;,
-2.000000; 4.000000;-1.623077;,
-4.000001;-8.000000; 0.376923;,
-4.000001;-10.000000; 0.376923;,
4.000000;-10.000000; 0.376923;,
3.999999;-8.000000; 0.376923;,
-4.000000;-7.999999; 4.376923;,
4.000000;-8.000001; 4.376923;,
3.999999;-10.000001; 4.376923;,
-4.000001;-10.000000; 4.376923;,
-4.000001;-8.000000; 0.376923;,
3.999999;-8.000000; 0.376923;,
4.000000;-8.000001; 4.376923;,
-4.000000;-7.999999; 4.376923;,
3.999999;-8.000000; 0.376923;,
4.000000;-10.000000; 0.376923;,
3.999999;-10.000001; 4.376923;,
4.000000;-8.000001; 4.376923;,
4.000000;-10.000000; 0.376923;,
-4.000001;-10.000000; 0.376923;,
-4.000001;-10.000000; 4.376923;,
3.999999;-10.000001; 4.376923;,
-4.000000;-7.999999; 4.376923;,
-4.000001;-10.000000; 4.376923;,
-4.000001;-10.000000; 0.376923;,
-4.000001;-8.000000; 0.376923;,
4.000000; 4.000000; 2.376923;,
3.999999;-8.000001; 2.376923;,
5.999998;-8.000001; 2.376923;,
6.000000; 3.999999; 2.376923;,
4.000001; 4.000000; 4.376923;,
6.000001; 3.999999; 4.376923;,
5.999998;-8.000001; 4.376923;,
4.000000;-8.000001; 4.376923;,
4.000000; 4.000000; 2.376923;,
6.000000; 3.999999; 2.376923;,
6.000001; 3.999999; 4.376923;,
4.000001; 4.000000; 4.376923;,
5.999998;-8.000001; 2.376923;,
3.999999;-8.000001; 2.376923;,
4.000000;-8.000001; 4.376923;,
5.999998;-8.000001; 4.376923;,
4.000001; 4.000000; 4.376923;,
4.000000;-8.000001; 4.376923;,
3.999999;-8.000001; 2.376923;,
4.000000; 4.000000; 2.376923;,
2.000000; 6.000000; 0.376923;,
1.999999;-8.000001; 0.376923;,
3.999999;-8.000000; 0.376923;,
4.000000; 6.000000; 0.376923;,
2.000001; 6.000000; 2.376923;,
4.000001; 5.999999; 2.376923;,
3.999999;-8.000001; 2.376923;,
1.999999;-8.000000; 2.376923;,
2.000000; 6.000000; 0.376923;,
4.000000; 6.000000; 0.376923;,
4.000001; 5.999999; 2.376923;,
2.000001; 6.000000; 2.376923;,
4.000000; 6.000000; 0.376923;,
3.999999;-8.000000; 0.376923;,
3.999999;-8.000001; 2.376923;,
4.000001; 5.999999; 2.376923;,
3.999999;-8.000000; 0.376923;,
1.999999;-8.000001; 0.376923;,
1.999999;-8.000000; 2.376923;,
3.999999;-8.000001; 2.376923;,
2.000001; 6.000000; 2.376923;,
1.999999;-8.000000; 2.376923;,
1.999999;-8.000001; 0.376923;,
2.000000; 6.000000; 0.376923;,
2.000001; 6.000000; 2.376923;,
2.000000; 4.000000; 2.376923;,
4.000000; 4.000000; 2.376923;,
4.000001; 5.999999; 2.376923;,
2.000001; 6.000000; 4.376923;,
4.000001; 5.999999; 4.376923;,
4.000001; 4.000000; 4.376923;,
2.000000; 4.000000; 4.376923;,
2.000001; 6.000000; 2.376923;,
4.000001; 5.999999; 2.376923;,
4.000001; 5.999999; 4.376923;,
2.000001; 6.000000; 4.376923;,
4.000001; 5.999999; 2.376923;,
4.000000; 4.000000; 2.376923;,
4.000001; 4.000000; 4.376923;,
4.000001; 5.999999; 4.376923;,
4.000000; 4.000000; 2.376923;,
2.000000; 4.000000; 2.376923;,
2.000000; 4.000000; 4.376923;,
4.000001; 4.000000; 4.376923;,
2.000001; 6.000000; 4.376923;,
2.000000; 4.000000; 4.376923;,
2.000000; 4.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-4.000000; 4.000000; 2.376923;,
-2.000000; 4.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-3.999999; 6.000001; 4.376923;,
-1.999999; 6.000000; 4.376923;,
-2.000000; 4.000000; 4.376923;,
-4.000000; 3.999999; 4.376923;,
-3.999999; 6.000001; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-1.999999; 6.000000; 4.376923;,
-3.999999; 6.000001; 4.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000000; 4.000000; 2.376923;,
-2.000000; 4.000000; 4.376923;,
-1.999999; 6.000000; 4.376923;,
-2.000000; 4.000000; 2.376923;,
-4.000000; 4.000000; 2.376923;,
-4.000000; 3.999999; 4.376923;,
-2.000000; 4.000000; 4.376923;,
-3.999999; 6.000001; 4.376923;,
-4.000000; 3.999999; 4.376923;,
-4.000000; 4.000000; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-2.000000; 8.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
2.000000; 8.000000; 2.376923;,
-1.999999; 8.000000; 4.376923;,
2.000001; 8.000000; 4.376923;,
2.000001; 6.000000; 4.376923;,
-1.999999; 6.000000; 4.376923;,
2.000000; 8.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
2.000001; 6.000000; 4.376923;,
2.000001; 8.000000; 4.376923;,
2.000001; 6.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-1.999999; 6.000000; 4.376923;,
2.000001; 6.000000; 4.376923;,
-1.999999; 8.000000; 4.376923;,
-1.999999; 6.000000; 4.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000000; 8.000000; 2.376923;,
-2.000000; 6.000000; 0.376923;,
-2.000000; 4.000000; 0.376923;,
2.000000; 3.999999; 0.376923;,
2.000000; 6.000000; 0.376923;,
-1.999999; 6.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
2.000000; 4.000000; 2.376923;,
-2.000000; 4.000000; 2.376923;,
-2.000000; 6.000000; 0.376923;,
2.000000; 6.000000; 0.376923;,
2.000001; 6.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
2.000000; 6.000000; 0.376923;,
2.000000; 3.999999; 0.376923;,
2.000000; 4.000000; 2.376923;,
2.000001; 6.000000; 2.376923;,
2.000000; 3.999999; 0.376923;,
-2.000000; 4.000000; 0.376923;,
-2.000000; 4.000000; 2.376923;,
2.000000; 4.000000; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000000; 4.000000; 2.376923;,
-2.000000; 4.000000; 0.376923;,
-2.000000; 6.000000; 0.376923;,
-6.000000; 4.000000; 2.376923;,
-6.000001;-7.999999; 2.376923;,
-4.000001;-8.000000; 2.376923;,
-4.000000; 4.000000; 2.376923;,
-6.000000; 4.000000; 4.376923;,
-4.000000; 3.999999; 4.376923;,
-4.000000;-7.999999; 4.376923;,
-6.000001;-8.000000; 4.376923;,
-6.000000; 4.000000; 2.376923;,
-4.000000; 4.000000; 2.376923;,
-4.000000; 3.999999; 4.376923;,
-6.000000; 4.000000; 4.376923;,
-4.000000; 4.000000; 2.376923;,
-4.000001;-8.000000; 2.376923;,
-4.000000;-7.999999; 4.376923;,
-4.000000; 3.999999; 4.376923;,
-4.000001;-8.000000; 2.376923;,
-6.000001;-7.999999; 2.376923;,
-6.000001;-8.000000; 4.376923;,
-4.000000;-7.999999; 4.376923;,
-4.000000; 6.000001; 0.376923;,
-4.000001;-8.000000; 0.376923;,
-2.000001;-8.000000; 0.376923;,
-2.000000; 6.000000; 0.376923;,
-4.000000; 6.000001; 0.376923;,
-2.000000; 6.000000; 0.376923;,
-1.999999; 6.000000; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-2.000000; 6.000000; 0.376923;,
-2.000001;-8.000000; 0.376923;,
-2.000001;-8.000002; 2.376923;,
-1.999999; 6.000000; 2.376923;,
-2.000001;-8.000000; 0.376923;,
-4.000001;-8.000000; 0.376923;,
-4.000001;-8.000000; 2.376923;,
-2.000001;-8.000002; 2.376923;,
-3.999999; 6.000001; 2.376923;,
-4.000001;-8.000000; 2.376923;,
-4.000001;-8.000000; 0.376923;,
-4.000000; 6.000001; 0.376923;;
60;
4;0,1,2,3;,
4;4,5,6,7;,
4;8,9,10,11;,
4;12,13,14,15;,
4;16,17,18,19;,
4;20,21,22,23;,
4;24,25,26,27;,
4;28,29,30,31;,
4;32,33,34,35;,
4;36,37,38,39;,
4;40,41,42,43;,
4;44,45,46,47;,
4;48,49,50,51;,
4;52,53,54,55;,
4;56,57,58,59;,
4;60,61,62,63;,
4;64,65,66,67;,
4;68,69,70,71;,
4;72,73,74,75;,
4;76,77,78,79;,
4;80,81,82,83;,
4;84,85,86,87;,
4;88,89,90,91;,
4;92,93,94,95;,
4;96,97,98,99;,
4;100,101,102,103;,
4;104,105,106,107;,
4;108,109,110,111;,
4;112,113,114,115;,
4;116,117,118,119;,
4;120,121,122,123;,
4;124,125,126,127;,
4;128,129,130,131;,
4;132,133,134,135;,
4;136,137,138,139;,
4;140,141,142,143;,
4;144,145,146,147;,
4;148,149,150,151;,
4;152,153,154,155;,
4;156,157,158,159;,
4;160,161,162,163;,
4;164,165,166,167;,
4;168,169,170,171;,
4;172,173,174,175;,
4;176,177,178,179;,
4;180,181,182,183;,
4;184,185,186,187;,
4;188,189,190,191;,
4;192,193,194,195;,
4;196,197,198,199;,
4;200,201,202,203;,
4;204,205,206,207;,
4;208,209,210,211;,
4;212,213,214,215;,
4;216,217,218,219;,
4;220,221,222,223;,
4;224,225,226,227;,
4;228,229,230,231;,
4;232,233,234,235;,
4;236,237,238,239;;
MeshNormals { // Cube_000 normals
60;
-1.000000; 0.000000; 0.000000;,
0.000000;-1.000000;-0.000000;,
1.000000;-0.000000; 0.000000;,
0.000000; 0.000000;-1.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000;-0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000001;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000; 0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
1.000000;-0.000001;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000001;-1.000000; 0.000000;,
-1.000000; 0.000001;-0.000000;,
-0.000000; 1.000000; 0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-1.000000;-0.000000; 0.000000;,
-0.000000; 1.000000;-0.000000;,
1.000000; 0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000;-0.000000;,
1.000000;-0.000000;-0.000000;,
0.000000; 0.000000; 1.000000;,
0.000000; 0.000000;-1.000000;,
-0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000000; 1.000000; 0.000000;,
0.000000; 0.000000; 1.000000;,
-0.000000;-1.000000;-0.000000;,
-1.000000; 0.000000; 0.000000;,
0.000001; 1.000000; 0.000001;,
1.000000;-0.000000;-0.000000;;
60;
4;0,0,0,0;,
4;1,1,1,1;,
4;2,2,2,2;,
4;3,3,3,3;,
4;4,4,4,4;,
4;5,5,5,5;,
4;6,6,6,6;,
4;7,7,7,7;,
4;8,8,8,8;,
4;9,9,9,9;,
4;10,10,10,10;,
4;11,11,11,11;,
4;12,12,12,12;,
4;13,13,13,13;,
4;14,14,14,14;,
4;15,15,15,15;,
4;16,16,16,16;,
4;17,17,17,17;,
4;18,18,18,18;,
4;19,19,19,19;,
4;20,20,20,20;,
4;21,21,21,21;,
4;22,22,22,22;,
4;23,23,23,23;,
4;24,24,24,24;,
4;25,25,25,25;,
4;26,26,26,26;,
4;27,27,27,27;,
4;28,28,28,28;,
4;29,29,29,29;,
4;30,30,30,30;,
4;31,31,31,31;,
4;32,32,32,32;,
4;33,33,33,33;,
4;34,34,34,34;,
4;35,35,35,35;,
4;36,36,36,36;,
4;37,37,37,37;,
4;38,38,38,38;,
4;39,39,39,39;,
4;40,40,40,40;,
4;41,41,41,41;,
4;42,42,42,42;,
4;43,43,43,43;,
4;44,44,44,44;,
4;45,45,45,45;,
4;46,46,46,46;,
4;47,47,47,47;,
4;48,48,48,48;,
4;49,49,49,49;,
4;50,50,50,50;,
4;51,51,51,51;,
4;52,52,52,52;,
4;53,53,53,53;,
4;54,54,54,54;,
4;55,55,55,55;,
4;56,56,56,56;,
4;57,57,57,57;,
4;58,58,58,58;,
4;59,59,59,59;;
} // End of Cube_000 normals
MeshTextureCoords { // Cube_000 UV coordinates
240;
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
2.000000; 0.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
7.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
5.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
5.000000;-1.000000;,
6.000000;-1.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
2.000000; 0.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
3.000000; 0.999999;,
0.000000; 1.000000;,
0.000000; 0.000001;,
3.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000001; 1.000000;,
0.000000;-4.000000;,
1.000000;-4.000000;,
1.000000;-3.000000;,
0.999999; 1.000000;,
0.000000; 1.000000;,
0.000000;-3.000000;,
4.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
4.000000;-1.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000;-1.000000;,
5.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-0.999999;,
5.000000;-1.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000;-1.000000;,
5.375000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
5.375000; 0.000000;,
5.375000; 0.000000;,
5.375000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
7.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000;-1.000000;,
1.000000;-1.000000;,
0.999999; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000001;,
2.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
1.000000;-1.000000;,
1.000000;-1.000000;,
0.999999; 1.000000;,
0.000000; 1.000000;,
0.000000;-1.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
2.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
2.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000001;,
2.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
7.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
6.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
6.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;,
1.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
1.000000; 0.000000;,
7.000000; 1.000000;,
0.000000; 1.000000;,
0.000000; 0.000000;,
7.000000; 0.000000;;
} // End of Cube_000 UV coordinates
MeshMaterialList { // Cube_000 material list
1;
60;
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0;;
Material Material {
0.640000; 0.640000; 0.640000; 1.000000;;
96.078431;
0.500000; 0.500000; 0.500000;;
0.000000; 0.000000; 0.000000;;
TextureFilename {"default_pine_wood.png";}
}
} // End of Cube_000 material list
} // End of Cube_000 mesh
} // End of Cube_000
} // End of Root

View File

@ -12,13 +12,6 @@ Also it changes the eating in Minetest, e.g. an Apple does not restore Health, b
Example: 1 apple fills up the hunger bar by 1 "bread" (statbar symbol).
Although the statbar show 20 hunger points (10 breads) on the HUD you can fill it up to 30 points.
By default it supports a lot of food already (see full list below) and food that for registered via the API.
For more information how to register more food see API.txt
Information:
This mod depends on the "Better HUD" mod (https://github.com/BlockMen/hud) to provide information about your current saturation.
For Modders:
~~~~~~~~~~~~
This mod alters the behavior of minetest.item_eat().
@ -28,6 +21,7 @@ will have changed already when callbacks are called. You can get the original it
License:
~~~~~~~~
(c) Copyright BlockMen (2015)
https://github.com/BlockMen/hunger
Code:
@ -42,73 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
See LICENSE.txt and http://www.gnu.org/licenses/lgpl-3.0.txt
Textures:
MultiCraft Project
Copyright (C) MultiCraft Development Team
Sound: WTFPL (see below)
See also:
http://minetest.net/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
Github:
~~~~~~~
https://github.com/BlockMen/hunger
Forum:
~~~~~~
-
Changelog:
~~~~~~~~~~
see changelog.txt
Dependencies:
~~~~~~~~~~~~~
- Default
- Farming
- Better HUD (https://github.com/BlockMen/hud)
Supported food/mods:
~~~~~~~~~~~~~~~~~~~~
- Apples (default)
- Animalmaterials (mobf modpack)
- Bread (default)
- Bushes
- bushes_classic
- Creatures
- Dwarves (beer and such)
- Docfarming
- Fishing
- Farming plus
- Farming (default and Tenplus1's fork)
- Food
- fruit
- Glooptest
- JKMod
- kpgmobs
- Mobfcooking
- Mooretrees
- Mtfoods
- mushroom
- mush45
- Seaplants (sea)
- Simple mobs
Sound: WTFPL

View File

@ -1,55 +1,53 @@
function spawn_tnt(pos, entname)
minetest.sound_play("", {pos = pos,gain = 1.0,max_hear_distance = 15,})
return minetest.add_entity(pos, entname)
minetest.sound_play("", {pos = pos,gain = 1.0,max_hear_distance = 15,})
return minetest.add_entity(pos, entname)
end
function activate_if_tnt(nname, np, tnt_np, tntr)
if nname == "tnt:tnt" then
local e = spawn_tnt(np, nname)
e:setvelocity({x=(np.x - tnt_np.x)*5+(tntr / 4), y=(np.y - tnt_np.y)*5+(tntr / 3), z=(np.z - tnt_np.z)*5+(tntr / 4)})
end
if nname == "tnt:tnt" then
local e = spawn_tnt(np, nname)
e:setvelocity({x=(np.x - tnt_np.x)*5+(tntr / 4), y=(np.y - tnt_np.y)*5+(tntr / 3), z=(np.z - tnt_np.z)*5+(tntr / 4)})
end
end
function do_tnt_physics(tnt_np,tntr)
local objs = minetest.get_objects_inside_radius(tnt_np, tntr)
for k, obj in pairs(objs) do
local oname = obj:get_luaentity()
local v = obj:get_velocity()
local p = obj:getpos()
if oname == "tnt:tnt" then
obj:setvelocity({x=(p.x - tnt_np.x) + (tntr / 2) + v.x, y=(p.y - tnt_np.y) + tntr + v.y, z=(p.z - tnt_np.z) + (tntr / 2) + v.z})
else
if v ~= nil then
obj:setvelocity({x=(p.x - tnt_np.x) + (tntr / 4) + v.x, y=(p.y - tnt_np.y) + (tntr / 2) + v.y, z=(p.z - tnt_np.z) + (tntr / 4) + v.z})
else
if obj:get_player_name() ~= nil then
obj:set_hp(obj:get_hp() - 1)
end
end
end
end
local objs = minetest.get_objects_inside_radius(tnt_np, tntr)
for k, obj in pairs(objs) do
local oname = obj:get_luaentity()
local v = obj:get_velocity()
local p = obj:getpos()
if oname == "tnt:tnt" then
obj:setvelocity({x=(p.x - tnt_np.x) + (tntr / 2) + v.x, y=(p.y - tnt_np.y) + tntr + v.y, z=(p.z - tnt_np.z) + (tntr / 2) + v.z})
else
if v ~= nil then
obj:setvelocity({x=(p.x - tnt_np.x) + (tntr / 4) + v.x, y=(p.y - tnt_np.y) + (tntr / 2) + v.y, z=(p.z - tnt_np.z) + (tntr / 4) + v.z})
else
if obj:get_player_name() ~= nil then
obj:set_hp(obj:get_hp() - 1)
end
end
end
end
end
minetest.register_node("tnt:tnt", {
tiles = {"default_tnt_top.png", "default_tnt_bottom.png",
"default_tnt_side.png", "default_tnt_side.png",
"default_tnt_side.png", "default_tnt_side.png"},
drop = '', -- Get nothing
material = {
diggability = "not",
},
stack_max = 64,
description = "TNT",
groups = {mese = 1},
mesecons = {effector = {
action_on = (function(p, node)
minetest.remove_node(p)
spawn_tnt(p, "tnt:tnt")
nodeupdate(p)
end),
}},
tiles = {"default_tnt_top.png", "default_tnt_bottom.png",
"default_tnt_side.png", "default_tnt_side.png",
"default_tnt_side.png", "default_tnt_side.png"},
drop = "", -- Get nothing
material = {
diggability = "not",
},
stack_max = 64,
description = "TNT",
groups = {mese = 1},
mesecons = {effector = {
action_on = (function(p, node)
minetest.remove_node(p)
spawn_tnt(p, "tnt:tnt")
nodeupdate(p)
end),
}},
on_ignite = function(pos, igniter)
minetest.remove_node(pos)
spawn_tnt(pos, "tnt:tnt")
@ -58,11 +56,11 @@ minetest.register_node("tnt:tnt", {
})
minetest.register_on_punchnode(function(p, node)
if node.name == "tnt:tnt" then
minetest.remove_node(p)
spawn_tnt(p, "tnt:tnt")
nodeupdate(p)
end
if node.name == "tnt:tnt" then
minetest.remove_node(p)
spawn_tnt(p, "tnt:tnt")
nodeupdate(p)
end
end)
minetest.register_abm({
@ -80,64 +78,64 @@ minetest.register_abm({
local TNT_RANGE = 3
local TNT = {
-- Static definition
physical = true, -- Collides with things
--weight = -100,
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
visual = "cube",
textures = {"default_tnt_top.png", "default_tnt_bottom.png",
"default_tnt_side.png", "default_tnt_side.png",
"default_tnt_side.png", "default_tnt_side.png"},
-- Initial value for our timer
timer = 0,
-- Number of punches required to defuse
health = 1,
blinktimer = 0,
blinkstatus = true,}
-- Static definition
physical = true, -- Collides with things
--weight = -100,
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
visual = "cube",
textures = {"default_tnt_top.png", "default_tnt_bottom.png",
"default_tnt_side.png", "default_tnt_side.png",
"default_tnt_side.png", "default_tnt_side.png"},
-- Initial value for our timer
timer = 0,
-- Number of punches required to defuse
health = 1,
blinktimer = 0,
blinkstatus = true,}
function TNT:on_activate(staticdata)
self.object:setvelocity({x=0, y=4, z=0})
self.object:setacceleration({x=0, y=-10, z=0})
self.object:settexturemod("^[brighten")
self.object:setvelocity({x=0, y=4, z=0})
self.object:setacceleration({x=0, y=-10, z=0})
self.object:settexturemod("^[brighten")
end
function TNT:on_step(dtime)
local pos = self.object:getpos()
minetest.add_particle({x=pos.x,y=pos.y+0.5,z=pos.z}, {x=math.random(-.1,.1),y=math.random(1,2),z=math.random(-.1,.1)}, {x=0,y=-0.1,z=0}, math.random(.5,1),math.random(1,2), false, "item_smoke.png")
self.timer = self.timer + dtime
self.blinktimer = self.blinktimer + dtime
if self.timer>3 then
self.blinktimer = self.blinktimer + dtime
if self.timer>5 then
self.blinktimer = self.blinktimer + dtime
self.blinktimer = self.blinktimer + dtime
end
end
local pos = self.object:getpos()
minetest.add_particle({x=pos.x,y=pos.y+0.5,z=pos.z}, {x=math.random(-.1,.1),y=math.random(1,2),z=math.random(-.1,.1)}, {x=0,y=-0.1,z=0}, math.random(.5,1),math.random(1,2), false, "item_smoke.png")
self.timer = self.timer + dtime
self.blinktimer = self.blinktimer + dtime
if self.timer>3 then
self.blinktimer = self.blinktimer + dtime
if self.timer>5 then
self.blinktimer = self.blinktimer + dtime
self.blinktimer = self.blinktimer + dtime
end
end
if self.blinktimer > 0.5 then
self.blinktimer = self.blinktimer - 0.5
if self.blinkstatus then
self.object:settexturemod("")
else
self.object:settexturemod("^[brighten")
end
self.blinkstatus = not self.blinkstatus
self.blinktimer = self.blinktimer - 0.5
if self.blinkstatus then
self.object:settexturemod("")
else
self.object:settexturemod("^[brighten")
end
self.blinkstatus = not self.blinkstatus
end
if self.timer > 8 then
local pos = self.object:getpos()
pos.x = math.floor(pos.x+0.5)
pos.y = math.floor(pos.y+0.5)
pos.z = math.floor(pos.z+0.5)
do_tnt_physics(pos, TNT_RANGE)
local meta = minetest.get_meta(pos)
minetest.sound_play("tnt_explode", {pos = pos,gain = 1.0,max_hear_distance = 16,})
pos.x = math.floor(pos.x+0.5)
pos.y = math.floor(pos.y+0.5)
pos.z = math.floor(pos.z+0.5)
do_tnt_physics(pos, TNT_RANGE)
local meta = minetest.get_meta(pos)
minetest.sound_play("tnt_explode", {pos = pos,gain = 1.0,max_hear_distance = 16,})
local nn = core.get_node(pos).name
if nn == "default:water_source" or nn == "default:water_flowing" or
if nn == "default:water_source" or nn == "default:water_flowing" or
nn == "default:bedrock" or nn == "protector:display" or
nn == "ignore" or core.is_protected(pos, "tnt") then
-- Cancel the Explosion
self.object:remove()
return
end
-- Cancel the Explosion
self.object:remove()
return
end
for x=-TNT_RANGE,TNT_RANGE do
for y=-TNT_RANGE,TNT_RANGE do
for z=-TNT_RANGE,TNT_RANGE do
@ -169,20 +167,20 @@ function TNT:on_step(dtime)
end
function TNT:on_punch(hitter)
self.health = self.health - 1
if self.health <= 0 then
self.object:remove()
hitter:get_inventory():add_item("main", "tnt:tnt")
end
self.health = self.health - 1
if self.health <= 0 then
self.object:remove()
hitter:get_inventory():add_item("main", "tnt:tnt")
end
end
minetest.register_entity("tnt:tnt", TNT)
minetest.register_craft({
output = "tnt:tnt",
recipe = {
{'default:gunpowder','default:sand','default:gunpowder'},
{'default:sand','default:gunpowder','default:sand'},
{'default:gunpowder','default:sand','default:gunpowder'}
}
output = "tnt:tnt",
recipe = {
{"default:gunpowder","default:sand","default:gunpowder"},
{"default:sand","default:gunpowder","default:sand"},
{"default:gunpowder","default:sand","default:gunpowder"}
}
})