Add chat command /stopcart

master
Joachim Stolberg 2021-09-02 21:46:59 +02:00
parent 0cafcf17f6
commit 5c1df83f7f
3 changed files with 19 additions and 14 deletions

View File

@ -35,6 +35,9 @@ 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.
Cart=Wagen
stopped=gestoppt
is not existing!=existiert nicht!
Enter cart number=Gebe Cart Nummer ein
Save=Speichern
[minecart] Area is protected!=[minecart] Bereich ist geschützt!
@ -55,8 +58,3 @@ Speed "4"=Tempo "4"
No speed limit=Keine Geschwindigkeitsbegrenzung
Cart List=Cart Liste
Cart Terminal=Cart Terminal
##### not used anymore #####
Used to push a cart if the cart does not stop directly at a buffer. Block has to be placed below the rail.=Wird verwendet, um einen Wagen anzuschieben, wenn der Wagen nicht direkt an einem Puffer anhält. Der Block muss unter der Schiene platziert werden.

View File

@ -16,7 +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>=
13. To retrieve lost 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)=
@ -35,6 +35,9 @@ 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.=
Cart=
stopped=
is not existing!=
Enter cart number=
Save=
[minecart] Area is protected!=

View File

@ -251,17 +251,21 @@ minetest.register_chatcommand("stopcart", {
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)
if data then
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, S("Cart") .. " " .. userID .. " " .. S("stopped")
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)
return false, S("Cart") .. " " .. userID .. " " .. S("is not existing!")
end
return true
end
end
})