pax_global_header 0000666 0000000 0000000 00000000064 13371150712 0014512 g ustar 00root root 0000000 0000000 52 comment=43159249ed85c8f486a7eed4b2b9eae109c6864f
currency-2018-11-09/ 0000775 0000000 0000000 00000000000 13371150712 0013745 5 ustar 00root root 0000000 0000000 currency-2018-11-09/LICENSE 0000664 0000000 0000000 00000066575 13371150712 0014775 0 ustar 00root root 0000000 0000000 License for code: LGPL 3.0
License for media and all other assets: CC-by-SA 4.0
###############################################################################
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
###############################################################################
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.
currency-2018-11-09/Money_Info.txt 0000664 0000000 0000000 00000001352 13371150712 0016551 0 ustar 00root root 0000000 0000000 Minegeld
---------
They have no recipe.
In general, one Mg equals one US dollar, as of Sept. 2018.
A good starting amount is about 250 Mg on a server
You currently get a basic income of 10 Minegeld per day, so long as you dig at
least one node in that day and have an empty inventory slot for the money to
go in.
Lump Conversion suggestions:
Coal Lump 1 Mg
Iron Lump 4 Mg
Copper Lump 4 Mg
Gold Lump 5 Mg
Mese Crystal 40 Mg
Diamond 50 Mg
Ingot Conversion
Steel Ingot 5 Mg
Copper Ingot 5 Mg
Gold Ingot 6 Mg
Block Conversion
Coal Block 9 Mg
Steel Block 45 Mg
Copper Block 45 Mg
Gold Block 54 Mg
Mese Block 360 Mg
Diamond Block 450 Mg
currency-2018-11-09/README.md 0000664 0000000 0000000 00000000051 13371150712 0015220 0 ustar 00root root 0000000 0000000 currency
========
Repo for Currency Mod
currency-2018-11-09/barter.lua 0000664 0000000 0000000 00000013370 13371150712 0015733 0 ustar 00root root 0000000 0000000 barter = {}
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
barter.chest = {}
barter.chest.formspec = {
main = "size[8,9]"..
"list[current_name;pl1;0,0;3,4;]"..
"list[current_name;pl2;5,0;3,4;]"..
"list[current_player;main;0,5;8,4;]",
pl1 = {
start = "button[3,1;1,1;pl1_start;" .. S("Start") .. "]",
player = function(name) return "label[3,0;"..name.."]" end,
accept1 = "button[3,1;1,1;pl1_accept1;" .. S("Confirm") .. "]"..
"button[3,2;1,1;pl1_cancel;" .. S("Cancel") .. "]",
accept2 = "button[3,1;1,1;pl1_accept2;" .. S("Exchange") .. "]"..
"button[3,2;1,1;pl1_cancel;" .. S("Cancel") .. "]",
},
pl2 = {
start = "button[4,1;1,1;pl2_start;" .. S("Start") .. "]",
player = function(name) return "label[4,0;"..name.."]" end,
accept1 = "button[4,1;1,1;pl2_accept1;" .. S("Confirm") .. "]"..
"button[4,2;1,1;pl2_cancel;" .. S("Cancel") .. "]",
accept2 = "button[4,1;1,1;pl2_accept2;" .. S("Exchange") .. "]"..
"button[4,2;1,1;pl2_cancel;" .. S("Cancel") .. "]",
},
}
barter.chest.check_privilege = function(listname,playername,meta)
if listname == "pl1" then
if playername ~= meta:get_string("pl1") then
return false
elseif meta:get_int("pl1step") ~= 1 then
return false
end
end
if listname == "pl2" then
if playername ~= meta:get_string("pl2") then
return false
elseif meta:get_int("pl2step") ~= 1 then
return false
end
end
return true
end
barter.chest.update_formspec = function(meta)
formspec = barter.chest.formspec.main
pl_formspec = function (n)
if meta:get_int(n.."step")==0 then
formspec = formspec .. barter.chest.formspec[n].start
else
formspec = formspec .. barter.chest.formspec[n].player(meta:get_string(n))
if meta:get_int(n.."step") == 1 then
formspec = formspec .. barter.chest.formspec[n].accept1
elseif meta:get_int(n.."step") == 2 then
formspec = formspec .. barter.chest.formspec[n].accept2
end
end
end
pl_formspec("pl1") pl_formspec("pl2")
meta:set_string("formspec",formspec)
end
barter.chest.give_inventory = function(inv,list,playername)
player = minetest.get_player_by_name(playername)
if player then
for k,v in ipairs(inv:get_list(list)) do
player:get_inventory():add_item("main",v)
inv:remove_item(list,v)
end
end
end
barter.chest.cancel = function(meta)
barter.chest.give_inventory(meta:get_inventory(),"pl1",meta:get_string("pl1"))
barter.chest.give_inventory(meta:get_inventory(),"pl2",meta:get_string("pl2"))
meta:set_string("pl1","")
meta:set_string("pl2","")
meta:set_int("pl1step",0)
meta:set_int("pl2step",0)
end
barter.chest.exchange = function(meta)
barter.chest.give_inventory(meta:get_inventory(),"pl1",meta:get_string("pl2"))
barter.chest.give_inventory(meta:get_inventory(),"pl2",meta:get_string("pl1"))
meta:set_string("pl1","")
meta:set_string("pl2","")
meta:set_int("pl1step",0)
meta:set_int("pl2step",0)
end
minetest.register_node("currency:barter", {
drawtype = "nodebox",
description = S("Barter Table"),
paramtype = "light",
paramtype2 = "facedir",
tiles = {"barter_top.png",
"barter_base.png",
"barter_side.png"},
inventory_image = "barter_top.png",
node_box = {
type = "fixed",
fixed = {
{-0.500000,0.312500,-0.500000,0.500000,0.500000,0.500000},
{-0.437500,-0.500000,-0.437500,-0.250000,0.500000,-0.250000},
{-0.437500,-0.500000,0.250000,-0.250000,0.500000,0.437500},
{0.250000,-0.500000,-0.437500,0.437500,0.500000,-0.250000},
{0.250000,-0.500000,0.250000,0.437500,0.500000,0.447500},
},
},
groups = {choppy=2,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Barter Table"))
meta:set_string("pl1","")
meta:set_string("pl2","")
barter.chest.update_formspec(meta)
local inv = meta:get_inventory()
inv:set_size("pl1", 3*4)
inv:set_size("pl2", 3*4)
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
pl_receive_fields = function(n)
if fields[n.."_start"] and meta:get_string(n) == "" then
meta:set_string(n,sender:get_player_name())
end
if meta:get_string(n) == "" then
meta:set_int(n.."step",0)
elseif meta:get_int(n.."step")==0 then
meta:set_int(n.."step",1)
end
if sender:get_player_name() == meta:get_string(n) then
if meta:get_int(n.."step")==1 and fields[n.."_accept1"] then
meta:set_int(n.."step",2)
end
if meta:get_int(n.."step")==2 and fields[n.."_accept2"] then
meta:set_int(n.."step",3)
if n == "pl1" and meta:get_int("pl2step") == 3 then barter.chest.exchange(meta) end
if n == "pl2" and meta:get_int("pl1step") == 3 then barter.chest.exchange(meta) end
end
if fields[n.."_cancel"] then barter.chest.cancel(meta) end
end
end
pl_receive_fields("pl1") pl_receive_fields("pl2")
-- End
barter.chest.update_formspec(meta)
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if not barter.chest.check_privilege(from_list,player:get_player_name(),meta) then return 0 end
if not barter.chest.check_privilege(to_list,player:get_player_name(),meta) then return 0 end
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not barter.chest.check_privilege(listname,player:get_player_name(),meta) then return 0 end
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not barter.chest.check_privilege(listname,player:get_player_name(),meta) then return 0 end
return stack:get_count()
end,
})
currency-2018-11-09/crafting.lua 0000664 0000000 0000000 00000006351 13371150712 0016252 0 ustar 00root root 0000000 0000000 minetest.register_craft({
output = 'currency:safe',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:mese_crystal', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'currency:shop',
recipe = {
{'default:sign_wall'},
{'default:chest_locked'},
}
})
minetest.register_craft({
output = 'currency:barter',
recipe = {
{'default:sign_wall'},
{'default:chest'},
}
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_cent_10",
recipe = {
"currency:minegeld_cent_5",
"currency:minegeld_cent_5"
},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_cent_5 2",
recipe = {"currency:minegeld_cent_10"},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_cent_25",
recipe = {
"currency:minegeld_cent_5",
"currency:minegeld_cent_5",
"currency:minegeld_cent_5",
"currency:minegeld_cent_5",
"currency:minegeld_cent_5"
},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_cent_5 5",
recipe = {"currency:minegeld_cent_25"},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld",
recipe = {
"currency:minegeld_cent_25",
"currency:minegeld_cent_25",
"currency:minegeld_cent_25",
"currency:minegeld_cent_25"
},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_cent_25 4",
recipe = {"currency:minegeld"},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_5",
recipe = {
"currency:minegeld",
"currency:minegeld",
"currency:minegeld",
"currency:minegeld",
"currency:minegeld"
},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld 5",
recipe = {"currency:minegeld_5"},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_10",
recipe = {
"currency:minegeld_5",
"currency:minegeld_5"
},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_5 2",
recipe = {"currency:minegeld_10"},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld 5",
recipe = {"currency:minegeld_5"},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_10 5",
recipe = {"currency:minegeld_50"},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_50",
recipe = {
"currency:minegeld_10",
"currency:minegeld_10",
"currency:minegeld_10",
"currency:minegeld_10",
"currency:minegeld_10"
},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_100",
recipe = {
"currency:minegeld_50",
"currency:minegeld_50"
},
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_50 2",
recipe = {"currency:minegeld_100" },
})
minetest.register_craft({
type = "shapeless",
output = "currency:minegeld_bundle",
recipe = {
"group:minegeld",
"group:minegeld",
"group:minegeld",
"group:minegeld",
"group:minegeld",
"group:minegeld",
"group:minegeld",
"group:minegeld",
"group:minegeld"
},
})
minetest.register_craft({
type = "fuel",
recipe = "currency:minegeld_bundle",
burntime = 1,
})
currency-2018-11-09/craftitems.lua 0000664 0000000 0000000 00000003407 13371150712 0016615 0 ustar 00root root 0000000 0000000 -- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
minetest.register_craftitem("currency:minegeld_cent_5", {
description = S("5 Minegeld cent coin"),
inventory_image = "minegeld_cent_5.png",
stack_max = 1000,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_cent_10", {
description = S("10 Minegeld cent coin"),
inventory_image = "minegeld_cent_10.png",
stack_max = 1000,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_cent_25", {
description = S("25 Minegeld cent coin"),
inventory_image = "minegeld_cent_25.png",
stack_max = 1000,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld", {
description = S("1 Minegeld Note"),
inventory_image = "minegeld.png",
stack_max = 65535,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_5", {
description = S("5 Minegeld Note"),
inventory_image = "minegeld_5.png",
stack_max = 65535,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_10", {
description = S("10 Minegeld Note"),
inventory_image = "minegeld_10.png",
stack_max = 65535,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_50", {
description = S("50 Minegeld Note"),
inventory_image = "minegeld_50.png",
stack_max = 65535,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_100", {
description = S("100 Minegeld Note"),
inventory_image = "minegeld_100.png",
stack_max = 65535,
groups = {minegeld = 1}
})
minetest.register_craftitem("currency:minegeld_bundle", {
description = S("Bundle of random Minegeld notes"),
inventory_image = "minegeld_bundle.png",
stack_max = 65535,
})
currency-2018-11-09/depends.txt 0000664 0000000 0000000 00000000042 13371150712 0016124 0 ustar 00root root 0000000 0000000 default
intllib?
loot?
pipeworks?
currency-2018-11-09/description.txt 0000664 0000000 0000000 00000000141 13371150712 0017025 0 ustar 00root root 0000000 0000000 Provides shops, barter tables, safes, and multiple denominations of currency, called "Minegeld".
currency-2018-11-09/income.lua 0000664 0000000 0000000 00000002356 13371150712 0015730 0 ustar 00root root 0000000 0000000 players_income = {}
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local timer = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime;
if timer >= 720 then --720 for one day
timer = 0
for _,player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
if players_income[name] == nil then
players_income[name] = 0
end
players_income[name] = 1
minetest.log("info", "[Currency] "..S("basic income for @1", name))
end
end
end)
earn_income = function(player)
if not player or player.is_fake_player then return end
local name = player:get_player_name()
if players_income[name] == nil then
players_income[name] = 0
end
if players_income[name] > 0 then
count = players_income[name]
local inv = player:get_inventory()
inv:add_item("main", {name="currency:minegeld_10", count=count})
players_income[name] = 0
minetest.log("info", "[Currency] "..S("added basic income for @1 to inventory", name))
end
end
minetest.register_on_dignode(function(pos, oldnode, digger)
earn_income(digger)
end)
minetest.register_on_placenode(function(pos, node, placer)
earn_income(placer)
end)
currency-2018-11-09/init.lua 0000664 0000000 0000000 00000001546 13371150712 0015421 0 ustar 00root root 0000000 0000000 local modpath = minetest.get_modpath("currency")
-- internationalization boilerplate
local S, NS = dofile(modpath.."/intllib.lua")
minetest.log("info", S("Currency mod loading..."))
dofile(modpath.."/craftitems.lua")
minetest.log("info", "[Currency] "..S("Craft_items Loaded!"))
dofile(modpath.."/shop.lua")
minetest.log("info", "[Currency] "..S("Shop Loaded!"))
dofile(modpath.."/barter.lua")
minetest.log("info", "[Currency] "..S("Barter Loaded!"))
dofile(modpath.."/safe.lua")
minetest.log("info", "[Currency] "..S("Safe Loaded!"))
dofile(modpath.."/crafting.lua")
minetest.log("info", "[Currency] "..S("Crafting Loaded!"))
if minetest.settings:get_bool("creative_mode") then
minetest.log("info", "[Currency] "..S("Creative mode in use, skipping basic income."))
else
dofile(modpath.."/income.lua")
minetest.log("info", "[Currency] "..S("Income Loaded!"))
end
currency-2018-11-09/intllib.lua 0000664 0000000 0000000 00000002142 13371150712 0016104 0 ustar 00root root 0000000 0000000
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense .
-- Get the latest version of this file at:
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
local function format(str, ...)
local args = { ... }
local function repl(escape, open, num, close)
if escape == "" then
local replacement = tostring(args[tonumber(num)])
if open == "" then
replacement = replacement..close
end
return replacement
else
return "@"..open..num..close
end
end
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end
local gettext, ngettext
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
gettext, ngettext = intllib.make_gettext_pair()
else
-- Old method using text files.
gettext = intllib.Getter()
end
end
-- Fill in missing functions.
gettext = gettext or function(msgid, ...)
return format(msgid, ...)
end
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
return format(n==1 and msgid or msgid_plural, ...)
end
return gettext, ngettext
currency-2018-11-09/locale/ 0000775 0000000 0000000 00000000000 13371150712 0015204 5 ustar 00root root 0000000 0000000 currency-2018-11-09/locale/de.po 0000664 0000000 0000000 00000007534 13371150712 0016145 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-24 22:01+0200\n"
"PO-Revision-Date: 2018-05-24 22:48+0200\n"
"Last-Translator: A.C.M. \n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.7\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: barter.lua
msgid "Start"
msgstr "Start"
#: barter.lua
msgid "Confirm"
msgstr "Bestätigen"
#: barter.lua
msgid "Cancel"
msgstr "Abbruch"
#: barter.lua shop.lua
msgid "Exchange"
msgstr "Tausch"
#: barter.lua
msgid "Barter Table"
msgstr "Tausch Tisch"
#: craftitems.lua
msgid "1 MineGeld Note"
msgstr "1 Minegeld Banknote"
#: craftitems.lua
msgid "5 MineGeld Note"
msgstr "5 Minegeld Banknote"
#: craftitems.lua
msgid "10 MineGeld Note"
msgstr "10 Minegeld Banknote"
#: craftitems.lua
msgid "50 MineGeld Note"
msgstr "50 Minegeld Banknote"
#: craftitems.lua
msgid "Bundle of random Minegeld notes"
msgstr "Bündel von verschiedenen Minegeld Banknoten"
#: income.lua
msgid "basic income for @1"
msgstr "Grundeinkommen für @1"
#: income.lua
msgid "added basic income for @1 to inventory"
msgstr "Grundeinkommen für @1 ins Inventar gelegt"
#: init.lua
msgid "Currency mod loading..."
msgstr "Currency mod lädt..."
#: init.lua
msgid "Craft_items Loaded!"
msgstr "Craft_items geladen!"
#: init.lua
msgid "Shop Loaded!"
msgstr "Geschäft geladen!"
#: init.lua
msgid "Barter Loaded!"
msgstr "Tauschtisch geladen!"
#: init.lua
msgid "Safe Loaded!"
msgstr "Safe geladen!"
#: init.lua
msgid "Crafting Loaded!"
msgstr "Crafting geladen!"
#: init.lua
msgid "Creative mode in use, skipping basic income."
msgstr "Kreativmodus eingeschalten, überspringe Grundeinkommen."
#: init.lua
msgid "Income Loaded!"
msgstr "Income geladen!"
#: safe.lua
msgid "Safe"
msgstr "Safe"
#: safe.lua
msgid "Safe (owned by @1)"
msgstr "Safe (gehört @1)"
#: safe.lua
msgid "@1 tried to access a safe belonging to @2 at @3"
msgstr "@1 versuchte den Zugriff auf Safe von @2 bei @3"
#: safe.lua
msgid "@1 moves stuff in safe at @2"
msgstr "@1 verschiebt Gegenstände in den Safe bei @2"
#: safe.lua
msgid "@1 moves stuff to safe at @2"
msgstr "@1 verschiebt Gegenstände nach Safe bei @2"
#: safe.lua
msgid "@1 takes stuff from safe at @2"
msgstr "@1 nimmt Gegenstände aus Safe bei @2"
#: shop.lua
msgid "Customer gives (pay here!)"
msgstr "Kunde gibt (bezahl hier!)"
#: shop.lua
msgid "Customer gets:"
msgstr "Kunde bekommt:"
#: shop.lua
msgid "Owner wants:"
msgstr "Inhaber will:"
#: shop.lua
msgid "Owner gives:"
msgstr "Inhaber gibt:"
#: shop.lua
msgid "Customers gave:"
msgstr "Kunde gab:"
#: shop.lua
msgid "Your stock:"
msgstr "Dein Lager:"
#: shop.lua
msgid "You want:"
msgstr "Du willst:"
#: shop.lua
msgid "In exchange, you give:"
msgstr "Im Tausch, du gibst:"
#: shop.lua
msgid "Owner, Use (E)+Place (right mouse button) for customer interface"
msgstr "Inhaber, Benutze (E)+Platziere (rechte Maustaste) für Kunde ..."
#: shop.lua
msgid "Shop"
msgstr "Geschäft"
#: shop.lua
msgid "Exchange shop (owned by @1)"
msgstr "Tauschgeschäft (gehört @1)"
#: shop.lua
msgid "This is your own shop, you can't exchange to yourself!"
msgstr "Das ist dein eigenes Geschäft, du kannst nicht mit dir selbst tauschen!"
#: shop.lua
msgid "Exchanged!"
msgstr "Getauscht!"
#: shop.lua
msgid "Exchange can not be done, contact the shop owner."
msgstr "Tausch kann nicht abgeschlossen werden, benachrichtige den Geschäftsinhaber."
#: shop.lua
msgid "Exchange can not be done, check if you put all items!"
msgstr "Tausch kann nicht abgeschlossen werden, prüfe nochmal alles was du hinein gelegt hast!"
currency-2018-11-09/locale/fr.po 0000664 0000000 0000000 00000007732 13371150712 0016164 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-24 23:06+0200\n"
"PO-Revision-Date: 2018-05-12 14:55+0200\n"
"Last-Translator: Papou30\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.7\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: barter.lua
msgid "Start"
msgstr "Début"
#: barter.lua
msgid "Confirm"
msgstr "Confirmer"
#: barter.lua
msgid "Cancel"
msgstr "Annuler"
#: barter.lua shop.lua
msgid "Exchange"
msgstr "Échange"
#: barter.lua
msgid "Barter Table"
msgstr "Table de troc"
#: craftitems.lua
msgid "1 MineGeld Note"
msgstr "1 MineGeld"
#: craftitems.lua
msgid "5 MineGeld Note"
msgstr "5 MineGeld"
#: craftitems.lua
msgid "10 MineGeld Note"
msgstr "10 MineGeld"
#: craftitems.lua
#, fuzzy
msgid "50 MineGeld Note"
msgstr "5 MineGeld"
#: craftitems.lua
msgid "Bundle of random Minegeld notes"
msgstr "Liasse de Minegeld aléatoire"
#: income.lua
msgid "basic income for @1"
msgstr "revenu de base pour @1"
#: income.lua
msgid "added basic income for @1 to inventory"
msgstr "revenu de base ajouté pour @1 à l'inventaire"
#: init.lua
msgid "Currency mod loading..."
msgstr "Chargement du mod Currency..."
#: init.lua
msgid "Craft_items Loaded!"
msgstr "Fabrication d'objets (Craft_items) chargé!"
#: init.lua
msgid "Shop Loaded!"
msgstr "Boutique (Shop) chargée!"
#: init.lua
msgid "Barter Loaded!"
msgstr "Troc (Barter) chargé!"
#: init.lua
msgid "Safe Loaded!"
msgstr "Coffre-fort (Safe) chargé!"
#: init.lua
msgid "Crafting Loaded!"
msgstr "Artisanat (Crafting) chargé!"
#: init.lua
msgid "Creative mode in use, skipping basic income."
msgstr "Mod créatif en cours d'utilisation, ignoré le revenu de base."
#: init.lua
msgid "Income Loaded!"
msgstr "Revenu de base (Income) chargé!"
#: safe.lua
msgid "Safe"
msgstr "Coffre-fort"
#: safe.lua
msgid "Safe (owned by @1)"
msgstr "Coffre-fort (appartenant à @1)"
#: safe.lua
msgid "@1 tried to access a safe belonging to @2 at @3"
msgstr "@1 a tenté d'accéder à un coffre-fort appartenant à @2 à @3"
#: safe.lua
msgid "@1 moves stuff in safe at @2"
msgstr "@1 déplace le matériel dans coffre-fort à @2"
#: safe.lua
msgid "@1 moves stuff to safe at @2"
msgstr "@1 déplace le matériel vers coffre-fort à @2"
#: safe.lua
msgid "@1 takes stuff from safe at @2"
msgstr "@1 prend le matériel dans le coffre-fort à @2"
#: shop.lua
msgid "Customer gives (pay here!)"
msgstr "Client donne (payer ici!)"
#: shop.lua
msgid "Customer gets:"
msgstr "Client obtient:"
#: shop.lua
msgid "Owner wants:"
msgstr "Le propriétaire veut:"
#: shop.lua
msgid "Owner gives:"
msgstr "Propriétaire donne:"
#: shop.lua
msgid "Customers gave:"
msgstr "Le client a donné:"
#: shop.lua
msgid "Your stock:"
msgstr "Votre stock:"
#: shop.lua
msgid "You want:"
msgstr "Vous voulez:"
#: shop.lua
msgid "In exchange, you give:"
msgstr "En échange, vous donnez:"
#: shop.lua
msgid "Owner, Use (E)+Place (right mouse button) for customer interface"
msgstr ""
"Propriétaire, utilisez (E) + place (bouton droit de la souris) pour "
"l'interface client"
#: shop.lua
msgid "Shop"
msgstr "Boutique"
#: shop.lua
msgid "Exchange shop (owned by @1)"
msgstr "Boutique d'échange (détenue par @1)"
#: shop.lua
msgid "This is your own shop, you can't exchange to yourself!"
msgstr "C'est ta propre boutique, tu ne peux pas échanger avec toi-même!"
#: shop.lua
msgid "Exchanged!"
msgstr "Échangé!"
#: shop.lua
msgid "Exchange can not be done, contact the shop owner."
msgstr "L'échange ne peut être fait, contactez le propriétaire du magasin."
#: shop.lua
msgid "Exchange can not be done, check if you put all items!"
msgstr ""
"L'echange ne peut pas etre fait, verifiez si vous mettez tous les articles!"
currency-2018-11-09/locale/ms.po 0000664 0000000 0000000 00000007367 13371150712 0016200 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-24 23:06+0200\n"
"PO-Revision-Date: 2017-10-17 02:03+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ms\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.4\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: barter.lua
msgid "Start"
msgstr "Mula"
#: barter.lua
msgid "Confirm"
msgstr "Sah"
#: barter.lua
msgid "Cancel"
msgstr "Batal"
#: barter.lua shop.lua
msgid "Exchange"
msgstr "Tukar"
#: barter.lua
msgid "Barter Table"
msgstr "Meja Barter"
#: craftitems.lua
msgid "1 MineGeld Note"
msgstr "Wang 1 MineGeld"
#: craftitems.lua
msgid "5 MineGeld Note"
msgstr "Wang 5 MineGeld"
#: craftitems.lua
msgid "10 MineGeld Note"
msgstr "Wang 10 MineGeld"
#: craftitems.lua
#, fuzzy
msgid "50 MineGeld Note"
msgstr "Wang 5 MineGeld"
#: craftitems.lua
msgid "Bundle of random Minegeld notes"
msgstr "Seberkas wang Minegeld rawak"
#: income.lua
msgid "basic income for @1"
msgstr "pendapatan asas untuk @1"
#: income.lua
msgid "added basic income for @1 to inventory"
msgstr "pendapatan asas untuk @1 ditambah masuk ke dalam inventori"
#: init.lua
msgid "Currency mod loading..."
msgstr "Memuatkan mods Currency..."
#: init.lua
msgid "Craft_items Loaded!"
msgstr "Item pertukangan dimuatkan!"
#: init.lua
msgid "Shop Loaded!"
msgstr "Kedai dimuatkan!"
#: init.lua
msgid "Barter Loaded!"
msgstr "Meja barter dimuatkan!"
#: init.lua
msgid "Safe Loaded!"
msgstr "Peti besi dimuatkan!"
#: init.lua
msgid "Crafting Loaded!"
msgstr "Pertukangan dimuatkan!"
#: init.lua
msgid "Creative mode in use, skipping basic income."
msgstr "Dalam mod kreatif, pendapatan asas diabaikan."
#: init.lua
msgid "Income Loaded!"
msgstr "Pendapatan dimuatkan!"
#: safe.lua
msgid "Safe"
msgstr "Peti besi"
#: safe.lua
msgid "Safe (owned by @1)"
msgstr "Peti besi (pemilik: @1)"
#: safe.lua
msgid "@1 tried to access a safe belonging to @2 at @3"
msgstr "@1 cuba untuk mengakses peti besi milik @2 di @3"
#: safe.lua
msgid "@1 moves stuff in safe at @2"
msgstr "@1 pindahkan barang dalam peti besi di @2"
#: safe.lua
msgid "@1 moves stuff to safe at @2"
msgstr "@1 masukkan barang dalam peti besi di @2"
#: safe.lua
msgid "@1 takes stuff from safe at @2"
msgstr "@1 keluarkan barang dari peti besi di @2"
#: shop.lua
msgid "Customer gives (pay here!)"
msgstr "Pelanggan beri (bayar sini!)"
#: shop.lua
msgid "Customer gets:"
msgstr "Pelanggan dapat:"
#: shop.lua
msgid "Owner wants:"
msgstr "Penjual inginkan:"
#: shop.lua
msgid "Owner gives:"
msgstr "Penjual berikan:"
#: shop.lua
msgid "Customers gave:"
msgstr "Pelanggan berikan:"
#: shop.lua
msgid "Your stock:"
msgstr "Stok anda:"
#: shop.lua
msgid "You want:"
msgstr "Anda mahukan:"
#: shop.lua
msgid "In exchange, you give:"
msgstr "Anda berikan:"
#: shop.lua
msgid "Owner, Use (E)+Place (right mouse button) for customer interface"
msgstr ""
"Penjual, Gunakan (E) + Letak (butang tetikus kanan) untuk antaramuka "
"pelanggan"
#: shop.lua
msgid "Shop"
msgstr "Kedai"
#: shop.lua
msgid "Exchange shop (owned by @1)"
msgstr "Kedai (pemilik: @1)"
#: shop.lua
msgid "This is your own shop, you can't exchange to yourself!"
msgstr "Ini kedai anda, anda tidak boleh menjual kepada diri sendiri!"
#: shop.lua
msgid "Exchanged!"
msgstr "Jual!"
#: shop.lua
msgid "Exchange can not be done, contact the shop owner."
msgstr "Tak boleh jual, hubungi penjual."
#: shop.lua
msgid "Exchange can not be done, check if you put all items!"
msgstr "Tak boleh jual, pastikan anda ada apa yang penjual mahukan!"
currency-2018-11-09/locale/ru.po 0000664 0000000 0000000 00000011272 13371150712 0016175 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-24 23:06+0200\n"
"PO-Revision-Date: 2017-08-11 19:03+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#: barter.lua
msgid "Start"
msgstr "Старт"
#: barter.lua
msgid "Confirm"
msgstr "Подтверждение"
#: barter.lua
msgid "Cancel"
msgstr "Отмена"
#: barter.lua shop.lua
msgid "Exchange"
msgstr "Обмен"
#: barter.lua
msgid "Barter Table"
msgstr "Таблица бартера"
#: craftitems.lua
msgid "1 MineGeld Note"
msgstr "Банкнота в 1 MineGeld"
#: craftitems.lua
msgid "5 MineGeld Note"
msgstr "Банкнота в 5 MineGeld"
#: craftitems.lua
msgid "10 MineGeld Note"
msgstr "Банкнота в 10 MineGeld"
#: craftitems.lua
#, fuzzy
msgid "50 MineGeld Note"
msgstr "Банкнота в 5 MineGeld"
#: craftitems.lua
msgid "Bundle of random Minegeld notes"
msgstr "Пачка случайных банкнот Minegeld"
#: income.lua
msgid "basic income for @1"
msgstr "базовая прибыль для @1"
#: income.lua
msgid "added basic income for @1 to inventory"
msgstr "базовая прибыль для @1 добавлена в инвентарь"
#: init.lua
msgid "Currency mod loading..."
msgstr "Загружается мод Currency..."
#: init.lua
msgid "Craft_items Loaded!"
msgstr "Предметы для сборки загружены!"
#: init.lua
msgid "Shop Loaded!"
msgstr "Магазин загружен!"
#: init.lua
msgid "Barter Loaded!"
msgstr "Бартер загружен!"
#: init.lua
msgid "Safe Loaded!"
msgstr "Сейф загружен!"
#: init.lua
msgid "Crafting Loaded!"
msgstr "Механизм сборки загружен!"
#: init.lua
msgid "Creative mode in use, skipping basic income."
msgstr "Используется режим творчества, пропускаем базовую прибыль."
#: init.lua
msgid "Income Loaded!"
msgstr "Прибыль загружена!"
#: safe.lua
msgid "Safe"
msgstr "Сейф"
#: safe.lua
msgid "Safe (owned by @1)"
msgstr "Сейф (принадлежит @1)"
#: safe.lua
msgid "@1 tried to access a safe belonging to @2 at @3"
msgstr "@1 попробовал открыть сейф, принадлежащий @2 в @3"
#: safe.lua
msgid "@1 moves stuff in safe at @2"
msgstr "@1 перемещает вещи в сейфе в @2"
#: safe.lua
msgid "@1 moves stuff to safe at @2"
msgstr "@1 кладёт вещи в сейф в @2"
#: safe.lua
msgid "@1 takes stuff from safe at @2"
msgstr "@1 забирает вещи из сейфа в @2"
#: shop.lua
msgid "Customer gives (pay here!)"
msgstr "Покупатель отдаёт (здесь оплата!)"
#: shop.lua
msgid "Customer gets:"
msgstr "Покупатель получает:"
#: shop.lua
msgid "Owner wants:"
msgstr "Владелец хочет:"
#: shop.lua
msgid "Owner gives:"
msgstr "Владелец отдаёт:"
#: shop.lua
msgid "Customers gave:"
msgstr "Покупатель отдал:"
#: shop.lua
msgid "Your stock:"
msgstr "Ваш запас:"
#: shop.lua
msgid "You want:"
msgstr "Вы хотите:"
#: shop.lua
msgid "In exchange, you give:"
msgstr "Взамен вы даёте:"
#: shop.lua
msgid "Owner, Use (E)+Place (right mouse button) for customer interface"
msgstr ""
"Владелец, используйте (E)+Разместить (правая кнопка мыши) для открытия "
"интерфейса покупателя"
#: shop.lua
msgid "Shop"
msgstr "Магазин"
#: shop.lua
msgid "Exchange shop (owned by @1)"
msgstr "Пункт обмена (принадлежит @1)"
#: shop.lua
msgid "This is your own shop, you can't exchange to yourself!"
msgstr "Это ваш собственный магазин, вы не можете обмениваться с самим собой!"
#: shop.lua
msgid "Exchanged!"
msgstr "Обмен произведён!"
#: shop.lua
msgid "Exchange can not be done, contact the shop owner."
msgstr "Обмен невозможен, свяжитесь с владельцем магазина."
#: shop.lua
msgid "Exchange can not be done, check if you put all items!"
msgstr "Обмен невозможен, проверьте, что вы положили все предметы!"
currency-2018-11-09/locale/template.pot 0000664 0000000 0000000 00000005412 13371150712 0017545 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-24 23:06+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: barter.lua
msgid "Start"
msgstr ""
#: barter.lua
msgid "Confirm"
msgstr ""
#: barter.lua
msgid "Cancel"
msgstr ""
#: barter.lua shop.lua
msgid "Exchange"
msgstr ""
#: barter.lua
msgid "Barter Table"
msgstr ""
#: craftitems.lua
msgid "1 MineGeld Note"
msgstr ""
#: craftitems.lua
msgid "5 MineGeld Note"
msgstr ""
#: craftitems.lua
msgid "10 MineGeld Note"
msgstr ""
#: craftitems.lua
msgid "50 MineGeld Note"
msgstr ""
#: craftitems.lua
msgid "Bundle of random Minegeld notes"
msgstr ""
#: income.lua
msgid "basic income for @1"
msgstr ""
#: income.lua
msgid "added basic income for @1 to inventory"
msgstr ""
#: init.lua
msgid "Currency mod loading..."
msgstr ""
#: init.lua
msgid "Craft_items Loaded!"
msgstr ""
#: init.lua
msgid "Shop Loaded!"
msgstr ""
#: init.lua
msgid "Barter Loaded!"
msgstr ""
#: init.lua
msgid "Safe Loaded!"
msgstr ""
#: init.lua
msgid "Crafting Loaded!"
msgstr ""
#: init.lua
msgid "Creative mode in use, skipping basic income."
msgstr ""
#: init.lua
msgid "Income Loaded!"
msgstr ""
#: safe.lua
msgid "Safe"
msgstr ""
#: safe.lua
msgid "Safe (owned by @1)"
msgstr ""
#: safe.lua
msgid "@1 tried to access a safe belonging to @2 at @3"
msgstr ""
#: safe.lua
msgid "@1 moves stuff in safe at @2"
msgstr ""
#: safe.lua
msgid "@1 moves stuff to safe at @2"
msgstr ""
#: safe.lua
msgid "@1 takes stuff from safe at @2"
msgstr ""
#: shop.lua
msgid "Customer gives (pay here!)"
msgstr ""
#: shop.lua
msgid "Customer gets:"
msgstr ""
#: shop.lua
msgid "Owner wants:"
msgstr ""
#: shop.lua
msgid "Owner gives:"
msgstr ""
#: shop.lua
msgid "Customers gave:"
msgstr ""
#: shop.lua
msgid "Your stock:"
msgstr ""
#: shop.lua
msgid "You want:"
msgstr ""
#: shop.lua
msgid "In exchange, you give:"
msgstr ""
#: shop.lua
msgid "Owner, Use (E)+Place (right mouse button) for customer interface"
msgstr ""
#: shop.lua
msgid "Shop"
msgstr ""
#: shop.lua
msgid "Exchange shop (owned by @1)"
msgstr ""
#: shop.lua
msgid "This is your own shop, you can't exchange to yourself!"
msgstr ""
#: shop.lua
msgid "Exchanged!"
msgstr ""
#: shop.lua
msgid "Exchange can not be done, contact the shop owner."
msgstr ""
#: shop.lua
msgid "Exchange can not be done, check if you put all items!"
msgstr ""
currency-2018-11-09/loot.lua 0000664 0000000 0000000 00000001435 13371150712 0015430 0 ustar 00root root 0000000 0000000 if not minetest.get_modpath("loot") then
return
end
loot.register_loot({
weights = { generic = 50 },
payload = {
stack = ItemStack("currency:minegeld"),
min_size = 1,
max_size = 250,
},
})
loot.register_loot({
weights = { generic = 50 },
payload = {
stack = ItemStack("currency:minegeld_5"),
min_size = 1,
max_size = 50,
},
})
loot.register_loot({
weights = { generic = 50 },
payload = {
stack = ItemStack("currency:minegeld_10"),
min_size = 1,
max_size = 10,
},
})
loot.register_loot({
weights = { generic = 50 },
payload = {
stack = ItemStack("currency:minegeld_50"),
min_size = 1,
max_size = 10,
},
})
loot.register_loot({
weights = { generic = 50 },
payload = {
stack = ItemStack("currency:minegeld_100"),
min_size = 1,
max_size = 10,
},
})
currency-2018-11-09/mod.conf 0000664 0000000 0000000 00000000020 13371150712 0015363 0 ustar 00root root 0000000 0000000 name = currency
currency-2018-11-09/safe.lua 0000664 0000000 0000000 00000007207 13371150712 0015374 0 ustar 00root root 0000000 0000000 -- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
function default.get_safe_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec =
"size[8,9]"..
"list[nodemeta:".. spos .. ";main;1,1;6,2;]"..
"list[current_player;main;0,5;8,4;]"..
"listring[nodemeta:".. spos .. ";main]"..
"listring[current_player;main]"
return formspec
end
local function has_safe_privilege(meta, player)
local name = ""
if player then
if minetest.check_player_privs(player, "protection_bypass") then
return true
end
name = player:get_player_name()
end
if name ~= meta:get_string("owner") then
return false
end
return true
end
minetest.register_node("currency:safe", {
description = S("Safe"),
inventory_image = "safe_front.png",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"safe_side.png",
"safe_side.png",
"safe_side.png",
"safe_side.png",
"safe_side.png",
"safe_front.png",},
is_ground_content = false,
groups = {cracky=1},
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", S("Safe (owned by @1)", meta:get_string("owner")))
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", "Safe")
meta:set_string("owner", "")
local inv = meta:get_inventory()
inv:set_size("main", 6*2)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main") and has_safe_privilege(meta, player)
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if not has_safe_privilege(meta, player) then
minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3",
player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
return 0
end
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_safe_privilege(meta, player) then
minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3",
player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
return 0
end
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not has_safe_privilege(meta, player) then
minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3",
player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos)))
return 0
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("@1 moves stuff in safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("@1 moves stuff to safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("@1 takes stuff from safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
end,
on_rightclick = function(pos, node, clicker)
local meta = minetest.get_meta(pos)
if has_safe_privilege(meta, clicker) then
minetest.show_formspec(
clicker:get_player_name(),
"currency:safe",
default.get_safe_formspec(pos)
)
end
end,
})
currency-2018-11-09/shop.lua 0000664 0000000 0000000 00000017107 13371150712 0015427 0 ustar 00root root 0000000 0000000 -- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
default.shop = {}
default.shop.current_shop = {}
default.shop.formspec = {
customer = function(pos)
local list_name = "nodemeta:"..pos.x..','..pos.y..','..pos.z
local formspec = "size[8,9.5]"..
"label[0,0;" .. S("Customer gives (pay here!)") .. "]"..
"list[current_player;customer_gives;0,0.5;3,2;]"..
"label[0,2.5;" .. S("Customer gets:") .. "]"..
"list[current_player;customer_gets;0,3;3,2;]"..
"label[5,0;" .. S("Owner wants:") .. "]"..
"list["..list_name..";owner_wants;5,0.5;3,2;]"..
"label[5,2.5;" .. S("Owner gives:") .. "]"..
"list["..list_name..";owner_gives;5,3;3,2;]"..
"list[current_player;main;0,5.5;8,4;]"..
"button[3,2;2,1;exchange;" .. S("Exchange") .. "]"
return formspec
end,
owner = function(pos)
local list_name = "nodemeta:"..pos.x..','..pos.y..','..pos.z
local formspec = "size[8,9.5]"..
"label[0,0;" .. S("Customers gave:") .. "]"..
"list["..list_name..";customers_gave;0,0.5;3,2;]"..
"label[0,2.5;" .. S("Your stock:") .. "]"..
"list["..list_name..";stock;0,3;3,2;]"..
"label[5,0;" .. S("You want:") .. "]"..
"list["..list_name..";owner_wants;5,0.5;3,2;]"..
"label[5,2.5;" .. S("In exchange, you give:") .. "]"..
"list["..list_name..";owner_gives;5,3;3,2;]"..
"label[0,5;" .. S("Owner, Use (E)+Place (right mouse button) for customer interface") .. "]"..
"list[current_player;main;0,5.5;8,4;]"
return formspec
end,
}
local have_pipeworks = minetest.global_exists("pipeworks")
default.shop.check_privilege = function(listname,playername,meta)
--[[if listname == "pl1" then
if playername ~= meta:get_string("pl1") then
return false
elseif meta:get_int("pl1step") ~= 1 then
return false
end
end
if listname == "pl2" then
if playername ~= meta:get_string("pl2") then
return false
elseif meta:get_int("pl2step") ~= 1 then
return false
end
end]]
return true
end
default.shop.give_inventory = function(inv,list,playername)
player = minetest.get_player_by_name(playername)
if player then
for k,v in ipairs(inv:get_list(list)) do
player:get_inventory():add_item("main",v)
inv:remove_item(list,v)
end
end
end
default.shop.cancel = function(meta)
--[[default.shop.give_inventory(meta:get_inventory(),"pl1",meta:get_string("pl1"))
default.shop.give_inventory(meta:get_inventory(),"pl2",meta:get_string("pl2"))
meta:set_string("pl1","")
meta:set_string("pl2","")
meta:set_int("pl1step",0)
meta:set_int("pl2step",0)]]
end
default.shop.exchange = function(meta)
--[[default.shop.give_inventory(meta:get_inventory(),"pl1",meta:get_string("pl2"))
default.shop.give_inventory(meta:get_inventory(),"pl2",meta:get_string("pl1"))
meta:set_string("pl1","")
meta:set_string("pl2","")
meta:set_int("pl1step",0)
meta:set_int("pl2step",0)]]
end
minetest.register_node("currency:shop", {
description = S("Shop"),
paramtype2 = "facedir",
tiles = {"shop_top.png",
"shop_top.png",
"shop_side.png",
"shop_side.png",
"shop_side.png",
"shop_front.png"},
inventory_image = "shop_front.png",
groups = {choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer, itemstack)
local owner = placer:get_player_name()
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Exchange shop (owned by @1)", owner))
meta:set_string("owner",owner)
--[[meta:set_string("pl1","")
meta:set_string("pl2","")]]
local inv = meta:get_inventory()
inv:set_size("customers_gave", 3*2)
inv:set_size("stock", 3*2)
inv:set_size("owner_wants", 3*2)
inv:set_size("owner_gives", 3*2)
if have_pipeworks then pipeworks.after_place(pos) end
end,
after_dig_node = (have_pipeworks and pipeworks and pipeworks.after_dig),
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("stock",stack)
end,
can_insert = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:room_for_item("stock", stack)
end,
input_inventory = "customers_gave",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
on_rightclick = function(pos, node, clicker, itemstack)
clicker:get_inventory():set_size("customer_gives", 3*2)
clicker:get_inventory():set_size("customer_gets", 3*2)
default.shop.current_shop[clicker:get_player_name()] = pos
local meta = minetest.get_meta(pos)
if clicker:get_player_name() == meta:get_string("owner") and not clicker:get_player_control().aux1 then
minetest.show_formspec(clicker:get_player_name(),"currency:shop_formspec",default.shop.formspec.owner(pos))
else
minetest.show_formspec(clicker:get_player_name(),"currency:shop_formspec",default.shop.formspec.customer(pos))
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if player:get_player_name() ~= meta:get_string("owner") then return 0 end
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if player:get_player_name() ~= meta:get_string("owner") then return 0 end
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if player:get_player_name() ~= meta:get_string("owner") then return 0 end
return stack:get_count()
end,
can_dig = function(pos, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:is_empty("stock") and inv:is_empty("customers_gave") and inv:is_empty("owner_wants") and inv:is_empty("owner_gives")
end
})
minetest.register_on_player_receive_fields(function(sender, formname, fields)
if formname == "currency:shop_formspec" and fields.exchange ~= nil and fields.exchange ~= "" then
local name = sender:get_player_name()
local pos = default.shop.current_shop[name]
local meta = minetest.get_meta(pos)
if meta:get_string("owner") == name then
minetest.chat_send_player(name,S("This is your own shop, you can't exchange to yourself!"))
else
local minv = meta:get_inventory()
local pinv = sender:get_inventory()
local invlist_tostring = function(invlist)
local out = {}
for i, item in pairs(invlist) do
out[i] = item:to_string()
end
return out
end
local wants = minv:get_list("owner_wants")
local gives = minv:get_list("owner_gives")
if wants == nil or gives == nil then return end -- do not crash the server
-- Check if we can exchange
local can_exchange = true
local owners_fault = false
for i, item in pairs(wants) do
if not pinv:contains_item("customer_gives",item) then
can_exchange = false
end
end
for i, item in pairs(gives) do
if not minv:contains_item("stock",item) then
can_exchange = false
owners_fault = true
end
end
if can_exchange then
for i, item in pairs(wants) do
pinv:remove_item("customer_gives",item)
minv:add_item("customers_gave",item)
end
for i, item in pairs(gives) do
minv:remove_item("stock",item)
pinv:add_item("customer_gets",item)
end
minetest.chat_send_player(name,S("Exchanged!"))
else
if owners_fault then
minetest.chat_send_player(name,S("Exchange can not be done, contact the shop owner."))
else
minetest.chat_send_player(name,S("Exchange can not be done, check if you put all items!"))
end
end
end
end
end)
currency-2018-11-09/textures/ 0000775 0000000 0000000 00000000000 13371150712 0015630 5 ustar 00root root 0000000 0000000 currency-2018-11-09/textures/barter_base.png 0000664 0000000 0000000 00000001336 13371150712 0020612 0 ustar 00root root 0000000 0000000 PNG
IHDR a IDAT8%=$5r{6 Ȉ`32.%H!D@ 1;;3=]e]6Oڶ˄6cXXNw4gK2S vF7('%`TSA!d&&
;ߢݞyxŗKx|x!4*S
A&F&b: