Disable Nether portal node rotation by screwdriver

This commit is contained in:
kay27 2021-12-09 02:55:57 +04:00
parent 543d695e44
commit 5ea16cd4f0
1 changed files with 6 additions and 0 deletions

View File

@ -242,6 +242,11 @@ local function destroy_nether_portal(pos, node)
check_remove({x = pos.x, y = pos.y + 1, z = pos.z})
end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
minetest.register_node(PORTAL, {
description = S("Nether Portal"),
_doc_items_longdesc = S("A Nether portal teleports creatures and objects to the hot and dangerous Nether dimension (and back!). Enter at your own risk!"),
@ -291,6 +296,7 @@ minetest.register_node(PORTAL, {
groups = { creative_breakable = 1, portal = 1, not_in_creative_inventory = 1 },
sounds = mcl_sounds.node_sound_glass_defaults(),
after_destruct = destroy_nether_portal,
on_rotate = on_rotate,
_mcl_hardness = -1,
_mcl_blast_resistance = 0,