mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-08-22 18:07:25 +02:00
Fix some banner bugs
This commit is contained in:
parent
959f045f23
commit
ec8efaeca3
@ -249,14 +249,10 @@ minetest.register_entity("mcl_banners:standing_banner", {
|
|||||||
|
|
||||||
-- This is a custom function which causes the banner to be dropped as item and destroys the entity.
|
-- This is a custom function which causes the banner to be dropped as item and destroys the entity.
|
||||||
_drop = function(self)
|
_drop = function(self)
|
||||||
-- Drop as item when the entity is destroyed.
|
|
||||||
if not self._base_color then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
pos.y = pos.y + 1
|
pos.y = pos.y + 1
|
||||||
|
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") and self._base_color then
|
||||||
minetest.add_item(pos, "mcl_banners:banner_item_"..colors[self._base_color][1])
|
minetest.add_item(pos, "mcl_banners:banner_item_"..colors[self._base_color][1])
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -269,15 +265,13 @@ minetest.register_entity("mcl_banners:standing_banner", {
|
|||||||
-- * self: Lua entity reference to entity.
|
-- * self: Lua entity reference to entity.
|
||||||
-- * other parameters: Same meaning as in make_banner_texture
|
-- * other parameters: Same meaning as in make_banner_texture
|
||||||
_set_textures = function(self, base_color, layers)
|
_set_textures = function(self, base_color, layers)
|
||||||
if self._base_color then
|
if base_color then
|
||||||
self._base_color = colorid
|
self._base_color = base_color
|
||||||
end
|
end
|
||||||
if self._layers then
|
if layers then
|
||||||
self._layers = layers
|
self._layers = layers
|
||||||
end
|
end
|
||||||
|
self.object:set_properties({textures = make_banner_texture(self._base_color, self._layers)})
|
||||||
local textures = make_banner_texture(self._base_color, self._layers)
|
|
||||||
self:set_properties({textures=textures})
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user