Merge pull request 'Disable Nether portal node rotation by screwdriver' (#46) from fix_nether_portal_rotation into testing

Reviewed-on: MineClone5/MineClone5#46
This commit is contained in:
kay27 2021-12-08 23:04:03 +00:00
commit 6e06f78228
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}) check_remove({x = pos.x, y = pos.y + 1, z = pos.z})
end end
local on_rotate
if minetest.get_modpath("screwdriver") then
on_rotate = screwdriver.disallow
end
minetest.register_node(PORTAL, { minetest.register_node(PORTAL, {
description = S("Nether 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!"), _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 }, groups = { creative_breakable = 1, portal = 1, not_in_creative_inventory = 1 },
sounds = mcl_sounds.node_sound_glass_defaults(), sounds = mcl_sounds.node_sound_glass_defaults(),
after_destruct = destroy_nether_portal, after_destruct = destroy_nether_portal,
on_rotate = on_rotate,
_mcl_hardness = -1, _mcl_hardness = -1,
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,