From 9e89d3918df77415711130ce78232f660dda6320 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sat, 23 Sep 2023 14:12:16 +0100 Subject: [PATCH] initial_properties update --- init.lua | 32 +++++++++----------------------- mod.conf | 3 ++- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/init.lua b/init.lua index 6dae68e..75d49e2 100644 --- a/init.lua +++ b/init.lua @@ -6,24 +6,7 @@ -- before it closes (10 seconds), potions can also be thrown for local teleport. -- translation support -local S -if minetest.get_translator then - S = minetest.get_translator("teleport_potion") -else - S = function(s, a, ...) - if a == nil then - return s - end - a = {a, ...} - return s:gsub("(@?)@(%(?)(%d+)(%)?)", function(e, o, n, c) - if e == ""then - return a[tonumber(n)] .. (o == "" and c or "") - else - return "@" .. o .. n .. c - end - end) - end -end +local S = minetest.get_translator("teleport_potion") -- check for MineClone2 local mcl = minetest.get_modpath("mcl_core") @@ -179,11 +162,14 @@ end -- potion entity local potion_entity = { - physical = true, - visual = "sprite", - visual_size = {x = 1.0, y = 1.0}, - textures = {"teleport_potion_potion.png"}, - collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1}, + + initial_properties = { + physical = true, + visual = "sprite", + visual_size = {x = 1.0, y = 1.0}, + textures = {"teleport_potion_potion.png"}, + collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1}, + }, lastpos = {}, player = "" } diff --git a/mod.conf b/mod.conf index 6109bf6..3140815 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,5 @@ name = teleport_potion +description = Adds craftable teleport potions (throwable) and teleport pads. depends = optional_depends = default, lucky_block, mcl_core -description = Adds craftable teleport potions (throwable) and teleport pads. +min_minetest_version = 5.0