mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-07-27 17:30:17 +02:00
get rid of last vestages of "infinite stacks" special handling
just checks for creative mode/priv directly instead, as needed.
This commit is contained in:
@ -251,6 +251,7 @@ homedecor.register("swing", {
|
||||
place_on = "bottom"
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local placer_name = placer:get_player_name() or ""
|
||||
local isceiling, pos = homedecor.find_ceiling(itemstack, placer, pointed_thing)
|
||||
if isceiling then
|
||||
local height = 0
|
||||
@ -263,7 +264,7 @@ homedecor.register("swing", {
|
||||
|
||||
if not testreg or not testreg.buildable_to then
|
||||
if i < 1 then
|
||||
minetest.chat_send_player(placer:get_player_name(), "No room under there to hang a swing.")
|
||||
minetest.chat_send_player(placer_name, "No room under there to hang a swing.")
|
||||
return itemstack
|
||||
else
|
||||
break
|
||||
@ -279,11 +280,11 @@ homedecor.register("swing", {
|
||||
|
||||
minetest.set_node({ x=pos.x, y=pos.y-height, z=pos.z }, { name = "homedecor:swing", param2 = fdir })
|
||||
|
||||
if not homedecor.expect_infinite_stacks then
|
||||
if not creative.is_enabled_for(placer_name) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(placer:get_player_name(), "You have to point at the bottom side of an overhanging object to place a swing.")
|
||||
minetest.chat_send_player(placer_name, "You have to point at the bottom side of an overhanging object to place a swing.")
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
|
Reference in New Issue
Block a user