From 7cabdb1707f2679238c1a73bc53beb18e839192b Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 1 Oct 2022 11:33:59 +0200 Subject: [PATCH] fix donkey chest texture --- mods/ENTITIES/mobs_mc/horse.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index ea04495541..9da733783f 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -238,18 +238,20 @@ local horse = { local heal = 0 if self._inv_id then - if not self._has_chest and item:get_name() == "mcl_chests:chest" then + if not self._chest and item:get_name() == "mcl_chests:chest" then item:take_item() clicker:set_wielded_item(item) - self._has_chest = true - local tex_chest = "mcl_chests_normal.png" - self.base_texture = table.copy(self.base_texture) - self.base_texture[1] = tex_chest - self.object:set_properties({ - textures = self.base_texture, - }) + self._chest = true + -- Update texture + if not self._naked_texture then + -- Base horse texture without chest or saddle + self._naked_texture = self.base_texture[2] + end + local tex = horse_extra_texture(self) + self.base_texture = tex + self.object:set_properties({textures = self.base_texture}) table.insert(self.drops,{name = "mcl_chests:chest",chance=1,min=1,max=1}) - elseif self._has_chest and clicker:get_player_control().sneak then + elseif self._chest and clicker:get_player_control().sneak then mcl_entity_invs.show_inv_form(self,clicker,"Donkey") return end