diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90328e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +docs/build +*.blend1 +*.blend2 +*.old +node_modules +*.log +logs +*.mtl diff --git a/spawners_env/spawners_env.lua b/spawners_env/spawners_env.lua index 875af3e..9943a58 100644 --- a/spawners_env/spawners_env.lua +++ b/spawners_env/spawners_env.lua @@ -23,15 +23,15 @@ function spawners_env.create(mob_name, mod_prefix, size, offset, mesh, texture, } dummy_definition.on_activate = function(self) - self.object:setvelocity({x=0, y=0, z=0}) - self.object:setacceleration({x=0, y=0, z=0}) + self.object:set_velocity({x=0, y=0, z=0}) + self.object:set_acceleration({x=0, y=0, z=0}) self.object:set_armor_groups({immortal=1}) end -- remove dummy after dug up the spawner dummy_definition.on_step = function(self, dtime) self.timer = self.timer + dtime - local n = minetest.get_node_or_nil(self.object:getpos()) + local n = minetest.get_node_or_nil(self.object:get_pos()) if self.timer > 2 then if n and n.name and n.name ~= "spawners_env:"..mod_prefix.."_"..mob_name.."_spawner_active" then self.object:remove() diff --git a/spawners_mobs/depends.txt b/spawners_mobs/depends.txt index 48063c9..1db7139 100644 --- a/spawners_mobs/depends.txt +++ b/spawners_mobs/depends.txt @@ -1,5 +1,5 @@ default -x_default +x_default? xpanes? fire? mobs? diff --git a/spawners_mobs/mob_balrog.lua b/spawners_mobs/mob_balrog.lua index 2952dbb..79e9ea3 100644 --- a/spawners_mobs/mob_balrog.lua +++ b/spawners_mobs/mob_balrog.lua @@ -146,7 +146,7 @@ local balrog_def = { local player_hp = object:get_hp() -- is in MMO Arena & health check - if x_default:isInMMOArena(player_pos) and player_hp > 0 then + if minetest.global_exists('x_default') and x_default:isInMMOArena(player_pos) and player_hp > 0 then -- play sound minetest.sound_play("spawners_mobs_teleport", { object = object, diff --git a/spawners_mobs/screenshot.2.jpg b/spawners_mobs/screenshot.2.jpg new file mode 100644 index 0000000..7e4efe4 Binary files /dev/null and b/spawners_mobs/screenshot.2.jpg differ diff --git a/spawners_mobs/spawners_mobs.lua b/spawners_mobs/spawners_mobs.lua index cad0a2c..9237ac5 100644 --- a/spawners_mobs/spawners_mobs.lua +++ b/spawners_mobs/spawners_mobs.lua @@ -24,8 +24,8 @@ function spawners_mobs.create(mob_table, idx) static_save = false, on_activate = function(self, staticdata, dtime_s) - self.object:setvelocity({x = 0, y = 0, z = 0}) - self.object:setacceleration({x = 0, y = 0, z = 0}) + self.object:set_velocity({x = 0, y = 0, z = 0}) + self.object:set_acceleration({x = 0, y = 0, z = 0}) self.object:set_armor_groups({immortal = 1}) end }) diff --git a/spawners_ores/spawners_ores.lua b/spawners_ores/spawners_ores.lua index 58f99bc..21e38d5 100644 --- a/spawners_ores/spawners_ores.lua +++ b/spawners_ores/spawners_ores.lua @@ -1,6 +1,6 @@ --- +-- -- Colorize HEX --- +-- local colorize = { stone_with_gold = "^[colorize:#ffe40033", @@ -9,9 +9,9 @@ local colorize = { stone_with_copper = "^[colorize:#b5875240", } --- +-- -- Handle formspec and inventory management --- +-- local function allow_metadata_inventory_put(pos, listname, index, stack, player) @@ -57,9 +57,9 @@ local function on_metadata_inventory_take(pos) minetest.get_node_timer(pos):start(1.0) end --- +-- -- Spawners Ores creation function --- +-- function spawners_ores.create(def) @@ -89,15 +89,15 @@ function spawners_ores.create(def) local ore = string.split(ore_name, "_") dummy_ore_definition.on_activate = function(self) - self.object:setvelocity({x=0, y=0, z=0}) - self.object:setacceleration({x=0, y=0, z=0}) + self.object:set_velocity({x=0, y=0, z=0}) + self.object:set_acceleration({x=0, y=0, z=0}) self.object:set_armor_groups({immortal=1}) end -- remove dummy after dug up the spawner dummy_ore_definition.on_step = function(self, dtime) self.timer = self.timer + dtime - local n = minetest.get_node_or_nil(self.object:getpos()) + local n = minetest.get_node_or_nil(self.object:get_pos()) if self.timer > 2 then if n and n.name and n.name ~= "spawners_ores:"..ore_name.."_spawner_active" and n.name ~= "spawners_ores:"..ore_name.."_spawner_waiting" and n.name ~= "spawners_ores:"..ore_name.."_spawner" then self.object:remove() @@ -132,11 +132,11 @@ function spawners_ores.create(def) is_ground_content = true, groups = {cracky=1,level=2,igniter=1,not_in_creative_inventory=1}, drop = "spawners_ores:"..ore_name.."_spawner", - + can_dig = spawners_ores.can_dig, - + on_timer = spawners_ores.on_timer, - + on_blast = function(pos) local drops = {} default.get_inventory_drops(pos, "fuel", drops) @@ -174,9 +174,9 @@ function spawners_ores.create(def) is_ground_content = true, groups = {cracky=1,level=2,not_in_creative_inventory=1}, drop = "spawners_ores:"..ore_name.."_spawner_waiting", - + can_dig = spawners_ores.can_dig, - + on_timer = spawners_ores.on_timer, on_blast = function(pos) @@ -186,7 +186,7 @@ function spawners_ores.create(def) minetest.remove_node(pos) return drops end, - + on_receive_fields = function(pos, formname, fields, sender) if fields.restart then local meta = minetest.get_meta(pos) @@ -215,9 +215,9 @@ function spawners_ores.create(def) is_ground_content = true, groups = {cracky = 1, level = 2}, stack_max = 1, - + can_dig = spawners_ores.can_dig, - + on_timer = spawners_ores.on_timer, on_construct = function(pos) @@ -252,7 +252,7 @@ function spawners_ores.create(def) local meta = minetest.get_meta(pos) meta:set_string("owner", placer:get_player_name()) end, - + on_metadata_inventory_put = on_metadata_inventory_put, on_metadata_inventory_take = on_metadata_inventory_take, allow_metadata_inventory_put = allow_metadata_inventory_put, @@ -271,9 +271,9 @@ function spawners_ores.create(def) }) end --- +-- -- Ore Spawners Definitions --- +-- -- default:stone_with_gold spawners_ores.create({ @@ -303,9 +303,9 @@ spawners_ores.create({ offset = 0 }) --- +-- -- Recipes --- +-- minetest.register_craft({ output = "spawners_ores:stone_with_gold_spawner",