diff --git a/mods/ENTITIES/extra_mobs/strider.lua b/mods/ENTITIES/extra_mobs/strider.lua index 1847161565..6796bdca21 100644 --- a/mods/ENTITIES/extra_mobs/strider.lua +++ b/mods/ENTITIES/extra_mobs/strider.lua @@ -190,9 +190,6 @@ local strider = { inv:set_stack("main",self.driver:get_wield_index(), wielditem) end return - - elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then - mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) end end, } diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index eda74aeb42..0e4810b0fd 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -502,20 +502,6 @@ and damages any entity caught inside the blast radius. Protection will limit node destruction but not entity damage. -mobs:capture_mob ----------------- - -mobs:capture_mob(...) - -Does nothing and returns false. - -This function is provided for compability with Mobs Redo for an attempt to -capture a mob. -Mobs cannot be captured in MineClone 2. - -In Mobs Redo, this is generally called inside the on_rightclick section of the mob -api code, it provides a chance of capturing the mob. See Mobs Redo documentation -of parameters. Feeding and Taming/Breeding --------------------------- @@ -781,8 +767,5 @@ mobs:register_mob("mob_horse:horse", { inv:remove_item("main", "mobs:saddle") end end - - -- used to capture horse with magic lasso - mobs:capture_mob(self, clicker, 0, 0, 80, false, nil) end }) 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 292a27ec0d..d7b2291479 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,13 +112,6 @@ function mobs:spawn_child(pos, mob_type) end --- No-op in MCL2 (capturing mobs is not possible). --- Provided for compability with Mobs Redo -function mobs:capture_mob(self, clicker, chance_hand, chance_net, chance_lasso, force_take, replacewith) - return false -end - - -- No-op in MCL2 (protecting mobs is not possible). function mobs:protect(self, clicker) return false diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua index b996867cf8..490ae85182 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/interaction.lua @@ -1,5 +1,10 @@ +mobs.feed_tame = function(self) + return nil +end + -- Code to execute before custom on_rightclick handling local on_rightclick_prefix = function(self, clicker) + local item = clicker:get_wielded_item() -- Name mob with nametag @@ -32,8 +37,4 @@ mobs.create_mob_on_rightclick = function(on_rightclick) on_rightclick(self, clicker) end end -end - -mobs.feed_tame = function(self) - return nil end \ No newline at end of file diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/movement.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/movement.lua index 1ff7809512..f983734ebe 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/movement.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/movement.lua @@ -11,6 +11,9 @@ local vector_multiply = vector.multiply local minetest_yaw_to_dir = minetest.yaw_to_dir +local DEFAULT_JUMP_HEIGHT = 5 +local DEFAULT_FLOAT_SPEED = 4 + --this is a generic float function @@ -20,7 +23,7 @@ mobs.float = function(self) local goal_velocity = { x = 0, - y = 5, + y = DEFAULT_FLOAT_SPEED, z = 0, } @@ -102,7 +105,7 @@ mobs.jump = function(self, velocity) end --fallback velocity to allow modularity - velocity = velocity or 8 + velocity = velocity or DEFAULT_JUMP_HEIGHT self.object:add_velocity(vector_new(0,velocity,0)) end @@ -133,7 +136,7 @@ mobs.flop = function(self, velocity) mobs.set_velocity(self, 0) --fallback velocity to allow modularity - velocity = velocity or 8 + velocity = velocity or DEFAULT_JUMP_HEIGHT --create a random direction (2d yaw) local dir = DOUBLE_PI * math_random() @@ -256,7 +259,7 @@ mobs.jump_move = function(self, velocity) mobs.set_velocity(self,0) --fallback velocity to allow modularity - jump_height = 8 + jump_height = DEFAULT_JUMP_HEIGHT local yaw = (self.yaw or 0) diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua index 8be3019f6b..3d7ba8606e 100644 --- a/mods/ENTITIES/mobs_mc/chicken.lua +++ b/mods/ENTITIES/mobs_mc/chicken.lua @@ -70,7 +70,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 - if mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) 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 be4cceea37..9ad7b2a182 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -71,7 +71,6 @@ local cow_def = { end return end - mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) end, follow = mobs_mc.items.wheat, view_range = 10, @@ -139,8 +138,7 @@ mooshroom_def.on_rightclick = function(self, clicker) pos.y = pos.y + 0.5 minetest.add_item(pos, {name = mobs_mc.items.mushroom_stew}) end - end - mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) + end end mobs:register_mob("mobs_mc:mooshroom", mooshroom_def) diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 938a6b6ace..b9d79a0752 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -355,10 +355,7 @@ local horse = { self.object:set_properties({stepheight = 1.1}) mobs.attach(self, clicker) - - -- Used to capture horse - elseif not self.driver and iname ~= "" then - mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) + end end end, diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 8ff82b502a..5951f9dffb 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -182,10 +182,7 @@ mobs:register_mob("mobs_mc:llama", { self.object:set_properties({stepheight = 1.1}) mobs.attach(self, clicker) end - - -- Used to capture llama - elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then - mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) + end end, diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index f3c8c87ae1..139b687853 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:capture_mob(self, clicker, 0, 60, 5, false, nil) 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 81d19d5d46..06a2dc18ba 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -86,7 +86,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 - if mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) then return end end, }) diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index b7cdf1afe9..da7e686ada 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -163,10 +163,6 @@ mobs:register_mob("mobs_mc:pig", { inv:set_stack("main",self.driver:get_wield_index(), wielditem) end return - - -- Capture pig - elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then - mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) end end, diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 74bdffcd80..0f67bb7d7c 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -62,7 +62,6 @@ local rabbit = { -- 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 - if mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) 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 d82df8cf9d..8ba8aecd8f 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -251,7 +251,6 @@ mobs:register_mob("mobs_mc:sheep", { end return end - if mobs:capture_mob(self, clicker, 0, 5, 70, false, nil) then return end end, on_breed = function(parent1, parent2) -- Breed sheep and choose a fur color for the child. diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index b1c077d465..319a4f9594 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -149,8 +149,6 @@ dog.on_rightclick = function(self, clicker) if mobs:protect(self, clicker) then return - elseif item:get_name() ~= "" and mobs:capture_mob(self, clicker, 0, 2, 80, false, nil) then - return elseif is_food(item:get_name()) then -- Feed to increase health local hp = self.health