diff --git a/mods/ENTITIES/extra_mobs/strider.lua b/mods/ENTITIES/extra_mobs/strider.lua index 6796bdca21..d6c8542077 100644 --- a/mods/ENTITIES/extra_mobs/strider.lua +++ b/mods/ENTITIES/extra_mobs/strider.lua @@ -124,7 +124,6 @@ local strider = { if wielditem:get_name() ~= controlitem then if mobs:feed_tame(self, clicker, 1, true, true) then return end end - if mobs:protect(self, clicker) then return end if self.child then return diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index 0e4810b0fd..5d49ca7efa 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -521,19 +521,6 @@ Will return true when mob is fed with item it likes. them up -Protecting Mobs ---------------- - -mobs:protect(self, clicker) - -This function can be used to right-click any tamed mob with mobs:protector item, -this will protect the mob from harm inside of a protected area from other -players. Will return true when mob right-clicked with mobs:protector item. - - 'self' mob information - 'clicker' player information - - Riding Mobs ----------- diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/backup_code_api.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/backup_code_api.lua index d7b2291479..2c1ba19832 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/backup_code_api.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/backup_code_api.lua @@ -112,11 +112,6 @@ function mobs:spawn_child(pos, mob_type) end --- No-op in MCL2 (protecting mobs is not possible). -function mobs:protect(self, clicker) - return false -end - -- feeding, taming and breeding (thanks blert2112) function mobs:feed_tame(self, clicker, feed_count, breed, tame) diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua index 3d7ba8606e..2fe82293e3 100644 --- a/mods/ENTITIES/mobs_mc/chicken.lua +++ b/mods/ENTITIES/mobs_mc/chicken.lua @@ -69,7 +69,6 @@ mobs:register_mob("mobs_mc:chicken", { on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 1, true, true) then return end - if mobs:protect(self, clicker) then return end end, do_custom = function(self, dtime) diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index 9ad7b2a182..59b80ecb92 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -50,7 +50,6 @@ local cow_def = { follow = mobs_mc.follow.cow, on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 1, true, true) then return end - if mobs:protect(self, clicker) then return end if self.child then return @@ -86,7 +85,6 @@ mooshroom_def.mesh = "mobs_mc_cow.b3d" mooshroom_def.textures = { {"mobs_mc_mooshroom.png", "mobs_mc_mushroom_red.png"}, {"mobs_mc_mooshroom_brown.png", "mobs_mc_mushroom_brown.png" } } mooshroom_def.on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 1, true, true) then return end - if mobs:protect(self, clicker) then return end if self.child then return diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index b9d79a0752..0e0246d4e4 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -281,10 +281,6 @@ local horse = { return end - if mobs:protect(self, clicker) then - return - end - -- Make sure tamed horse is mature and being clicked by owner only if self.tamed and not self.child and self.owner == clicker:get_player_name() then @@ -355,7 +351,7 @@ local horse = { self.object:set_properties({stepheight = 1.1}) mobs.attach(self, clicker) - + end end end, diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 5951f9dffb..e0c353ad8b 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -133,7 +133,6 @@ mobs:register_mob("mobs_mc:llama", { -- Feed with anything else if mobs:feed_tame(self, clicker, 1, false, true) then return end end - if mobs:protect(self, clicker) then return end -- Make sure tamed llama is mature and being clicked by owner only if self.tamed and not self.child and self.owner == clicker:get_player_name() then @@ -182,7 +181,7 @@ mobs:register_mob("mobs_mc:llama", { self.object:set_properties({stepheight = 1.1}) mobs.attach(self, clicker) end - + end end, diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index 139b687853..bb62a54fab 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -121,7 +121,6 @@ cat.sounds = { } cat.on_rightclick = function(self, clicker) if mobs:feed_tame(self, clicker, 1, true, false) then return end - if mobs:protect(self, clicker) then return end if self.child then return end diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index 06a2dc18ba..ef82884aa6 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -85,7 +85,6 @@ mobs:register_mob("mobs_mc:parrot", { -- Feed to tame, but not breed if mobs:feed_tame(self, clicker, 1, false, true) then return end - if mobs:protect(self, clicker) then return end end, }) diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index da7e686ada..2751a8bebd 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -95,7 +95,6 @@ mobs:register_mob("mobs_mc:pig", { if wielditem:get_name() ~= mobs_mc.items.carrot_on_a_stick then if mobs:feed_tame(self, clicker, 1, true, true) then return end end - if mobs:protect(self, clicker) then return end if self.child then return diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 0f67bb7d7c..a7d5d02d95 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -61,7 +61,6 @@ local rabbit = { on_rightclick = function(self, clicker) -- Feed, tame protect or capture if mobs:feed_tame(self, clicker, 1, true, true) then return end - if mobs:protect(self, clicker) then return end end, do_custom = function(self) -- Easter egg: Change texture if rabbit is named “Toast” diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 8ba8aecd8f..e6368a3f8a 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -195,7 +195,6 @@ mobs:register_mob("mobs_mc:sheep", { local item = clicker:get_wielded_item() if mobs:feed_tame(self, clicker, 1, true, true) then return end - if mobs:protect(self, clicker) then return end if item:get_name() == mobs_mc.items.shears and not self.gotten and not self.child then self.gotten = true diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index 319a4f9594..00a41b6855 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -147,9 +147,7 @@ dog.specific_attack = nil dog.on_rightclick = function(self, clicker) local item = clicker:get_wielded_item() - if mobs:protect(self, clicker) then - return - elseif is_food(item:get_name()) then + if is_food(item:get_name()) then -- Feed to increase health local hp = self.health local hp_add = 0