Implement Mining Laser

Mining Laser allows for quick node mining via shooting the beam. It comes with following modes:
- normal range
- short range
- horizontal direction
- explosion
This commit is contained in:
2024-01-20 14:35:14 +01:00
parent e95a2a7cc1
commit 359af1e57a
4 changed files with 208 additions and 2 deletions

View File

@@ -92,7 +92,8 @@ end
industrialtest.api.updateItemPowerText=function(itemstack)
local meta=itemstack:get_meta()
local def=minetest.registered_tools[itemstack:get_name()]
meta:set_string("description",S("@1\n@2 / @3 EU",def.description,meta:get_int("industrialtest.powerAmount"),meta:get_int("industrialtest.powerCapacity")))
local desc=meta:contains("industrialtest.descriptionOverride") and meta:get_string("industrialtest.descriptionOverride") or def.description
meta:set_string("description",S("@1\n@2 / @3 EU",desc,meta:get_int("industrialtest.powerAmount"),meta:get_int("industrialtest.powerCapacity")))
itemstack:set_wear(65535-meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*65534)
end
-- \brief Adds power storage to item depending on it's definition