diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua index f71018aba..0f7470ac9 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua @@ -160,7 +160,7 @@ mobs.make_baby_grow_faster = function(self,clicker) local stack = clicker:get_wielded_item() --safety check if not stack then - return + return(false) end local item_name = stack:get_name() @@ -172,6 +172,10 @@ mobs.make_baby_grow_faster = function(self,clicker) stack:take_item() clicker:set_wielded_item(stack) end + + return(true) end end + + return(false) end \ No newline at end of file diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 3099f0f09..d030f4b36 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -219,18 +219,17 @@ local horse = { local heal = 0 --sneak click to breed the horse/feed it - if self.owner and self.owner == clicker:get_player_name() and clicker:get_player_control().sneak then + if self.owner and self.owner == clicker:get_player_name() then --attempt to enter breed state if mobs.enter_breed_state(self,clicker) then return end + end - --make baby grow faster - if self.baby then - mobs.make_baby_grow_faster(self,clicker) - return - end - + --don't do any other logic with the baby + --make baby grow faster + if self.baby then + mobs.make_baby_grow_faster(self,clicker) return end diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index c39663528..5a8fdd70c 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -138,34 +138,71 @@ mobs:register_mob("mobs_mc:llama", { return end - if clicker:get_player_control().sneak then - --attempt to enter breed state - if mobs.enter_breed_state(self,clicker) then - return - end + --owner is broken for this + --we'll make the owner this guy + --attempt to enter breed state + if mobs.enter_breed_state(self,clicker) then + self.tamed = true + self.owner = clicker:get_player_name() + return + end - --make baby grow faster - if self.baby then - mobs.make_baby_grow_faster(self,clicker) - return - end + --ignore other logic + --make baby grow faster + if self.baby then + mobs.make_baby_grow_faster(self,clicker) + 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 + local item = clicker:get_wielded_item() + --safety catch + if not item then + return + end + + + + --put chest on carpeted llama + if self.carpet and not self.chest and item:get_name() == "mcl_chests:chest" then + if not minetest.is_creative_enabled(clicker:get_player_name()) then + item:take_item() + clicker:set_wielded_item(item) + end + + self.base_texture = table.copy(self.base_texture) + self.base_texture[1] = "mobs_mc_llama_chest.png" + self.object:set_properties({ + textures = self.base_texture, + }) + self.chest = true + + return --don't attempt to ride + end + + -- Place carpet - --[[ TODO: Re-enable this code when carpet textures arrived. - if minetest.get_item_group(item:get_name(), "carpet") == 1 and not self.carpet then + --TODO: Re-enable this code when carpet textures arrived. + if minetest.get_item_group(item:get_name(), "carpet") == 1 then + for group, carpetdata in pairs(carpets) do if minetest.get_item_group(item:get_name(), group) == 1 then if not minetest.is_creative_enabled(clicker:get_player_name()) then item:take_item() clicker:set_wielded_item(item) + + --shoot off old carpet + if self.carpet then + minetest.add_item(self.object:get_pos(), self.carpet) + end end + local substr = carpetdata[2] local tex_carpet = "mobs_mc_llama_decor_"..substr..".png" + self.base_texture = table.copy(self.base_texture) self.base_texture[2] = tex_carpet self.object:set_properties({ @@ -186,18 +223,19 @@ mobs:register_mob("mobs_mc:llama", { end end end - ]] - -- detatch player already riding llama - if self.driver and clicker == self.driver then + if self.carpet then + -- detatch player already riding llama + if self.driver and clicker == self.driver then - mobs.detach(clicker, {x = 1, y = 0, z = 1}) + mobs.detach(clicker, {x = 1, y = 0, z = 1}) - -- attach player to llama - elseif not self.driver then + -- attach player to llama + elseif not self.driver then - self.object:set_properties({stepheight = 1.1}) - mobs.attach(self, clicker) + self.object:set_properties({stepheight = 1.1}) + mobs.attach(self, clicker) + end end end diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index 5ba091c44..5672f2093 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -94,17 +94,16 @@ mobs:register_mob("mobs_mc:pig", { return end - if clicker:get_player_control().sneak then - --attempt to enter breed state - if mobs.enter_breed_state(self,clicker) then - return - end + --attempt to enter breed state + if mobs.enter_breed_state(self,clicker) then + return + end - --make baby grow faster - if self.baby then - mobs.make_baby_grow_faster(self,clicker) - return - end + --ignore other logic + --make baby grow faster + if self.baby then + mobs.make_baby_grow_faster(self,clicker) + return end if self.child then @@ -113,6 +112,8 @@ mobs:register_mob("mobs_mc:pig", { -- Put saddle on pig local item = clicker:get_wielded_item() + local wielditem = item + if item:get_name() == mobs_mc.items.saddle and self.saddle ~= "yes" then self.base_texture = { "blank.png", -- baby diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_chest.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_chest.png new file mode 100644 index 000000000..e0715af9f Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_chest.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_black.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_black.png new file mode 100644 index 000000000..40c39648f Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_black.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_blue.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_blue.png new file mode 100644 index 000000000..b02c41b26 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_blue.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_brown.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_brown.png new file mode 100644 index 000000000..2c7c71c2f Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_brown.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_cyan.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_cyan.png new file mode 100644 index 000000000..83f7a8faa Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_cyan.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_gray.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_gray.png new file mode 100644 index 000000000..a4bd9cb1f Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_gray.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_green.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_green.png new file mode 100644 index 000000000..c3297ce94 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_green.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_light_blue.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_light_blue.png new file mode 100644 index 000000000..71eabea53 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_light_blue.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_light_gray.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_light_gray.png new file mode 100644 index 000000000..929a60950 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_light_gray.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_lime.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_lime.png new file mode 100644 index 000000000..1507d6d79 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_lime.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_magenta.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_magenta.png new file mode 100644 index 000000000..809e645fb Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_magenta.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_orange.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_orange.png new file mode 100644 index 000000000..ff17ff67c Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_orange.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_pink.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_pink.png new file mode 100644 index 000000000..7009e6efc Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_pink.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_purple.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_purple.png new file mode 100644 index 000000000..1de65a407 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_purple.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_red.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_red.png new file mode 100644 index 000000000..645df4977 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_red.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_white.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_white.png new file mode 100644 index 000000000..c6ae669dd Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_white.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_yellow.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_yellow.png new file mode 100644 index 000000000..6318e163d Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_yellow.png differ diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index 4cd76dd32..941cc42f1 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -154,17 +154,16 @@ dog.follow = "mcl_mobitems:beef" dog.on_rightclick = function(self, clicker) local item = clicker:get_wielded_item() - if self.owner and self.owner == clicker:get_player_name() and clicker:get_player_control().sneak then - --attempt to enter breed state - if mobs.enter_breed_state(self,clicker) then - return - end + --owner is broken for this + --attempt to enter breed state + if mobs.enter_breed_state(self,clicker) then + return + end - --make baby grow faster - if self.baby then - mobs.make_baby_grow_faster(self,clicker) - return - end + --make baby grow faster + if self.baby then + mobs.make_baby_grow_faster(self,clicker) + return end if is_food(item:get_name()) then