From a7bc460fae77f2a841bb7a5b9e735226373a4e44 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Tue, 9 Nov 2021 17:39:39 +0100 Subject: [PATCH] Fix boat and enchanting book texture glitches / warnings --- mods/ENTITIES/mcl_boats/init.lua | 10 ++++++++-- mods/ITEMS/mcl_enchanting/init.lua | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index 311b07882f..f46c14d467 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -115,7 +115,7 @@ local boat = { collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, visual = "mesh", mesh = "mcl_boats_boat.b3d", - textures = {"mcl_boats_texture_oak_boat.png"}, + textures = {"mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png"}, visual_size = boat_visual_size, hp_max = boat_max_hp, damage_texture_modifier = "^[colorize:white:0", @@ -148,6 +148,11 @@ function boat.on_activate(self, staticdata, dtime_s) self._v = data.v self._last_v = self._v self._itemstring = data.itemstring + + while #data.textures < 5 do + table.insert(data.textures, data.textures[1]) + end + self.object:set_properties({textures = data.textures}) end end @@ -434,8 +439,9 @@ for b=1, #boat_ids do pos = vector.add(pos, vector.multiply(dir, boat_y_offset_ground)) end local boat = minetest.add_entity(pos, "mcl_boats:boat") + local texture = "mcl_boats_texture_"..images[b].."_boat.png" boat:get_luaentity()._itemstring = itemstring - boat:set_properties({textures = { "mcl_boats_texture_"..images[b].."_boat.png" }}) + boat:set_properties({textures = { texture, texture, texture, texture, texture }}) boat:set_yaw(placer:get_look_horizontal()) if not minetest.is_creative_enabled(placer:get_player_name()) then itemstack:take_item() diff --git a/mods/ITEMS/mcl_enchanting/init.lua b/mods/ITEMS/mcl_enchanting/init.lua index 5aec1ced61..9f9fbd271e 100644 --- a/mods/ITEMS/mcl_enchanting/init.lua +++ b/mods/ITEMS/mcl_enchanting/init.lua @@ -183,7 +183,7 @@ minetest.register_entity("mcl_enchanting:book", { collisionbox = {0, 0, 0}, pointable = false, physical = false, - textures = {"mcl_enchanting_book_entity.png"}, + textures = {"mcl_enchanting_book_entity.png", "mcl_enchanting_book_entity.png", "mcl_enchanting_book_entity.png", "mcl_enchanting_book_entity.png", "mcl_enchanting_book_entity.png"}, static_save = false, }, _player_near = false,