From 1fd714be5b06463575c07936a2ff60f967beb5b4 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Mon, 7 Nov 2022 11:48:33 -0800 Subject: [PATCH 1/3] fix typo --- blabla.lua | 2 +- inspect.lua | 4 ++-- locale/replacer.de.tr | 4 ++-- locale/replacer.es.tr | 4 ++-- locale/replacer.fi.tr | 4 ++-- locale/replacer.fr.tr | 4 ++-- locale/replacer.it.tr | 4 ++-- locale/replacer.pt.tr | 4 ++-- locale/replacer.ru.tr | 4 ++-- locale/template.txt | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/blabla.lua b/blabla.lua index e572a48..f9a8c5c 100644 --- a/blabla.lua +++ b/blabla.lua @@ -98,7 +98,7 @@ rbi.drops_on_dig = S('Drops on dig:') rbi.nothing = S('nothing.') rbi.may_drop_on_dig = S('May drop on dig:') rbi.can_be_fuel = S('This can be used as a fuel.') -rbi.unkown_recipe = S('Error: Unkown recipe.') +rbi.unknown_recipe = S('Error: Unknown recipe.') rbi.log_reg_craft_method_wrong_arguments = '[replacer] register_craft_method invalid arguments given.' rbi.log_reg_craft_method_overriding_method = '[replacer] register_craft_method overriding existing method ' rbi.log_reg_craft_method_added = '[replacer] register_craft_method method added: %s %s' diff --git a/inspect.lua b/inspect.lua index 8558918..d7db9d3 100644 --- a/inspect.lua +++ b/inspect.lua @@ -101,7 +101,7 @@ function replacer.inspect(_, player, pointed_thing, right_clicked) chat(player_name, r.inspect_entity(pointed_thing.ref, player)) return nil elseif 'node' ~= pointed_thing.type then - chat(player_name, S('Sorry, this is an unkown something of type "@1". ' + chat(player_name, S('Sorry, this is an unknown something of type "@1". ' .. 'No information available.', pointed_thing.type)) return nil end @@ -734,7 +734,7 @@ function replacer.inspect_show_crafting(player_name, node_name, fields) else --pd('unhandled recipe encountered', recipe) --r.play_sound(player_name, true) - formspec = formspec .. 'label[3,1;' .. mfe(rbi.unkown_recipe) .. ']' + formspec = formspec .. 'label[3,1;' .. mfe(rbi.unknown_recipe) .. ']' end -- output item on the right if recipe.output then diff --git a/locale/replacer.de.tr b/locale/replacer.de.tr index b927fe1..8a188ac 100644 --- a/locale/replacer.de.tr +++ b/locale/replacer.de.tr @@ -53,7 +53,7 @@ Drops on dig:=Lässt fallen beim Graben: nothing.=nichts. May drop on dig:=Kann beim Graben fallen lassen: This can be used as a fuel.=Dies kann als Brennstoff verwendet werden. -Error: Unkown recipe.=Fehler: Unbekanntes Rezept. +Error: Unknown recipe.=Fehler: Unbekanntes Rezept. scoop up=schöpfen pour out=ausgiessen filling=auffüllen @@ -83,7 +83,7 @@ Store near group:wood, light < 12.=In der Nähe der Holzgruppe@n(group:wood) lag Replacing nodes of type "@1" is not allowed on this server. Replacement failed.=Node des Typs „@1“ dürfen auf diesem Server nicht ersetzt werden. Versuch fehlgeschlagen. Protected at @1=Geschützt bei @1 printing=Drucken -Sorry, this is an unkown something of type "@1". No information available.=Tut mir leid, das ist etwas unbekanntes vom Typ „@1“. Keine Informationen verfügbar. +Sorry, this is an unknown something of type "@1". No information available.=Tut mir leid, das ist etwas unbekanntes vom Typ „@1“. Keine Informationen verfügbar. Can deal @1 damage.=Kann @1 Schaden verursachen. Has @1 armour.=Hat @1 Rüstung. This is your fellow player "@1"=Dies ist dein Mitspieler „@1“ diff --git a/locale/replacer.es.tr b/locale/replacer.es.tr index 826e0a2..df40df9 100644 --- a/locale/replacer.es.tr +++ b/locale/replacer.es.tr @@ -53,7 +53,7 @@ Drops on dig:=Cae en excavación: nothing.=nada. May drop on dig:=Puede caer en excavación: This can be used as a fuel.=Esto se puede usar como combustible. -Error: Unkown recipe.=Error: Receta desconocida. +Error: Unknown recipe.=Error: Receta desconocida. scoop up=recoger pour out=derramar filling=llena @@ -83,7 +83,7 @@ Store near group:wood, light < 12.=Almacenar cerca del grupo de madera@n(group:w Replacing nodes of type "@1" is not allowed on this server. Replacement failed.=No se permite reemplazar nodos de tipo "@1" en este servidor. Reemplazo fallido. Protected at @1=Protegido en @1 printing=impresión -Sorry, this is an unkown something of type "@1". No information available.=Lo sentimos, esto es algo desconocido de tipo "@1". No hay información disponible. +Sorry, this is an unknown something of type "@1". No information available.=Lo sentimos, esto es algo desconocido de tipo "@1". No hay información disponible. Can deal @1 damage.=Puede causar daño @1. Has @1 armour.=Tiene armadura @1. This is your fellow player "@1"=Este es tu compañero de juego "@1" diff --git a/locale/replacer.fi.tr b/locale/replacer.fi.tr index 6b427e1..a91c3e1 100644 --- a/locale/replacer.fi.tr +++ b/locale/replacer.fi.tr @@ -53,7 +53,7 @@ Drops on dig:=Pudotukset kaivamaan: nothing.=ei mitään. May drop on dig:=Saattaa pudota kaivamaan: This can be used as a fuel.=Tätä voidaan käyttää polttoaineena. -Error: Unkown recipe.=Virhe: Tuntematon resepti. +Error: Unknown recipe.=Virhe: Tuntematon resepti. scoop up=kauhoa pour out=kaataa filling=täyttää @@ -83,7 +83,7 @@ Store near group:wood, light < 12.=Varasto lähellä group:wood,@nkevyt < 12. Replacing nodes of type "@1" is not allowed on this server. Replacement failed.=Tyypin "@1" solmujen korvaaminen ei ole sallittua tässä palvelimessa. Vaihto epäonnistui. Protected at @1=Suojattu @1 printing=painatus -Sorry, this is an unkown something of type "@1". No information available.=Anteeksi, tämä on tuntematon asia, jonka tyyppi on "@1". Tietoja ei ole saatavilla. +Sorry, this is an unknown something of type "@1". No information available.=Anteeksi, tämä on tuntematon asia, jonka tyyppi on "@1". Tietoja ei ole saatavilla. Can deal @1 damage.=Voi tehdä @1 vahinkoa. Has @1 armour.=Siinä on @1-panssari. This is your fellow player "@1"=Tämä on pelikaverisi "@1" diff --git a/locale/replacer.fr.tr b/locale/replacer.fr.tr index 9b60c7f..ed8189b 100644 --- a/locale/replacer.fr.tr +++ b/locale/replacer.fr.tr @@ -53,7 +53,7 @@ Drops on dig:=Gouttes sur creuser : nothing.=rien. May drop on dig:=Peut tomber en creusant : This can be used as a fuel.=Cela peut être utilisé comme carburant. -Error: Unkown recipe.=Erreur : recette inconnue. +Error: Unknown recipe.=Erreur : recette inconnue. scoop up=ramasser pour out=déverser filling=remplir @@ -83,7 +83,7 @@ Store near group:wood, light < 12.=Entreposer près du groupe @ngroup:wood, lum Replacing nodes of type "@1" is not allowed on this server. Replacement failed.=Le remplacement de nœuds de type "@1" n'est pas autorisé sur ce serveur. Échec du remplacement. Protected at @1=Protégé à @1 printing=impression -Sorry, this is an unkown something of type "@1". No information available.=Désolé, c'est quelque chose d'inconnu de type "@1". Aucune information disponible. +Sorry, this is an unknown something of type "@1". No information available.=Désolé, c'est quelque chose d'inconnu de type "@1". Aucune information disponible. Can deal @1 damage.=Peut infliger @1 dégâts. Has @1 armour.=A @1 armure. This is your fellow player "@1"=C'est votre coéquipier "@1" diff --git a/locale/replacer.it.tr b/locale/replacer.it.tr index 28728d3..f7083dd 100644 --- a/locale/replacer.it.tr +++ b/locale/replacer.it.tr @@ -53,7 +53,7 @@ Drops on dig:=Gocce allo scavo: nothing.=niente. May drop on dig:=Può cadere durante lo scavo: This can be used as a fuel.=Questo può essere usato come carburante. -Error: Unkown recipe.=Errore: ricetta sconosciuta. +Error: Unknown recipe.=Errore: ricetta sconosciuta. scoop up=raccogliere pour out=versare filling=riempire @@ -83,7 +83,7 @@ Store near group:wood, light < 12.=Negozio vicino al gruppo group:wood,@nluce < Replacing nodes of type "@1" is not allowed on this server. Replacement failed.=La sostituzione dei nodi di tipo "@1" non è consentita su questo server. Sostituzione non riuscita. Protected at @1=Protetto a @1 printing=stampa -Sorry, this is an unkown something of type "@1". No information available.=Siamo spiacenti, questo è un qualcosa sconosciuto di tipo "@1". Nessuna informazione disponibile. +Sorry, this is an unknown something of type "@1". No information available.=Siamo spiacenti, questo è un qualcosa sconosciuto di tipo "@1". Nessuna informazione disponibile. Can deal @1 damage.=Può infliggere @1 danno. Has @1 armour.=Ha @1 armatura. This is your fellow player "@1"=Questo è il tuo compagno di gioco "@1" diff --git a/locale/replacer.pt.tr b/locale/replacer.pt.tr index aca318e..d628650 100644 --- a/locale/replacer.pt.tr +++ b/locale/replacer.pt.tr @@ -53,7 +53,7 @@ Drops on dig:=Gotas na escavação: nothing.=nada. May drop on dig:=Pode cair na escavação: This can be used as a fuel.=Isso pode ser usado como combustível. -Error: Unkown recipe.=Erro: receita desconhecida. +Error: Unknown recipe.=Erro: receita desconhecida. scoop up=escavar pour out=derramar filling=encher @@ -83,7 +83,7 @@ Store near group:wood, light < 12.=Armazenar perto do grupo group:wood,@nluz < 1 Replacing nodes of type "@1" is not allowed on this server. Replacement failed.=A substituição de nós do tipo "@1" não é permitida neste servidor. Falha na substituição. Protected at @1=Protegido em @1 printing=impressão -Sorry, this is an unkown something of type "@1". No information available.=Desculpe, isso é algo desconhecido do tipo "@1". Nenhuma informação disponível. +Sorry, this is an unknown something of type "@1". No information available.=Desculpe, isso é algo desconhecido do tipo "@1". Nenhuma informação disponível. Can deal @1 damage.=Pode causar @1 de dano. Has @1 armour.=Tem armadura @1. This is your fellow player "@1"=Este é seu colega jogador "@1" diff --git a/locale/replacer.ru.tr b/locale/replacer.ru.tr index b11f287..ca897b7 100644 --- a/locale/replacer.ru.tr +++ b/locale/replacer.ru.tr @@ -53,7 +53,7 @@ Drops on dig:=Выпадает при раскопках: nothing.=ничего. May drop on dig:=Может выпасть при раскопках: This can be used as a fuel.=Это можно использовать в качестве топлива. -Error: Unkown recipe.=Ошибка: Неизвестный рецепт. +Error: Unknown recipe.=Ошибка: Неизвестный рецепт. scoop up=зачерпнуть pour out=вылить filling=заполнить @@ -83,7 +83,7 @@ Store near group:wood, light < 12.=Хранить рядом с группой Replacing nodes of type "@1" is not allowed on this server. Replacement failed.=Замена узлов типа "@1" на этом сервере запрещена. Замена не удалась. Protected at @1=Защищено в @1 printing=печать -Sorry, this is an unkown something of type "@1". No information available.=Извините, это неизвестное что-то типа "@1". Информация отсутствует. +Sorry, this is an unknown something of type "@1". No information available.=Извините, это неизвестное что-то типа "@1". Информация отсутствует. Can deal @1 damage.=Может нанести @1 урона. Has @1 armour.=Имеет @1 броню. This is your fellow player "@1"=Это ваш товарищ по игре "@1" diff --git a/locale/template.txt b/locale/template.txt index e9fb515..3f48f4d 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -53,7 +53,7 @@ Drops on dig:= nothing.= May drop on dig:= This can be used as a fuel.= -Error: Unkown recipe.= +Error: Unknown recipe.= scoop up= pour out= filling= @@ -83,7 +83,7 @@ Store near group:wood, light < 12.= Replacing nodes of type "@1" is not allowed on this server. Replacement failed.= Protected at @1= printing= -Sorry, this is an unkown something of type "@1". No information available.= +Sorry, this is an unknown something of type "@1". No information available.= Can deal @1 damage.= Has @1 armour.= This is your fellow player "@1"= From 3b7db127f793d2e90e4b81688c0636da2af8716a Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Sun, 25 Feb 2024 13:37:05 +0100 Subject: [PATCH 2/3] fix multinode trouble in field mode when clicking on the 'wrong' part of a multinode-node, direction calculation is nerfed. This patch avoids a server crash and emits a sound and message. User can simply click on another part of the multinode- node and the procedure should work. I didn't bother adjusting the pointed_thing to make this work, as I don't consider the trouble worthwhile for this kind of node that breaks the voxel world. The bug was detected by player frogTheSecond and reported by Huhhila on pandorabox. Thanks guys. --- CHANGELOG | 1 + init.lua | 2 +- replacer/replacer.lua | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 4e8f7ac..5f2cd48 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +20240225 * SwissalpS patched a crash situation with multinode-nodes. Thanks frogTheSecond and Huhhila for detecting and reporting. 20220830 * SwissalpS fixed de translation typo. Thanks Niklp09 for reporting. 20220626 * SwissalpS fixed case where other drops were prefered from actual node that user tried to set to. 20220624 * SX added technic.plus compat fix diff --git a/init.lua b/init.lua index b836f8a..a317a32 100644 --- a/init.lua +++ b/init.lua @@ -24,7 +24,7 @@ -- Changelog: see CHANGELOG file replacer = {} -replacer.version = 20220830 +replacer.version = 20240225 replacer.has_bakedclay = minetest.get_modpath('bakedclay') replacer.has_basic_dyes = minetest.get_modpath('dye') diff --git a/replacer/replacer.lua b/replacer/replacer.lua index eeb4cd7..983534a 100644 --- a/replacer/replacer.lua +++ b/replacer/replacer.lua @@ -364,6 +364,18 @@ function replacer.on_use(itemstack, player, pt, right_clicked) end end end + -- with multinode-nodes it is possible to click the + -- node in a way that none of the coordinates of + -- ``normal`` is 0, leading to empty ``dirs`` and crash + -- when passing nil to vector functions. + -- Player can click on another part of the node to + -- have success. + if 0 == #dirs then + r.play_sound(name, true) + r.inform(name, rb.no_pos) + return + end + -- The normal is used as offset to test if the searched position -- is next to the field; the offset goes in the other direction when -- a right click happens From a364db40ca62d83617bf9ba56706a72d2aa58fa0 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Sun, 25 Feb 2024 13:49:48 +0100 Subject: [PATCH 3/3] unrelated luacheck 'fixes' --- compat/ehlphabet.lua | 2 +- compat/letters.lua | 4 ++-- compat/wine.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compat/ehlphabet.lua b/compat/ehlphabet.lua index 775c3eb..8250ac5 100644 --- a/compat/ehlphabet.lua +++ b/compat/ehlphabet.lua @@ -10,7 +10,7 @@ local skip = {} for _, n in ipairs(exceptions) do skip[n] = true end local function ehlphabet_number_sticker(item_name) - if not item_name or not 'string' == type(item_name) then return end + if not item_name or 'string' ~= type(item_name) then return end return item_name:match('^ehlphabet:([0-9]+)'), item_name:find('_sticker$') and true diff --git a/compat/letters.lua b/compat/letters.lua index 5e8fced..16ac770 100644 --- a/compat/letters.lua +++ b/compat/letters.lua @@ -3,7 +3,7 @@ if not minetest.get_modpath('letters') then return end -- for inspection tool local S = replacer.S local function add_recipe_u(item_name, _, recipes) - if not item_name or not 'string' == type(item_name) then return end + if not item_name or 'string' ~= type(item_name) then return end local input, letter = item_name:match('^(.+)_letter_(.)u$') if not input then return end @@ -21,7 +21,7 @@ replacer.register_craft_method('letters:upper', 'letters:letter_cutter_upper', a local function add_recipe_l(item_name, _, recipes) - if not item_name or not 'string' == type(item_name) then return end + if not item_name or 'string' ~= type(item_name) then return end local input, letter = item_name:match('^(.+)_letter_(.)l$') if not input then return end diff --git a/compat/wine.lua b/compat/wine.lua index 31413dc..46307d0 100644 --- a/compat/wine.lua +++ b/compat/wine.lua @@ -20,7 +20,7 @@ in_out['wine:glass_coffee_liquor'] = 'farming:coffee_beans' in_out['wine:glass_champagne'] = 'wine:glass_champagne_raw' local function add_recipe(item_name, _, recipes) - if not 'string' == type(item_name) + if 'string' ~= type(item_name) or not item_name:find('^wine:glass_') then return end -- this one is an exception