Enable placing carpets on llamas and add textures for it
|
@ -75,6 +75,7 @@ Origin of those models:
|
||||||
* `mobs_mc_mushroom_brown.png` (CC0)
|
* `mobs_mc_mushroom_brown.png` (CC0)
|
||||||
|
|
||||||
* “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i
|
* “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i
|
||||||
|
* Llama decor (carpet) textures (`mobs_mc_llama_decor_*`) by erlehmann and rudzik8
|
||||||
* Any other texture not mentioned here are licensed under the MIT License
|
* Any other texture not mentioned here are licensed under the MIT License
|
||||||
|
|
||||||
## Sounds
|
## Sounds
|
||||||
|
|
|
@ -42,7 +42,6 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
{"blank.png", "blank.png", "mobs_mc_llama_gray.png"},
|
{"blank.png", "blank.png", "mobs_mc_llama_gray.png"},
|
||||||
{"blank.png", "blank.png", "mobs_mc_llama_white.png"},
|
{"blank.png", "blank.png", "mobs_mc_llama_white.png"},
|
||||||
{"blank.png", "blank.png", "mobs_mc_llama.png"},
|
{"blank.png", "blank.png", "mobs_mc_llama.png"},
|
||||||
-- TODO: Add llama carpet textures (Pixel Perfection seems to use verbatim copy from Minecraft :-( )
|
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=3, y=3},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
|
@ -139,50 +138,48 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
-- 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
|
||||||
|
|
||||||
-- Place carpet
|
-- 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
|
||||||
if minetest.get_item_group(item:get_name(), "carpet") == 1 and not self.carpet 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
|
item:take_item()
|
||||||
item:take_item()
|
clicker:set_wielded_item(item)
|
||||||
clicker:set_wielded_item(item)
|
|
||||||
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({
|
|
||||||
textures = self.base_texture,
|
|
||||||
})
|
|
||||||
self.carpet = item:get_name()
|
|
||||||
self.drops = {
|
|
||||||
{name = mobs_mc.items.leather,
|
|
||||||
chance = 1,
|
|
||||||
min = 0,
|
|
||||||
max = 2,},
|
|
||||||
{name = item:get_name(),
|
|
||||||
chance = 1,
|
|
||||||
min = 1,
|
|
||||||
max = 1,},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
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({
|
||||||
|
textures = self.base_texture,
|
||||||
|
})
|
||||||
|
self.carpet = item:get_name()
|
||||||
|
self.drops = {
|
||||||
|
{name = mobs_mc.items.leather,
|
||||||
|
chance = 1,
|
||||||
|
min = 0,
|
||||||
|
max = 2,},
|
||||||
|
{name = item:get_name(),
|
||||||
|
chance = 1,
|
||||||
|
min = 1,
|
||||||
|
max = 1,},
|
||||||
|
}
|
||||||
|
return
|
||||||
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
|
||||||
|
|
||||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||||
|
|
||||||
-- attach player to llama
|
-- attach player to llama
|
||||||
elseif not self.driver then
|
elseif not self.driver then
|
||||||
|
|
||||||
self.object:set_properties({stepheight = 1.1})
|
self.object:set_properties({stepheight = 1.1})
|
||||||
mobs.attach(self, clicker)
|
mobs.attach(self, clicker)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Used to capture llama
|
-- Used to capture llama
|
||||||
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
|
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
|
||||||
|
@ -190,8 +187,6 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--[[
|
|
||||||
TODO: Enable this code when carpet textures arrived.
|
|
||||||
on_breed = function(parent1, parent2)
|
on_breed = function(parent1, parent2)
|
||||||
-- When breeding, make sure the child has no carpet
|
-- When breeding, make sure the child has no carpet
|
||||||
local pos = parent1.object:get_pos()
|
local pos = parent1.object:get_pos()
|
||||||
|
@ -213,7 +208,6 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
]]
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_black.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_blue.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_brown.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_cyan.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_gray.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_green.png
Normal file
After Width: | Height: | Size: 936 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 4.9 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_lime.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_magenta.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_orange.png
Normal file
After Width: | Height: | Size: 966 B |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_pink.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_purple.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_red.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_white.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_llama_decor_yellow.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 11 KiB |