From 4284d3397dbfd0f60f2491d241dba27ab16f0552 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 31 Jul 2017 04:07:17 +0200 Subject: [PATCH] Don't allow banner placement on ceiling --- mods/ITEMS/mcl_banners/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index 7110d24975..9747f8d44b 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -221,8 +221,14 @@ for colorid, colortab in pairs(mcl_banners.colors) do -- Place the node! local hanging = false + + -- Standing or hanging banner. The placement rules are enforced by the node definitions local _, success = minetest.item_place_node(ItemStack("mcl_banners:standing_banner"), placer, pointed_thing) if not success then + -- Forbidden on ceiling + if pointed_thing.under.y ~= pointed_thing.above.y then + return itemstack + end _, success = minetest.item_place_node(ItemStack("mcl_banners:hanging_banner"), placer, pointed_thing) if not success then return itemstack