merge easyvend repository
commit
efe49d481c
25
README.md
25
README.md
|
@ -1,5 +1,5 @@
|
|||
# Easy Vending Machines [`easyvend`]
|
||||
Version: 0.4.0
|
||||
Version: 0.4.3
|
||||
|
||||
Adds vending and depositing machines which allow to buy and sell items from other players.
|
||||
|
||||
|
@ -7,7 +7,7 @@ Help is included as help entry for Item Documentation [`doc_items`].
|
|||
|
||||
## Converting machines from `vendor` mod (experimental)
|
||||
This mod is able to automatically transform the vending and depositing
|
||||
machines from Bad\_Command_'s Vending machines [`vendor`] mod on loading
|
||||
machines from Bad\_Command\_'s Vending machines [`vendor`] mod on loading
|
||||
and turn them into the new machines from `easyvend`. This is useful if
|
||||
you want to switch a world from `vendor` to `easyvend`.
|
||||
|
||||
|
@ -33,7 +33,20 @@ keep as many machines in operation as possible. Machines with very high values
|
|||
be reconfigured by their owners. Most machines which worked before will likely
|
||||
stay in operation afterwards.
|
||||
|
||||
## Licenses
|
||||
- Code: LGPL 2.1. Forked from mod “Vending Machines” [vendor] by Bad_Command_.
|
||||
- Sounds: CC-BY 3.0/CC-BY-SA 3.0/GPL 3.0/GPL 2.0
|
||||
- Textures: MIT License
|
||||
## Credits and licenses
|
||||
- Code
|
||||
- License: [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)
|
||||
- Source: Forked from mod “Vending Machines” [vendor] by Bad\_Command\_.
|
||||
- Authors: Bad\_Command\_ and Wuzzy
|
||||
- Textures
|
||||
- License: MIT License
|
||||
- Author: Wuzzy
|
||||
- Sounds
|
||||
- Any of the following licenses apply:
|
||||
- [CC-BY 3.0](https://creativecommons.org/licenses/by/3.0/)
|
||||
- [CC-BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)
|
||||
- [GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
- [GPL 2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0)
|
||||
- Original title of the work: “Inventory Sound Effects”
|
||||
- Source: [OpenGameArt](http://opengameart.org/content/inventory-sound-effects)
|
||||
- Authors: [OpenGameArt](http://opengameart.org/) user artisticdude, edited by Bad\_Command\_
|
||||
|
|
15
easyvend.lua
15
easyvend.lua
|
@ -486,7 +486,12 @@ easyvend.make_infotext = function(nodename, owner, cost, number, itemstring)
|
|||
end
|
||||
return d
|
||||
end
|
||||
local iname = minetest.registered_items[itemstring].description
|
||||
local iname
|
||||
if minetest.registered_items[itemstring] then
|
||||
iname = minetest.registered_items[itemstring].description
|
||||
else
|
||||
iname = string.format("Unknown Item (%s)", itemstring)
|
||||
end
|
||||
if iname == nil then iname = itemstring end
|
||||
local printitem, printcost
|
||||
if number == 1 then
|
||||
|
@ -536,7 +541,7 @@ easyvend.check_earnings = function(buyername, nodemeta)
|
|||
local cost = nodemeta:get_int("cost")
|
||||
local itemname = nodemeta:get_string("itemname")
|
||||
-- First sell
|
||||
if minetest.get_player_by_name(owner) ~= nil and minetest.get_modpath("awards") then
|
||||
if minetest.get_modpath("awards") and minetest.get_player_by_name(owner) ~= nil then
|
||||
awards.unlock(owner, "easyvend_seller")
|
||||
end
|
||||
if itemname ~= easyvend.currency then
|
||||
|
@ -1145,7 +1150,7 @@ easyvend.find_chest = function(owner, pos, dy, itemname, check_wear, amount, rem
|
|||
end
|
||||
local inv = meta:get_inventory()
|
||||
if (inv ~= nil) then
|
||||
if (itemname ~= nil and amount ~= nil and removing ~= nil and check_wear ~= nil) then
|
||||
if (itemname ~= nil and minetest.registered_items[itemname] and amount ~= nil and removing ~= nil and check_wear ~= nil) then
|
||||
local chest_has, chest_free
|
||||
local stack = {name=itemname, count=amount, wear=0, metadata=""}
|
||||
local stack_max = minetest.registered_items[itemname].stack_max
|
||||
|
@ -1169,7 +1174,11 @@ easyvend.find_chest = function(owner, pos, dy, itemname, check_wear, amount, rem
|
|||
else
|
||||
return pos, internal
|
||||
end
|
||||
else
|
||||
return nil, internal
|
||||
end
|
||||
else
|
||||
return nil, internal
|
||||
end
|
||||
elseif (node.name ~= "easyvend:vendor" and node.name~="easyvend:depositor" and node.name~="easyvend:vendor_on" and node.name~="easyvend:depositor_on") then
|
||||
return nil, internal
|
||||
|
|
10
init.lua
10
init.lua
|
@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
easyvend = {}
|
||||
easyvend.VERSION = {}
|
||||
easyvend.VERSION.MAJOR = 0
|
||||
easyvend.VERSION.MINOR = 3
|
||||
easyvend.VERSION.PATCH = 0
|
||||
easyvend.VERSION.MINOR = 4
|
||||
easyvend.VERSION.PATCH = 3
|
||||
easyvend.VERSION.STRING = easyvend.VERSION.MAJOR .. "." .. easyvend.VERSION.MINOR .. "." .. easyvend.VERSION.PATCH
|
||||
|
||||
-- Set item which is used as payment for vending and depositing machines
|
||||
|
@ -132,7 +132,7 @@ if minetest.get_modpath("default") ~= nil then
|
|||
})
|
||||
end
|
||||
|
||||
if minetest.get_modpath("doc") ~= nil then
|
||||
doc.add_entry_alias("nodes", "easyvend:vendor", "easyvend:vendor_on")
|
||||
doc.add_entry_alias("nodes", "easyvend:depositor", "easyvend:depositor_on")
|
||||
if minetest.get_modpath("doc") ~= nil and minetest.get_modpath("doc_items") ~= nil then
|
||||
doc.add_entry_alias("nodes", "easyvend:vendor", "nodes", "easyvend:vendor_on")
|
||||
doc.add_entry_alias("nodes", "easyvend:depositor", "nodes", "easyvend:depositor_on")
|
||||
end
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
Sounds effects derived from:
|
||||
http://opengameart.org/content/inventory-sound-effects
|
||||
|
||||
Applicable licenses:
|
||||
CC-BY 3.0 CC-BY-SA 3.0 GPL 3.0 GPL 2.0
|
Loading…
Reference in New Issue