tidy code

This commit is contained in:
tenplus1 2024-07-28 10:32:30 +01:00
parent 9e89d3918d
commit 92c883ba75
2 changed files with 38 additions and 45 deletions

View file

@ -1,7 +1,7 @@
--= Teleport Potion mod by TenPlus1
-- Craft teleport potion or pad, use to bookmark location, place to open
-- Craft teleport potion or pad, use on node to bookmark location, place to open
-- portal or place pad, portals show a blue flame that you can walk into
-- before it closes (10 seconds), potions can also be thrown for local teleport.
@ -289,6 +289,7 @@ minetest.register_node("teleport_potion:potion", {
-- teleport potion recipe
if mcl then
minetest.register_craft({
output = "teleport_potion:potion",
recipe = {
@ -357,8 +358,7 @@ minetest.register_node("teleport_potion:pad", {
meta:set_int("y", dest.y)
meta:set_int("z", dest.z)
meta:set_string("infotext", S("Pad Active (@1,@2,@3)",
dest.x, dest.y, dest.z))
meta:set_string("infotext", S("Pad Active (@1,@2,@3)", dest.x, dest.y, dest.z))
effect(pos, 20, "teleport_potion_particle.png", 0.5, 1.5, 1, 7, 15)
@ -453,6 +453,7 @@ end)
-- teleport pad recipe
if mcl then
minetest.register_craft({
output = "teleport_potion:pad",
recipe = {
@ -506,11 +507,7 @@ minetest.register_abm({
-- play sound on portal end
minetest.sound_play("portal_close", {
pos = pos,
gain = 1.0,
max_hear_distance = 5
}, true)
pos = pos, gain = 1.0, max_hear_distance = 5}, true)
pos.y = pos.y + 1
@ -525,10 +522,7 @@ minetest.register_abm({
-- play sound on destination end
minetest.sound_play("portal_close", {
pos = target_coords,
gain = 1.0,
max_hear_distance = 5
}, true)
pos = target_coords, gain = 1.0, max_hear_distance = 5}, true)
-- rotate player to look in pad placement direction
local rot = node.param2

View file

@ -1,5 +1,4 @@
name = teleport_potion
description = Adds craftable teleport potions (throwable) and teleport pads.
depends =
optional_depends = default, lucky_block, mcl_core
min_minetest_version = 5.0