1
0
Fork 0

Remove mobs.is_creative

This commit is contained in:
Lizzy Fleckenstein 2022-05-25 13:32:12 +02:00 committed by cora
parent d3afccad64
commit fc3992ceb6
1 changed files with 4 additions and 11 deletions

View File

@ -33,13 +33,6 @@ if minetest.global_exists("invisibility") then
mobs.invis = invisibility mobs.invis = invisibility
end end
-- creative check
function mobs.is_creative(name)
return minetest.is_creative_enabled(name)
end
-- localize math functions -- localize math functions
local pi = math.pi local pi = math.pi
local sin = math.sin local sin = math.sin
@ -3859,7 +3852,7 @@ local on_rightclick_prefix = function(self, clicker)
update_tag(self) update_tag(self)
if not mobs.is_creative(clicker:get_player_name()) then if not minetest.is_creative_enabled(clicker:get_player_name()) then
item:take_item() item:take_item()
clicker:set_wielded_item(item) clicker:set_wielded_item(item)
end end
@ -4299,7 +4292,7 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
return itemstack return itemstack
end end
mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name()) mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name())
if not mobs.is_creative(name) then if not minetest.is_creative_enabled(name) then
itemstack:take_item() itemstack:take_item()
end end
return itemstack return itemstack
@ -4339,7 +4332,7 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
end end
-- if not in creative then take item -- if not in creative then take item
if not mobs.is_creative(placer:get_player_name()) then if not minetest.is_creative_enabled(placer:get_player_name()) then
itemstack:take_item() itemstack:take_item()
end end
end end
@ -4374,7 +4367,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
if self.nofollow or follow_holding(self, clicker) then if self.nofollow or follow_holding(self, clicker) then
-- if not in creative then take item -- if not in creative then take item
if not mobs.is_creative(clicker:get_player_name()) then if not minetest.is_creative_enabled(clicker:get_player_name()) then
local item = clicker:get_wielded_item() local item = clicker:get_wielded_item()