Merge pull request #1 from PiezoU005F/patch-1

Add actual item name and make item non-single-use
master
Christian 2018-09-15 10:03:50 +02:00 committed by GitHub
commit c35b915b4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ dofile(minetest.get_modpath("parachute") .. "/getplayervelocity.lua")
minetest.register_craftitem("parachute:parachute_item", {
inventory_image = "parachute_inv.png",
wield_image = "parachute_inv.png",
description = "Parachute",
on_use = function(itemstack, user, pointed_thing)
local pos = user:getpos()
local on = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
@ -23,7 +24,7 @@ minetest.register_craftitem("parachute:parachute_item", {
ent = ent:get_luaentity()
ent.attached = user:get_player_name()
-- Decrease itemstack
itemstack:take_item()
-- itemstack:take_item()
return itemstack
else
minetest.chat_send_player(user:get_player_name(), "Cannot open parachute on ground!")