Update deprecated methods and move x_default to optional dependencies
This commit is contained in:
parent
6676b6a3f8
commit
f30395040c
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
.DS_Store
|
||||
docs/build
|
||||
*.blend1
|
||||
*.blend2
|
||||
*.old
|
||||
node_modules
|
||||
*.log
|
||||
logs
|
||||
*.mtl
|
@ -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()
|
||||
|
@ -1,5 +1,5 @@
|
||||
default
|
||||
x_default
|
||||
x_default?
|
||||
xpanes?
|
||||
fire?
|
||||
mobs?
|
||||
|
@ -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,
|
||||
|
BIN
spawners_mobs/screenshot.2.jpg
Normal file
BIN
spawners_mobs/screenshot.2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 522 KiB |
@ -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
|
||||
})
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user