1
0
Fork 0

Fix creative banner drop

This commit is contained in:
Wuzzy 2017-07-27 22:36:36 +02:00
parent d8e17e8d23
commit b41bbe7b80
1 changed files with 4 additions and 5 deletions

View File

@ -31,10 +31,6 @@ local colors = {
-- After destroying the standing banner node -- After destroying the standing banner node
local on_destruct_standing_banner = function(pos) local on_destruct_standing_banner = function(pos)
if minetest.settings:get_bool("creative_mode") then
return
end
-- Find this node's banner entity and make it drop as an item -- Find this node's banner entity and make it drop as an item
local objects = minetest.get_objects_inside_radius(pos, 0.5) local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do for _, v in ipairs(objects) do
@ -196,7 +192,10 @@ minetest.register_entity("mcl_banners:standing_banner", {
end 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
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
-- Destroy entity -- Destroy entity
self.object:remove() self.object:remove()