Rename mcl_monster_spawners to mcl_mobspawners.

Sorry for the trouble, but the long name annoyed me. :P
This commit is contained in:
Wuzzy 2017-05-25 06:09:03 +02:00
parent 6b07bde2e8
commit c1c15eb60b
14 changed files with 19 additions and 19 deletions

View file

@ -192,7 +192,7 @@ mesecon:register_mvps_stopper("mcl_anvils:anvil")
mesecon:register_mvps_stopper("mcl_anvils:anvil_damage_1")
mesecon:register_mvps_stopper("mcl_anvils:anvil_damage_2")
mesecon:register_mvps_stopper("mcl_jukebox:jukebox")
mesecon:register_mvps_stopper("mcl_monster_spawners:spawner")
mesecon:register_mvps_stopper("mcl_mobspawners:spawner")
mesecon:register_mvps_stopper("signs:sign_yard")
mesecon:register_mvps_stopper("signs:sign_wall")
mesecon:register_mvps_stopper("mesecons_commandblock:commandblock_off")

View file

@ -10,7 +10,7 @@ placing.
## Programmer notes
To set the mob spawned by a monster spawner, first place the monster spawner
(e.g. with `minetest.set_node`), then use the function
`mcl_monster_spawner.setup_spawner` to set its attributes. See the comment
`mcl_mobspawners.setup_spawner` to set its attributes. See the comment
in `init.lua` for more info.
## License (code and texture)

View file

@ -1,6 +1,6 @@
local S = mobs.intllib
mcl_monster_spawners = {}
mcl_mobspawners = {}
local default_mob = "mobs_mc:pig"
@ -15,7 +15,7 @@ end
local function find_doll(pos)
for _,obj in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do
if not obj:is_player() then
if obj ~= nil and obj:get_luaentity().name == "mcl_monster_spawners:doll" then
if obj ~= nil and obj:get_luaentity().name == "mcl_mobspawners:doll" then
return obj
end
end
@ -52,7 +52,7 @@ All the arguments are optional!
* YOffset: Y offset to spawn mobs; 0 to disable (default: 0)
]]
function mcl_monster_spawners.setup_spawner(pos, Mob, MinLight, MaxLight, MaxMobsInArea, PlayerDistance, YOffset)
function mcl_mobspawners.setup_spawner(pos, Mob, MinLight, MaxLight, MaxMobsInArea, PlayerDistance, YOffset)
-- Activate monster spawner and disable editing functionality
if Mob == nil then Mob = default_mob end
if MinLight == nil then MinLight = 0 end
@ -69,7 +69,7 @@ function mcl_monster_spawners.setup_spawner(pos, Mob, MinLight, MaxLight, MaxMob
meta:set_int("YOffset", YOffset)
-- Create doll
local doll = minetest.add_entity({x=pos.x, y=pos.y-0.3, z=pos.z}, "mcl_monster_spawners:doll")
local doll = minetest.add_entity({x=pos.x, y=pos.y-0.3, z=pos.z}, "mcl_mobspawners:doll")
set_doll_properties(doll, Mob)
-- Start spawning very soon
@ -183,7 +183,7 @@ local spawn_monsters = function(pos, elapsed)
end
minetest.register_node("mcl_monster_spawners:spawner", {
minetest.register_node("mcl_mobspawners:spawner", {
tiles = {"mob_spawner.png"},
drawtype = "glasslike",
paramtype = "light",
@ -195,7 +195,7 @@ minetest.register_node("mcl_monster_spawners:spawner", {
is_ground_content = false,
drop = "",
on_construct = mcl_monster_spawners.setup_spawner,
on_construct = mcl_mobspawners.setup_spawner,
on_destruct = function(pos)
local meta = minetest.get_meta(pos)
@ -236,7 +236,7 @@ minetest.register_node("mcl_monster_spawners:spawner", {
and pla and pla >=0 and pla <= 20
and yof and yof > -10 and yof < 10 then
mcl_monster_spawners.setup_spawner(pos, mob, mlig, xlig, num, pla, yof)
mcl_mobspawners.setup_spawner(pos, mob, mlig, xlig, num, pla, yof)
else
minetest.chat_send_player(name, S("Mob Spawner settings failed!"))
minetest.chat_send_player(name,
@ -283,7 +283,7 @@ doll_def.on_step = function(self, dtime)
self.timer = self.timer + 0.01
local n = minetest.get_node_or_nil(self.object:getpos())
if self.timer > 1 then
if n and n.name and n.name ~= "mcl_monster_spawners:spawner" then
if n and n.name and n.name ~= "mcl_mobspawners:spawner" then
self.object:remove()
end
end
@ -291,7 +291,7 @@ end
doll_def.on_punch = function(self, hitter) end
minetest.register_entity("mcl_monster_spawners:doll", doll_def)
minetest.register_entity("mcl_mobspawners:doll", doll_def)

View file

@ -0,0 +1 @@
name = mcl_mobspawners

View file

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 261 B

Before After
Before After

View file

@ -1 +0,0 @@
name = mcl_monster_spawners

View file

@ -79,7 +79,7 @@ mcl_torches.register_torch = function(substring, description, doc_items_longdesc
-- * Piston
-- * Sticky piston
if not def.buildable_to then
if node.name ~= "mcl_nether:soul_sand" and node.name ~= "mcl_monster_spawners:spawner" and
if node.name ~= "mcl_nether:soul_sand" and node.name ~= "mcl_mobspawners:spawner" and
((not def.groups.solid) or (not def.groups.opaque)) then
-- Only allow top placement on these nodes
if def.groups.glass or node.name == "mcl_hoppers:hopper" or node.name == "mcl_hoppers:hopper_side" or def.groups.fence or def.groups.wall then