Add in llama carpets
|
@ -138,26 +138,37 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if clicker:get_player_control().sneak then
|
--owner is broken for this
|
||||||
--attempt to enter breed state
|
--we'll make the owner this guy
|
||||||
if mobs.enter_breed_state(self,clicker) then
|
--attempt to enter breed state
|
||||||
return
|
if mobs.enter_breed_state(self,clicker) then
|
||||||
end
|
self.tamed = true
|
||||||
|
self.owner = clicker:get_player_name()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
--make baby grow faster
|
--ignore other logic
|
||||||
if self.baby then
|
--make baby grow faster
|
||||||
mobs.make_baby_grow_faster(self,clicker)
|
if self.baby then
|
||||||
return
|
mobs.make_baby_grow_faster(self,clicker)
|
||||||
end
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Make sure tamed llama is mature and being clicked by owner only
|
-- 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
|
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
|
||||||
|
|
||||||
|
|
||||||
-- Place carpet
|
-- Place carpet
|
||||||
--[[ TODO: Re-enable this code when carpet textures arrived.
|
--TODO: Re-enable this code when carpet textures arrived.
|
||||||
if minetest.get_item_group(item:get_name(), "carpet") == 1 and not self.carpet then
|
if minetest.get_item_group(item:get_name(), "carpet") == 1 then
|
||||||
|
|
||||||
for group, carpetdata in pairs(carpets) do
|
for group, carpetdata in pairs(carpets) do
|
||||||
if minetest.get_item_group(item:get_name(), group) == 1 then
|
if minetest.get_item_group(item:get_name(), group) == 1 then
|
||||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||||
|
@ -165,6 +176,12 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
clicker:set_wielded_item(item)
|
clicker:set_wielded_item(item)
|
||||||
end
|
end
|
||||||
local substr = carpetdata[2]
|
local substr = carpetdata[2]
|
||||||
|
|
||||||
|
--shoot off old carpet
|
||||||
|
if self.carpet then
|
||||||
|
print(substr)
|
||||||
|
end
|
||||||
|
|
||||||
local tex_carpet = "mobs_mc_llama_decor_"..substr..".png"
|
local tex_carpet = "mobs_mc_llama_decor_"..substr..".png"
|
||||||
self.base_texture = table.copy(self.base_texture)
|
self.base_texture = table.copy(self.base_texture)
|
||||||
self.base_texture[2] = tex_carpet
|
self.base_texture[2] = tex_carpet
|
||||||
|
@ -186,7 +203,6 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
]]
|
|
||||||
|
|
||||||
-- detatch player already riding llama
|
-- detatch player already riding llama
|
||||||
if self.driver and clicker == self.driver then
|
if self.driver and clicker == self.driver then
|
||||||
|
|
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 7.4 KiB |