pax_global_header 0000666 0000000 0000000 00000000064 14003647705 0014520 g ustar 00root root 0000000 0000000 52 comment=6b2bbb4df60019174ea6db1c13535d6bf893d153
currency-2021-04-14-1/ 0000775 0000000 0000000 00000000000 14003647705 0014101 5 ustar 00root root 0000000 0000000 currency-2021-04-14-1/LICENSE 0000664 0000000 0000000 00000066575 14003647705 0015131 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-2021-04-14-1/Money_Info.txt 0000664 0000000 0000000 00000001352 14003647705 0016705 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-2021-04-14-1/README.md 0000664 0000000 0000000 00000000273 14003647705 0015362 0 ustar 00root root 0000000 0000000 currency
========
Repo for Currency Mod
# Settings
Settings with default values:
```
# After how much idle-time barter table is reset (seconds)
barter.chest.expireafter 15 * 60
```
currency-2021-04-14-1/barter.lua 0000664 0000000 0000000 00000015756 14003647705 0016101 0 ustar 00root root 0000000 0000000 currency.barter = {}
barter = currency.barter -- Kept as a global variable for compatibility
local S = minetest.get_translator("currency")
barter.chest = {}
barter.chest.expire_after = tonumber(minetest.settings:get('barter.chest.expireafter')) or 15 * 60
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[0,4;3,1;pl1_start;" .. S("Start") .. "]",
player = function(name) return "label[0,4;"..name.."]" end,
accept1 = "button[2.9,1;1.2,1;pl1_accept1;" .. S("Confirm") .. "]"..
"button[2.9,2;1.2,1;pl1_cancel;" .. S("Cancel") .. "]",
accept2 = "button[2.9,1;1.2,1;pl1_accept2;" .. S("Exchange") .. "]"..
"button[2.9,2;1.2,1;pl1_cancel;" .. S("Cancel") .. "]",
},
pl2 = {
start = "button[5,4;3,1;pl2_start;" .. S("Start") .. "]",
player = function(name) return "label[5,4;"..name.."]" end,
accept1 = "button[3.9,1;1.2,1;pl2_accept1;" .. S("Confirm") .. "]"..
"button[3.9,2;1.2,1;pl2_cancel;" .. S("Cancel") .. "]",
accept2 = "button[3.9,1;1.2,1;pl2_accept2;" .. S("Exchange") .. "]"..
"button[3.9,2;1.2,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
if player:get_inventory():room_for_item("main",v) then
player:get_inventory():add_item("main",v)
else
minetest.add_item(player:get_pos(),v)
end
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)
meta:set_int("clean",1)
meta:set_int("timer",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)
meta:set_int("clean",1)
meta:set_int("timer",0)
end
barter.chest.start_timer = function(pos, meta)
meta:set_int("clean",0)
meta:set_int("timer",0)
local node_timer = minetest.get_node_timer(pos)
if node_timer:is_started() then return end
node_timer:start(22)
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 = currency.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","")
meta:set_int("clean",1)
meta:set_int("timer",0)
barter.chest.update_formspec(meta)
local inv = meta:get_inventory()
inv:set_size("pl1", 12) -- 3*4
inv:set_size("pl2", 12) -- 3*4
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
barter.chest.start_timer(pos, meta)
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)
barter.chest.start_timer(pos, meta)
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)
barter.chest.start_timer(pos, meta)
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)
barter.chest.start_timer(pos, meta)
if not barter.chest.check_privilege(listname,player:get_player_name(),meta) then return 0 end
return stack:get_count()
end,
on_timer = function(pos, dtime)
local meta = minetest.get_meta(pos)
if 1 == meta:get_int("clean") then return false end
local timer = meta:get_int("timer")
timer = timer + dtime
if timer > barter.chest.expire_after then
-- attempt to return items to owners
barter.chest.cancel(meta)
-- also clear out items of offline users
local inv = meta:get_inventory()
inv:set_list("pl1", {})
inv:set_list("pl2", {})
return false
end
meta:set_int("timer",timer)
return true
end
})
currency-2021-04-14-1/crafting.lua 0000664 0000000 0000000 00000006543 14003647705 0016411 0 ustar 00root root 0000000 0000000 if minetest.get_modpath("default") then
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"},
}
})
end
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_note",
"group:minegeld_note",
"group:minegeld_note",
"group:minegeld_note",
"group:minegeld_note",
"group:minegeld_note",
"group:minegeld_note",
"group:minegeld_note",
"group:minegeld_note"
},
})
minetest.register_craft({
type = "fuel",
recipe = "currency:minegeld_bundle",
burntime = 1,
})
currency-2021-04-14-1/craftitems.lua 0000664 0000000 0000000 00000003560 14003647705 0016751 0 ustar 00root root 0000000 0000000 local S = minetest.get_translator("currency")
minetest.register_craftitem("currency:minegeld_cent_5", {
description = S("@1 Minegeld cent coin", "5"),
inventory_image = "minegeld_cent_5.png",
stack_max = 1000,
groups = {minegeld = 1, minegeld_coin = 1}
})
minetest.register_craftitem("currency:minegeld_cent_10", {
description = S("@1 Minegeld cent coin", "10"),
inventory_image = "minegeld_cent_10.png",
stack_max = 1000,
groups = {minegeld = 1, minegeld_coin = 1}
})
minetest.register_craftitem("currency:minegeld_cent_25", {
description = S("@1 Minegeld cent coin", "25"),
inventory_image = "minegeld_cent_25.png",
stack_max = 1000,
groups = {minegeld = 1, minegeld_coin = 1}
})
minetest.register_craftitem("currency:minegeld", {
description = S("@1 Minegeld Note", "1"),
inventory_image = "minegeld.png",
stack_max = 65535,
groups = {minegeld = 1, minegeld_note = 1}
})
minetest.register_craftitem("currency:minegeld_5", {
description = S("@1 Minegeld Note", "5"),
inventory_image = "minegeld_5.png",
stack_max = 65535,
groups = {minegeld = 1, minegeld_note = 1}
})
minetest.register_craftitem("currency:minegeld_10", {
description = S("@1 Minegeld Note", "10"),
inventory_image = "minegeld_10.png",
stack_max = 65535,
groups = {minegeld = 1, minegeld_note = 1}
})
minetest.register_craftitem("currency:minegeld_50", {
description = S("@1 Minegeld Note", "50"),
inventory_image = "minegeld_50.png",
stack_max = 65535,
groups = {minegeld = 1, minegeld_note = 1}
})
minetest.register_craftitem("currency:minegeld_100", {
description = S("@1 Minegeld Note", "100"),
inventory_image = "minegeld_100.png",
stack_max = 65535,
groups = {minegeld = 1, minegeld_note = 1}
})
minetest.register_craftitem("currency:minegeld_bundle", {
description = S("Bundle of random Minegeld notes"),
inventory_image = "minegeld_bundle.png",
stack_max = 65535,
})
currency-2021-04-14-1/income.lua 0000664 0000000 0000000 00000004103 14003647705 0016054 0 ustar 00root root 0000000 0000000 local players_income = {}
local income_enabled = minetest.settings:get_bool("currency.income_enabled", true)
local creative_income_enabled = minetest.settings:get_bool("currency.creative_income_enabled", true)
local income_item = minetest.settings:get("currency.income_item") or "currency:minegeld_10"
local income_count = tonumber(minetest.settings:get("currency.income_count")) or 1
local income_period = tonumber(minetest.settings:get("currency.income_period")) or 720
if income_enabled then
local timer = 0
if creative_income_enabled then
minetest.register_globalstep(function(dtime)
timer = timer + dtime;
if timer >= income_period then
timer = 0
for _, player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
players_income[name] = income_count
minetest.log("info", "[Currency] basic income for "..name)
end
end
end)
else
minetest.register_globalstep(function(dtime)
timer = timer + dtime;
if timer >= income_period then
timer = 0
for _, player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local privs = minetest.get_player_privs(name)
if not (privs.creative or privs.give) then
players_income[name] = income_count
minetest.log("info", "[Currency] basic income for "..name)
end
end
end
end)
end
local function earn_income(player)
if not player or player.is_fake_player then return end
local name = player:get_player_name()
local income_count = players_income[name]
if income_count and income_count > 0 then
local inv = player:get_inventory()
inv:add_item("main", {name=income_item, count=income_count})
players_income[name] = nil
minetest.log("info", "[Currency] added basic income for "..name.." to inventory")
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)
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) earn_income(player) end)
end
currency-2021-04-14-1/init.lua 0000664 0000000 0000000 00000001633 14003647705 0015552 0 ustar 00root root 0000000 0000000 local modpath = minetest.get_modpath("currency")
minetest.log("info", "Currency mod loading...")
currency = {}
if minetest.global_exists("default") then
currency.node_sound_wood_defaults = default.node_sound_wood_defaults
else
currency.node_sound_wood_defaults = function() end
end
dofile(modpath.."/craftitems.lua")
minetest.log("info", "[Currency] Craft_items Loaded!")
dofile(modpath.."/shop.lua")
minetest.log("info", "[Currency] Shop Loaded!")
dofile(modpath.."/barter.lua")
minetest.log("info", "[Currency] Barter Loaded!")
dofile(modpath.."/safe.lua")
minetest.log("info", "[Currency] Safe Loaded!")
dofile(modpath.."/crafting.lua")
minetest.log("info", "[Currency] Crafting Loaded!")
if minetest.settings:get_bool("creative_mode") then
minetest.log("info", "[Currency] Creative mode in use, skipping basic income.")
else
dofile(modpath.."/income.lua")
minetest.log("info", "[Currency] Income Loaded!")
end
currency-2021-04-14-1/locale/ 0000775 0000000 0000000 00000000000 14003647705 0015340 5 ustar 00root root 0000000 0000000 currency-2021-04-14-1/locale/currency.de.tr 0000664 0000000 0000000 00000002551 14003647705 0020133 0 ustar 00root root 0000000 0000000 # textdomain: currency
# A.C.M. , 2018
### barter.lua ###
Barter Table=Handelstisch
Cancel=Abbruch
Confirm=Bestätigen
Start=Start
### shop.lua ###
Exchange=Tauschen
### craftitems.lua ###
@1 Minegeld Note=@1-Minegeld-Banknote
@1 Minegeld cent coin=@1-Minegeldcent-Münze
Bundle of random Minegeld notes=Bündel mit beliebigen Minegeld-Banknoten
### safe.lua ###
Safe=Tresor
Safe (owned by @1)=Tresor (gehört @1)
### shop.lua ###
Customer gets:=Kunde erhält:
Customer gives (pay here!)=Kunde gibt (hier bezahlen!)
Customers gave:=Kunde gab:
Exchange can not be done, check if you put all items!=Tausch kann nicht abgeschlossen werden. Prüfen, ob alle Gegenstände platziert wurden!
Exchange can not be done, contact the shop owner.=Tausch kann nicht abgeschlossen werden. Geschäftsinhaber benachrichtigen!
Exchange shop (owned by @1)=Tauschgeschäft (gehört @1)
Exchanged!=Getauscht!
In exchange, you give:=Im Tausch geben Sie:
out of stock=Ausverkauft
Owner gives:=Inhaber gibt:
Owner wants:=Inhaber will:
Owner, Use (E)+Place (right mouse button) for customer interface=Inhaber: (E)+Platzieren (rechte Maustaste) drücken für Kundeninterface ...
Shop=Geschäft
This is your own shop, you can't exchange to yourself!=Dies ist Ihr eigenes Geschäft, Sie können nicht mit sich selbst tauschen!
You want:=Sie wollen:
Your stock:=Ihr Lager:
currency-2021-04-14-1/locale/currency.es.tr 0000664 0000000 0000000 00000002311 14003647705 0020144 0 ustar 00root root 0000000 0000000 # textdomain: currency
# author: PsycoJaker
### barter.lua ###
Barter Table=Mesa de intercambios
Cancel=Denegar
Confirm=Aceptar
Start=Intercambiar
### shop.lua ###
Exchange=Trato
### craftitems.lua ###
@1 Minegeld Note=Billete de @1 Minegeld
@1 Minegeld cent coin= Moneda de @1 Minegeld
Bundle of random Minegeld notes=Monton de dinero
### safe.lua ###
Safe=Caja fuerte
Safe (owned by @1)=Caja fuerte de @1
### shop.lua ###
Customer gets:=Tu compra:
Customer gives (pay here!)=Paga aqui
Customers gave:=Los compradores ofrecieron:
Exchange can not be done, check if you put all items!=La compra ha fallado, comprueba tu pago
Exchange can not be done, contact the shop owner.=La compra ha fallado, comunicate con el vendedor
Exchange shop (owned by @1)=Tienda de @1
Exchanged!=Comprado
In exchange, you give:=Vendes:
out of stock=Sin exsitencias
Owner gives:=Vendedor ofrece:
Owner wants:=Vendedor pide:
Owner, Use (E)+Place (right mouse button) for customer interface=Usa, las teclas (especial + boton derecho del raton) para ver a la interfaz del comprador
Shop=Tienda
This is your own shop, you can't exchange to yourself!=No puedes comprar en tu propia tienda
You want:=Tu pides:
Your stock:=Tus existencias:
currency-2021-04-14-1/locale/currency.fr.tr 0000664 0000000 0000000 00000002573 14003647705 0020156 0 ustar 00root root 0000000 0000000 # textdomain: currency
# Papou30, 2018.
# Louis Royer, 2020.
### barter.lua ###
Barter Table=Table de troc
Cancel=Annuler
Confirm=Valider
Start=Commencer
### shop.lua ###
Exchange=Troquer
### craftitems.lua ###
@1 Minegeld Note=@1 MineGeld
@1 Minegeld cent coin=Pièce de @1 centimes de MineGeld
Bundle of random Minegeld notes=Liasse de Minegeld de diverses valeurs
### safe.lua ###
Safe=Coffre-fort
Safe (owned by @1)=Coffre-fort (appartenant à @1)
### shop.lua ###
Customer gets:=Client obtient:
Customer gives (pay here!)=Client donne (payer ici!)
Customers gave:=Le client a donné:
Exchange can not be done, check if you put all items!=L'echange ne peut pas être fait, vérifiez que vous avez placé tous les articles!
Exchange can not be done, contact the shop owner.=L'échange ne peut être fait, contactez le propriétaire du magasin.
Exchange shop (owned by @1)=Boutique d'échange (appartenant à @1)
Exchanged!=Échangé!
In exchange, you give:=En échange, vous donnez :
Owner gives:=Le propriétaire donne :
Owner wants:=Le propriétaire veut :
Owner, Use (E)+Place (right mouse button) for customer interface=Propriétaire, utilisez Spécial+clic droit pour l'interface client
Shop=Boutique
This is your own shop, you can't exchange to yourself!=C'est votre propre boutique, vous ne pouvez pas échanger avec vous-même!
You want:=Vous voulez :
Your stock:=Votre stock :
currency-2021-04-14-1/locale/currency.it.tr 0000664 0000000 0000000 00000002532 14003647705 0020156 0 ustar 00root root 0000000 0000000 # textdomain: currency
# Saturn, 2020-10-23
### barter.lua ###
Barter Table=Tavolo di baratto
Cancel=Annulla
Confirm=Conferma
Start=Inizia
### shop.lua ###
Exchange=Scambia
### craftitems.lua ###
@1 Minegeld Note=Banconota da @1 Minegeld
@1 Minegeld cent coin=Moneta da @1 centesimo/i Minegeld
Bundle of random Minegeld notes=Pacchetto di banconote Minegeld casuali
### safe.lua ###
Safe=Cassaforte
Safe (owned by @1)=Cassaforte (di proprietà di @1)
### shop.lua ###
Customer gets:=Il cliente ottiene:
Customer gives (pay here!)=Il cliente dà (paga qui!)
Customers gave:=I clienti hanno dato:
Exchange can not be done, check if you put all items!=Lo scambio non può essere fatto, controlla di avere messo tutti gli oggetti!
Exchange can not be done, contact the shop owner.=Lo scambio non può essere fatto, contatta il proprietario del negozio.
Exchange shop (owned by @1)=Negozio di scambio (di proprietà di @1)
Exchanged!=Scambiato!
In exchange, you give:=In cambio, tu dai:
Owner gives:=Il proprietario dà:
Owner wants:=Il proprietario vuole:
Owner, Use (E)+Place (right mouse button) for customer interface=Proprietario, usa (E)+Posiziona (click destro) per l'UI cliente
Shop=Negozio
This is your own shop, you can't exchange to yourself!=Questo è il tuo negozio, non puoi fare scambi con te stesso!
You want:=Tu vuoi:
Your stock:=La tua scorta:
currency-2021-04-14-1/locale/currency.ms.tr 0000664 0000000 0000000 00000002241 14003647705 0020156 0 ustar 00root root 0000000 0000000 # textdomain: currency
### barter.lua ###
Barter Table=Meja Barter
Cancel=Batal
Confirm=Sah
Start=Mula
### shop.lua ###
Exchange=Tukar
### craftitems.lua ###
@1 Minegeld Note=Wang @1 MineGeld
@1 Minegeld cent coin=
Bundle of random Minegeld notes=Seberkas wang Minegeld rawak
### safe.lua ###
Safe=Peti besi
Safe (owned by @1)=Peti besi (pemilik: @1)
### shop.lua ###
Customer gets:=Pelanggan dapat:
Customer gives (pay here!)=Pelanggan beri (bayar sini!)
Customers gave:=Pelanggan berikan:
Exchange can not be done, check if you put all items!=Tak boleh jual, pastikan anda ada apa yang penjual mahukan!
Exchange can not be done, contact the shop owner.=Tak boleh jual, hubungi penjual.
Exchange shop (owned by @1)=Kedai (pemilik: @1)
Exchanged!=Jual!
In exchange, you give:=Anda berikan:
Owner gives:=Penjual berikan:
Owner wants:=Penjual inginkan:
Owner, Use (E)+Place (right mouse button) for customer interface=Penjual, Gunakan (E) + Letak (butang tetikus kanan) untuk antaramuka pelanggan
Shop=Kedai
This is your own shop, you can't exchange to yourself!=Ini kedai anda, anda tidak boleh menjual kepada diri sendiri!
You want:=Anda mahukan:
Your stock:=Stok anda:
currency-2021-04-14-1/locale/currency.ru.tr 0000664 0000000 0000000 00000003325 14003647705 0020171 0 ustar 00root root 0000000 0000000 # textdomain: currency
### barter.lua ###
Barter Table=Таблица бартера
Cancel=Отмена
Confirm=Подтверждение
Start=Старт
### shop.lua ###
Exchange=Обмен
### craftitems.lua ###
@1 Minegeld Note=Банкнота в @1 MineGeld
@1 Minegeld cent coin=
Bundle of random Minegeld notes=Пачка случайных банкнот Minegeld
### safe.lua ###
Safe=Сейф
Safe (owned by @1)=Сейф (принадлежит @1)
### shop.lua ###
Customer gets:=Покупатель получает:
Customer gives (pay here!)=Покупатель отдаёт (здесь оплата!)
Customers gave:=Покупатель отдал:
Exchange can not be done, check if you put all items!=Обмен невозможен, проверьте, что вы положили все предметы!
Exchange can not be done, contact the shop owner.=Обмен невозможен, свяжитесь с владельцем магазина.
Exchange shop (owned by @1)=Пункт обмена (принадлежит @1)
Exchanged!=Обмен произведён!
In exchange, you give:=Взамен вы даёте:
Owner gives:=Владелец отдаёт:
Owner wants:=Владелец хочет:
Owner, Use (E)+Place (right mouse button) for customer interface=Владелец, используйте (E)+Разместить (правая кнопка мыши) для открытия интерфейса покупателя
Shop=Магазин
This is your own shop, you can't exchange to yourself!=Это ваш собственный магазин, вы не можете обмениваться с самим собой!
You want:=Вы хотите:
Your stock:=Ваш запас:
currency-2021-04-14-1/locale/template.txt 0000664 0000000 0000000 00000001277 14003647705 0017723 0 ustar 00root root 0000000 0000000 # textdomain: currency
### barter.lua ###
Barter Table=
Cancel=
Confirm=
Start=
### shop.lua ###
Exchange=
### craftitems.lua ###
@1 Minegeld Note=
@1 Minegeld cent coin=
Bundle of random Minegeld notes=
### safe.lua ###
Safe=
Safe (owned by @1)=
### shop.lua ###
Customer gets:=
Customer gives (pay here!)=
Customers gave:=
Exchange can not be done, check if you put all items!=
Exchange can not be done, contact the shop owner.=
Exchange shop (owned by @1)=
Exchanged!=
In exchange, you give:=
out of stock=
Owner gives:=
Owner wants:=
Owner, Use (E)+Place (right mouse button) for customer interface=
Shop=
This is your own shop, you can't exchange to yourself!=
You want:=
Your stock:=
currency-2021-04-14-1/loot.lua 0000664 0000000 0000000 00000001435 14003647705 0015564 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-2021-04-14-1/mod.conf 0000664 0000000 0000000 00000000310 14003647705 0015521 0 ustar 00root root 0000000 0000000 name = currency
optional_depends = default, loot, pipeworks
description = Provides shops, barter tables, safes, and multiple denominations of currency, called "Minegeld".
min_minetest_version = 5.2.0
currency-2021-04-14-1/safe.lua 0000664 0000000 0000000 00000007177 14003647705 0015536 0 ustar 00root root 0000000 0000000 local S = minetest.get_translator("currency")
function currency.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
if minetest.global_exists("default") then
default.get_safe_formspec = currency.get_safe_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", player:get_player_name().." tried to access a safe belonging to "
..meta:get_string("owner").." at "
..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", player:get_player_name().." tried to access a safe belonging to "
..meta:get_string("owner").." at "
..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", player:get_player_name().." tried to access a safe belonging to "
..meta:get_string("owner").." at "
..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", player:get_player_name().." moves stuff in safe at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().." moves stuff to safe at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().." takes stuff from safe at "..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",
currency.get_safe_formspec(pos)
)
end
end,
})
currency-2021-04-14-1/settingtypes.txt 0000664 0000000 0000000 00000001063 14003647705 0017404 0 ustar 00root root 0000000 0000000 # Is income enabled?
currency.income_enabled (Is currency income enabled?) bool true
# Is income enabled for creative players?
currency.creative_income_enabled (Is income enabled for creative players?) bool true
# Item that is given as income by the currency mod
currency.income_item (Currency income item) string currency:minegeld_10
# Number of items given as income
currency.income_count (Currency income item) int 1 1 65535
# Length of time (in seconds) between checking if a user should get income
currency.income_period (Currency income period) int 720
currency-2021-04-14-1/shop.lua 0000664 0000000 0000000 00000027026 14003647705 0015564 0 ustar 00root root 0000000 0000000 local S = minetest.get_translator("currency")
currency.shop = {}
if minetest.global_exists("default") then
default.shop = currency.shop
end
currency.shop.current_shop = {}
currency.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[4,0;" .. S("You want:") .. "]"..
"list["..list_name..";owner_wants;4,0.5;3,2;]"..
"label[4,2.5;" .. S("In exchange, you give:") .. "]"..
"list["..list_name..";owner_gives;4,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")
currency.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
currency.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
currency.shop.cancel = function(meta)
--[[currency.shop.give_inventory(meta:get_inventory(),"pl1",meta:get_string("pl1"))
currency.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
currency.shop.exchange = function(meta)
--[[currency.shop.give_inventory(meta:get_inventory(),"pl1",meta:get_string("pl2"))
currency.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
local check_stock = function(
pos
)
local meta = minetest.get_meta(
pos
)
local minv = meta:get_inventory(
)
local gives = minv:get_list(
"owner_gives"
)
local can_exchange = true
for i, item in pairs(
gives
) do
if not minv:contains_item(
"stock",
item
) then
can_exchange = false
end
end
local owner = meta:get_string(
"owner"
)
if can_exchange then
meta:set_string(
"infotext",
S(
"Exchange shop (owned by @1)",
owner
)
)
local applicable = "currency:shop"
local node = minetest.get_node(
pos
)
if node.name == applicable then
return
end
node.name = applicable
minetest.swap_node(
pos,
node
)
else
meta:set_string(
"infotext",
S(
"Exchange shop (owned by @1)",
owner
) .. ", " .. S(
"out of stock"
)
)
local applicable = "currency:shop_empty"
local node = minetest.get_node(
pos
)
if node.name == applicable then
return
end
node.name = applicable
minetest.swap_node(
pos,
node
)
end
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 = currency.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
check_stock(
pos
)
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()
local result = inv:add_item("stock",stack)
check_stock(
pos
)
return result
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)
currency.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",currency.shop.formspec.owner(pos))
else
minetest.show_formspec(clicker:get_player_name(),"currency:shop_formspec",currency.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,
on_metadata_inventory_move = check_stock,
on_metadata_inventory_put = check_stock,
on_metadata_inventory_take = check_stock,
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_node("currency:shop_empty", {
description = S("Shop") .. " (" .. S("out of stock") .. ")",
paramtype2 = "facedir",
tiles = {"shop_top.png",
"shop_top.png",
"shop_side_empty.png",
"shop_side_empty.png",
"shop_side_empty.png",
"shop_front_empty.png"},
drop = "currency:shop",
groups = {choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1,not_in_creative_inventory=1},
sounds = currency.node_sound_wood_defaults(),
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()
local result = inv:add_item("stock",stack)
check_stock(
pos
)
return result
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)
currency.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",currency.shop.formspec.owner(pos))
else
minetest.show_formspec(clicker:get_player_name(),"currency:shop_formspec",currency.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,
on_metadata_inventory_move = check_stock,
on_metadata_inventory_put = check_stock,
on_metadata_inventory_take = check_stock,
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 = currency.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!"))
check_stock(
pos
)
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-2021-04-14-1/textures/ 0000775 0000000 0000000 00000000000 14003647705 0015764 5 ustar 00root root 0000000 0000000 currency-2021-04-14-1/textures/barter_base.png 0000664 0000000 0000000 00000001336 14003647705 0020746 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: