Add chat command /stopcart

master
Joachim Stolberg 2021-09-02 21:27:39 +02:00
parent 76565f25ce
commit 0cafcf17f6
4 changed files with 32 additions and 4 deletions

View File

@ -35,6 +35,7 @@ local summary_doc = table.concat({
S("10. Check the cart state via the chat command: /mycart <num>\n '<num>' is the cart number"),
S("11. Drop items into the Minecart and punch the cart to start it."),
S("12. Dig the cart with 'sneak+click' (as usual). The items will be drop down."),
S("13. To retrieve lost carts, use the chat command: /stopcart <num>"),
}, "\n")
local cart_doc = S("Primary used to transport items. You can drop items into the Minecart and punch the cart to get started. Sneak+click the cart to get cart and items back")

View File

@ -13,9 +13,10 @@ Summary=Zusammenfassung
7. Optional: Configure the Minecart waiting time in both buffers. The Minecart will then start automatically after the configured time.=7. Optional: Konfiguriere die Wagenwartezeit in beiden Prellböcken. Der Wagen startet dann nach dieser Zeit automatisch.
8. Optional: Protect your rail network with the Protection Landmarks (one Landmark at least every 16 nodes/meters).=8. Optional: Schütze deine Schienen mit Hilfe der Meilensteine (ein Meilenstein mindestens alle 16 Blöcke).
9. Place a Minecart in front of the buffer and check whether it starts after the configured time.=9. Platziere einen Wagen direkt vor einem Prellbock und prüfe, ob er nach der konfigurierten Zeit startet.
10. Check the cart state via the chat command: /mycart <num>@n '<num>' is the cart number=Prüfe den Status des Wagen mit dem Chat Kommando: /mycart <num>@n <num> ist die Wagennummer
10. Check the cart state via the chat command: /mycart <num>@n '<num>' is the cart number=10. Prüfe den Status des Wagen mit dem Chat Kommando: /mycart <num>@n <num> ist die Wagennummer
11. Drop items into the Minecart and punch the cart to start it.=11: Lege Gegenstände in ein Wagen (Taste Q) und starte dann den Wagen durch Anklicken.
12. Dig the cart with 'sneak+click' (as usual). The items will be drop down.=10. Klicke mit gedrückter Shift-Taste auf den Wagen, um diesen zu entfernen. Die Gegenstände fallen dann zu Boden.
12. Dig the cart with 'sneak+click' (as usual). The items will be drop down.=12. Klicke mit gedrückter Shift-Taste auf den Wagen, um diesen zu entfernen. Die Gegenstände fallen dann zu Boden.
13. To retrieve lost carts, use the chat command: /stopcart <num>=13. Um verirrte Waren zurückzuholen, verwende den Chat-Befehl: /stopcart <num>
Primary used to transport items. You can drop items into the Minecart and punch the cart to get started. Sneak+click the cart to get cart and items back=Primär für den Transport von Gegenständen genutzt. Du kannst Gegenstände in ein Cart legen (Taste Q) und dann den Wagen durch Anklicken starten. Klicke mit gedrückter Shift-Taste auf den Wagen, um Cart und Gegenstände zurückzuerhalten
Used as buffer on both rail ends. Needed to be able to record the cart routes=Preckblöcke müssen an beiden Schienenenden platziert sein, so dass Aufzeichnungen der Strecke gemacht werden können.
Protect your rails with the Landmarks (one Landmark at least every 16 blocks near the rail)=Schütze deine Schienen mit Hilfe der Meilensteine (ein Meilenstein mindestens alle 16 Blöcke der Strecke entlang)
@ -29,14 +30,15 @@ Limit the cart speed with speed limit signs.@n@nAs before, the speed of the cart
Minecart Railway Buffer=Minecart Prellbock
Minecart Hopper=Minecart Hopper
Minecart Landmark=Minecart Meilenstein
Cart Pusher=Wagen Anschieber
Minecart (Sneak+Click to pick up)=Minecart (Shift+Klick zum Entfernen des Carts)
Output cart state and position, or a list of carts, if no cart number is given.=Gibt Status und Position des Wagens, oder eine Liste aller Wagen aus, wenn keine Wagennummer angegeben ist.
List of carts=Liste aller Wagen
Stop amd return a missing/running cart.=Stoppe und hole einen vermissten Wagen zurück.
Enter cart number=Gebe Cart Nummer ein
Save=Speichern
[minecart] Area is protected!=[minecart] Bereich ist geschützt!
Allow to dig/place rails in Minecart Landmark areas=Erlaubt dir, Schienen in Meilensteinbereichen zu setzen/zu entfernen
Cart Pusher=Wagen Anschieber
left=links
right=rechts
straight=geradeaus

View File

@ -16,6 +16,7 @@ Summary=
10. Check the cart state via the chat command: /mycart <num>@n '<num>' is the cart number=
11. Drop items into the Minecart and punch the cart to start it.=
12. Dig the cart with 'sneak+click' (as usual). The items will be drop down.=
13. For missing carts use the chat command: /stopcart <num>=
Primary used to transport items. You can drop items into the Minecart and punch the cart to get started. Sneak+click the cart to get cart and items back=
Used as buffer on both rail ends. Needed to be able to record the cart routes=
Protect your rails with the Landmarks (one Landmark at least every 16 blocks near the rail)=
@ -29,14 +30,15 @@ Limit the cart speed with speed limit signs.@n@nAs before, the speed of the cart
Minecart Railway Buffer=
Minecart Hopper=
Minecart Landmark=
Cart Pusher=
Minecart (Sneak+Click to pick up)=
Output cart state and position, or a list of carts, if no cart number is given.=
List of carts=
Stop amd return a missing/running cart.=
Enter cart number=
Save=
[minecart] Area is protected!=
Allow to dig/place rails in Minecart Landmark areas=
Cart Pusher=
left=
right=
straight=

View File

@ -243,6 +243,29 @@ minetest.register_chatcommand("mycart", {
end
})
minetest.register_chatcommand("stopcart", {
params = "<cart-num>",
description = S("Stop amd return a missing/running cart."),
func = function(owner, param)
local userID = tonumber(param)
local player_pos = minetest.get_player_by_name(owner):get_pos()
if userID then
local data = minecart.get_cart_monitoring_data(owner, userID)
if data.objID and data.objID ~= 0 then
local entity = minetest.luaentities[data.objID]
if entity then -- cart entity running
minecart.entity_to_node(player_pos, entity)
end
else
local pos = data.last_pos or data.pos
local cargo, owner, userID = minecart.remove_nodecart(pos)
minecart.add_nodecart(player_pos, data.node_name, 0, cargo, owner, userID)
end
return true
end
end
})
function minecart.cmnd_cart_state(name, userID)
local state, loc = get_cart_state_and_loc(name, userID, {x=0, y=0, z=0})
return state