Fix boat and enchanting book texture glitches / warnings

This commit is contained in:
Lizzy Fleckenstein 2021-11-09 17:39:39 +01:00
parent 0491b814dd
commit a7bc460fae
Signed by untrusted user: LizzyFleckenstein03
GPG Key ID: 06927A5199D6C9B2
2 changed files with 9 additions and 3 deletions

View File

@ -115,7 +115,7 @@ local boat = {
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
visual = "mesh", visual = "mesh",
mesh = "mcl_boats_boat.b3d", 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, visual_size = boat_visual_size,
hp_max = boat_max_hp, hp_max = boat_max_hp,
damage_texture_modifier = "^[colorize:white:0", damage_texture_modifier = "^[colorize:white:0",
@ -148,6 +148,11 @@ function boat.on_activate(self, staticdata, dtime_s)
self._v = data.v self._v = data.v
self._last_v = self._v self._last_v = self._v
self._itemstring = data.itemstring self._itemstring = data.itemstring
while #data.textures < 5 do
table.insert(data.textures, data.textures[1])
end
self.object:set_properties({textures = data.textures}) self.object:set_properties({textures = data.textures})
end end
end end
@ -434,8 +439,9 @@ for b=1, #boat_ids do
pos = vector.add(pos, vector.multiply(dir, boat_y_offset_ground)) pos = vector.add(pos, vector.multiply(dir, boat_y_offset_ground))
end end
local boat = minetest.add_entity(pos, "mcl_boats:boat") local boat = minetest.add_entity(pos, "mcl_boats:boat")
local texture = "mcl_boats_texture_"..images[b].."_boat.png"
boat:get_luaentity()._itemstring = itemstring 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()) boat:set_yaw(placer:get_look_horizontal())
if not minetest.is_creative_enabled(placer:get_player_name()) then if not minetest.is_creative_enabled(placer:get_player_name()) then
itemstack:take_item() itemstack:take_item()

View File

@ -183,7 +183,7 @@ minetest.register_entity("mcl_enchanting:book", {
collisionbox = {0, 0, 0}, collisionbox = {0, 0, 0},
pointable = false, pointable = false,
physical = 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, static_save = false,
}, },
_player_near = false, _player_near = false,