Fix bug with TA1 hammer used by pipeworks nodebreaker

This commit is contained in:
Joachim Stolberg 2022-11-07 21:37:47 +01:00
parent 41c4492ca6
commit 99b2f8f0c5
5 changed files with 46 additions and 16 deletions

View File

@ -172,7 +172,7 @@ end)
techage.dug_node = {}
minetest.register_on_dignode(function(pos, oldnode, digger)
if not digger then return end
-- store pos for tools without own 'register_on_dignode'
-- store the position of the dug block for tools like the TA1 hammer
techage.dug_node[digger:get_player_name()] = pos
end)

View File

@ -360,13 +360,20 @@ techage.manual_DE.aText = {
"\n",
"Den Köhler brauchst du\\, um Holzkohle herzustellen. Holzkohle wird für den Brenner\\, aber auch bspw. in TA2 für die Dampfmaschine benötigt.\n"..
"\n"..
"Für den Köhler brauchst du:\n"..
"\n"..
" - einen Anzünderblock ('techage:lighter')\n"..
" - 26 Hölzblöcke (wood)\\, die zu einem Würfen aufgeschichtet werden. Die Holzsorte spielt keine Rolle\n"..
" - Erde (dirt) um den Holzhaufen abzudecken\n"..
" - Flint and Iron (technischer Name: 'fire:flint_and_steel') um den Anzünderblock anzuzünden\n"..
"\n"..
"Bauanleitung (siehe auch Plan):\n"..
"\n"..
" - Baue eine 5x5 große Fläche aus Erde (dirt)\n"..
" - Platziere in die Mitte einen Anzünder (lighter)\n"..
" - Baue aus Holz (wood) einen 3x3x3 großen Würfel darüber\n"..
" - Überdecke alles mit einer Schicht Erde zu einem 5x5x5 großen Würfel\n"..
" - Lasse ein Loch zum Anzünder\n"..
" - Platziere rund um den Anzünder 7 Holz (wood)\\, aber lasse ein Loch zum Anzünder frei\n"..
" - Baue weitere 2 Schichten Holz darüber\\, so dass ein 3x3x3 großen Holzwürfel entsteht\n"..
" - Überdecke alles mit einer Schicht Erde zu einem 5x5x5 großen Würfel\\, aber lasse das Loch zum Anzünder frei\n"..
" - Zünde den Anzünder an und verschließe das Loch sofort mit jeweils einem Block Holz und Erde\n"..
" - Wenn du alles richtig gemacht hast\\, beginnt der Köhler nach wenigen Sekunden an zu rauchen\n"..
" - Öffne den Köhler erst\\, wenn der Rauch verschwunden ist (ca. 20 min)\n"..
@ -1479,6 +1486,8 @@ techage.manual_DE.aText = {
"\n"..
"Der Elektrolyseur besitzt ein Schraubenschlüssel-Menü zur Einstellung der Stromaufnahme und des Abschaltpunkts.\n"..
"\n"..
"Unterschreitet die im Stromnetz gespeicherte Leistung den angegebenen Wert des Abschaltpunkts\\, so schaltet sich der Elektrolyseur automatisch ab. Damit kann ein Leerlaufen der Speichersysteme verhindert werden.\n"..
"\n"..
"\n"..
"\n",
"Die Brennstoffzelle wandelt Wasserstoff in Strom um.\n"..

View File

@ -368,13 +368,19 @@ techage.manual_EN.aText = {
"\n",
"You need the Charcoal Pile to make charcoal. Charcoal is required for the melting furnace\\, but also\\, for example\\, in TA2 for the steam engine.\n"..
"\n"..
"For the charcoal burner you need:\n"..
"\n"..
" - a lighter block ('techage:lighter')\n"..
" - 26 wooden blocks that are stacked into a pile of wood. The type of wood is irrelevant\n"..
" - Dirt to cover the pile of wood\n"..
" - Flint and Iron (technical name: 'fire:flint_and_steel') to light the lighter block\n"..
"\n"..
"Building instructions (see also plan):\n"..
"\n"..
" - Build a 5x5 area of dirt\n"..
" - Place a lighter in the middle\n"..
" - Build a 3x3x3 cube above it out of wood\n"..
" - Cover everything with a layer of dirt to form a 5x5x5 cube\n"..
" - Leave a hole to the lighter\n"..
" - Build a 5x5 area of dirt\n"..
" - Place 7 wood around the lighter but leave a hole to the lighter\n"..
" - Build another 2 layers of wood on top\\, making a 3x3x3 wooden cube\n"..
" - Cover everything with a layer of dirt into a 5x5x5 cube\\, but keep the hole to the lighter open\n"..
" - Light the lighter and immediately close the hole with a block of wood and dirt\n"..
" - If you have done everything correctly\\, the coal burner will start smoking after a few seconds\n"..
" - Only open the charcoal burner when the smoke has disappeared (approx. 20 min)\n"..
@ -1486,6 +1492,8 @@ techage.manual_EN.aText = {
"\n"..
"The electrolyzer has a wrench menu for setting the current consumption and the switch-off point.\n"..
"\n"..
"If the power stored in the power grid falls below the specified value of the switch-off point\\, the electrolyzer switches off automatically. This prevents the storage systems from running empty.\n"..
"\n"..
"\n"..
"\n",
"The fuel cell converts hydrogen into electricity.\n"..

View File

@ -18,7 +18,8 @@ local Stone2Gravel = {
["default:stone"] = "default:gravel",
["default:cobble"] = "default:gravel",
["default:desert_stone"] = "default:gravel",
["techage:basalt_stone"] = "techage:basalt_gravel", ["techage:basalt_cobble"] = "techage:basalt_gravel",
["techage:basalt_stone"] = "techage:basalt_gravel",
["techage:basalt_cobble"] = "techage:basalt_gravel",
["techage:bauxite_stone"] = "techage:bauxite_gravel",
["techage:bauxite_cobble"] = "techage:bauxite_gravel",
}
@ -30,6 +31,7 @@ end
local function handler(player_name, node, itemstack, digparams)
local pos = techage.dug_node[player_name]
if not pos then return end
techage.dug_node[player_name] = nil
if minetest.is_protected(pos, player_name) then
minetest.record_protection_violation(pos, player_name)
@ -43,6 +45,7 @@ local function handler(player_name, node, itemstack, digparams)
local item = ItemStack(ndef.drop or node.name)
local inv = minetest.get_inventory({type="player", name=player_name})
if inv and inv:room_for_item("main", item) then
-- item should have been added and can therefore be removed again
local taken = inv:remove_item("main", item)
else
for _,obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
@ -74,7 +77,9 @@ minetest.register_tool("techage:hammer_stone", {
},
sound = {breaks = "default_tool_breaks"},
after_use = function(itemstack, user, node, digparams)
minetest.after(0.01, handler, user:get_player_name(), node)
if minetest.is_player(user) then
minetest.after(0.01, handler, user:get_player_name(), node)
end
itemstack:add_wear(digparams.wear)
return itemstack
end,
@ -93,7 +98,9 @@ minetest.register_tool("techage:hammer_bronze", {
},
sound = {breaks = "default_tool_breaks"},
after_use = function(itemstack, user, node, digparams)
minetest.after(0.01, handler, user:get_player_name(), node)
if minetest.is_player(user) then
minetest.after(0.01, handler, user:get_player_name(), node)
end
itemstack:add_wear(digparams.wear)
return itemstack
end,
@ -112,7 +119,9 @@ minetest.register_tool("techage:hammer_steel", {
},
sound = {breaks = "default_tool_breaks"},
after_use = function(itemstack, user, node, digparams)
minetest.after(0.01, handler, user:get_player_name(), node)
if minetest.is_player(user) then
minetest.after(0.01, handler, user:get_player_name(), node)
end
itemstack:add_wear(digparams.wear)
return itemstack
end,
@ -131,7 +140,9 @@ minetest.register_tool("techage:hammer_mese", {
},
sound = {breaks = "default_tool_breaks"},
after_use = function(itemstack, user, node, digparams)
minetest.after(0.01, handler, user:get_player_name(), node)
if minetest.is_player(user) then
minetest.after(0.01, handler, user:get_player_name(), node)
end
itemstack:add_wear(digparams.wear)
return itemstack
end,
@ -150,7 +161,9 @@ minetest.register_tool("techage:hammer_diamond", {
},
sound = {breaks = "default_tool_breaks"},
after_use = function(itemstack, user, node, digparams)
minetest.after(0.01, handler, user:get_player_name(), node)
if minetest.is_player(user) then
minetest.after(0.01, handler, user:get_player_name(), node)
end
itemstack:add_wear(digparams.wear)
return itemstack
end,

View File

@ -5,7 +5,7 @@
import re
import sys
import pprint
import mistune # must be v0.8.4
import mistune # must be v0.8.4, install with 'sudo pip install mistune==0.8.4'
def formspec_escape(text):
text = text.replace("\\", "")