mods that hopefully work for a TechAge-based pack
@@ -0,0 +1,25 @@
|
||||
unused_args = false
|
||||
allow_defined_top = true
|
||||
|
||||
globals = {
|
||||
"yl_canned_food"
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
string = {fields = {"split"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
-- Core
|
||||
"minetest",
|
||||
"core",
|
||||
|
||||
-- Builtin
|
||||
"vector", "ItemStack",
|
||||
"dump", "DIR_DELIM", "VoxelArea", "Settings",
|
||||
|
||||
-- MTG
|
||||
"default", "sfinv", "creative",
|
||||
|
||||
-- depency
|
||||
"yl_api_nodestages"
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
Creative Commons Legal Code
|
||||
|
||||
CC0 1.0 Universal
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||
HEREUNDER.
|
||||
|
||||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for
|
||||
the purpose of contributing to a commons of creative, cultural and
|
||||
scientific works ("Commons") that the public can reliably and without fear
|
||||
of later claims of infringement build upon, modify, incorporate in other
|
||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||
and for any purposes, including without limitation commercial purposes.
|
||||
These owners may contribute to the Commons to promote the ideal of a free
|
||||
culture and the further production of creative, cultural and scientific
|
||||
works, or to gain reputation or greater distribution for their Work in
|
||||
part through the use and efforts of others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any
|
||||
expectation of additional consideration or compensation, the person
|
||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
@@ -0,0 +1,7 @@
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
# License
|
||||
|
||||
Copyright (c) 2024 AliasAlreadyTaken, Styxcolor
|
||||
|
||||
Code:
|
||||
|
||||
* [MIT](https://gitea.your-land.de/your-land/yl_canned_food/src/LICENSE-MIT) AliasAlreadyTaken
|
||||
|
||||
Media:
|
||||
|
||||
* screenshot.png [CC0](https://gitea.your-land.de/your-land/yl_canned_food/src/LICENSE-CC0) AliasAlreadyTaken
|
||||
* textures [CC0](https://gitea.your-land.de/your-land/yl_canned_food/src/LICENSE-CC0) Styxcolor
|
||||
yl_canned_food_apple_jam_plus.png
|
||||
yl_canned_food_apple_jam.png
|
||||
yl_canned_food_banana_jam_plus.png
|
||||
yl_canned_food_banana_jam.png
|
||||
yl_canned_food_blackberry_jam_plus.png
|
||||
yl_canned_food_blackberry_jam.png
|
||||
yl_canned_food_blueberry_jam_plus.png
|
||||
yl_canned_food_blueberry_jam.png
|
||||
yl_canned_food_canned_beans_plus.png
|
||||
yl_canned_food_canned_beans.png
|
||||
yl_canned_food_canned_beetroot_plus.png
|
||||
yl_canned_food_canned_beetroot.png
|
||||
yl_canned_food_canned_cabbage_plus.png
|
||||
yl_canned_food_canned_cabbage.png
|
||||
yl_canned_food_canned_carrot_plus.png
|
||||
yl_canned_food_canned_carrot.png
|
||||
yl_canned_food_canned_chili_pepper_plus.png
|
||||
yl_canned_food_canned_chili_pepper.png
|
||||
yl_canned_food_canned_coconut_plus.png
|
||||
yl_canned_food_canned_coconut.png
|
||||
yl_canned_food_canned_corn_plus.png
|
||||
yl_canned_food_canned_corn.png
|
||||
yl_canned_food_canned_cucumber_plus.png
|
||||
yl_canned_food_canned_cucumber.png
|
||||
yl_canned_food_canned_garlic_cloves_plus.png
|
||||
yl_canned_food_canned_garlic_cloves.png
|
||||
yl_canned_food_canned_mushrooms_plus.png
|
||||
yl_canned_food_canned_mushrooms.png
|
||||
yl_canned_food_canned_onion_plus.png
|
||||
yl_canned_food_canned_onion.png
|
||||
yl_canned_food_canned_peas_plus.png
|
||||
yl_canned_food_canned_peas.png
|
||||
yl_canned_food_canned_pineapple_plus.png
|
||||
yl_canned_food_canned_pineapple.png
|
||||
yl_canned_food_canned_potato_plus.png
|
||||
yl_canned_food_canned_potato.png
|
||||
yl_canned_food_canned_pumpkin_plus.png
|
||||
yl_canned_food_canned_pumpkin.png
|
||||
yl_canned_food_canned_tomato_plus.png
|
||||
yl_canned_food_canned_tomato.png
|
||||
yl_canned_food_dandelion_jam_plus.png
|
||||
yl_canned_food_dandelion_jam.png
|
||||
yl_canned_food_grape_jam_plus.png
|
||||
yl_canned_food_grape_jam.png
|
||||
yl_canned_food_honey_jar_plus.png
|
||||
yl_canned_food_honey_jar.png
|
||||
yl_canned_food_lemon_jam_plus.png
|
||||
yl_canned_food_lemon_jam.png
|
||||
yl_canned_food_melon_jam_plus.png
|
||||
yl_canned_food_melon_jam.png
|
||||
yl_canned_food_orange_jam_plus.png
|
||||
yl_canned_food_orange_jam.png
|
||||
yl_canned_food_pine_nuts_jar_plus.png
|
||||
yl_canned_food_pine_nuts_jar.png
|
||||
yl_canned_food_raspberry_jam_plus.png
|
||||
yl_canned_food_raspberry_jam.png
|
||||
yl_canned_food_rhubarb_jam_plus.png
|
||||
yl_canned_food_rhubarb_jam.png
|
||||
yl_canned_food_rose_jam_plus.png
|
||||
yl_canned_food_rose_jam.png
|
||||
yl_canned_food_strawberry_jam_plus.png
|
||||
yl_canned_food_strawberry_jam.png
|
||||
yl_canned_food_template_plus.png
|
||||
yl_canned_food_template.png
|
||||
@@ -0,0 +1,104 @@
|
||||
|
||||
# yl_canned_food
|
||||
|
||||
## Purpose
|
||||
|
||||
This mod is a contentlevel reimplementation of canned_food. yl_canned_food intends to be as extensible as possible.
|
||||
|
||||
## Download
|
||||
|
||||
Get it from https://gitea.your-land.de/your-land/yl_canned_food
|
||||
|
||||
## Dependencies
|
||||
|
||||
See [mod.conf](mod.conf)
|
||||
|
||||
* [yl_api_nodestages](https://gitea.your-land.de/your-land/yl_api_nodestages)
|
||||
|
||||
## Installation
|
||||
|
||||
1. Copy the "yl_canned_food" folder to your mod directory.
|
||||
2. Make sure the [dependencies](#dependencies) are satisfied, if any.
|
||||
3. Enable the mod in your world.mt file.
|
||||
|
||||
## Configuration
|
||||
|
||||
```
|
||||
yl_canned_food.debug = false
|
||||
```
|
||||
Set to true to enable debug mode
|
||||
|
||||
```
|
||||
yl_canned_food.freeze = false
|
||||
```
|
||||
Set to true to prevent the nodes from changing into the next stage
|
||||
|
||||
```
|
||||
yl_canned_food.legacy = false
|
||||
```
|
||||
|
||||
Set to true if you need drop-in replacement for canned_food. Set to false if you want uniform naming
|
||||
|
||||
```
|
||||
yl_canned_food.duration = 600
|
||||
```
|
||||
|
||||
Set this to a time in seconds. This time is necessary to go from the first to the second stage.
|
||||
|
||||
```
|
||||
yl_canned_food.max_light = 5
|
||||
```
|
||||
|
||||
Set this to a light level beetween 0 and 15. This time is the maximum light level the position may have to allow the first stage go to the second stage. A max_light of 5 means, that a position which receives 0 to 5 light can switch stage, while a position that receives 6 to 15 light cannot.
|
||||
|
||||
```
|
||||
yl_canned_food.chance = 33
|
||||
```
|
||||
|
||||
Set this to a number in percent between 0 and 100. This is the chance to go from the first to the second stage. 33 means, one in three will go to the next stage, the remaining restart their timer.
|
||||
|
||||
## Usage
|
||||
|
||||
This mod can be used in singleplayer and multiplayer. It comes with the canned food items, but no crafting recipes. To get those, install the integration mod for your game. The minetest_game integration is here: [yl_canned_food_mtg](https://gitea.your-land.de/your-land/yl_canned_food_mtg)
|
||||
|
||||
### Modmakers
|
||||
|
||||
Add to this mod or make your own based on yl_api_nodestages
|
||||
|
||||
## Limitations
|
||||
|
||||
Although this mod intends to achieve everything and more the canned_food mod brings with it, there is no guarantee it will look and feel entirely the same.
|
||||
|
||||
## Alternatives
|
||||
|
||||
* [canned_food](https://github.com/h-v-smacker/canned_food)
|
||||
|
||||
## Supported versions
|
||||
|
||||
If you use yl_canned_food, but something is wrong, please [file a bug](https://gitea.your-land.de/your-land/yl_canned_food/issues/new). PRs also welcome.
|
||||
|
||||
There is no reason to believe it doesn't work anywhere, but you never know.
|
||||
|
||||
## Allied projects
|
||||
|
||||
If you know a project that uses this mod tell us and we will add it to the list.
|
||||
|
||||
## Uninstall
|
||||
|
||||
Remove it from your mod folder or deactivate it in your world.mt
|
||||
|
||||
Mods that depend on it will cease to work, if the mod is removed without proper replacement.
|
||||
|
||||
## License
|
||||
|
||||
See [LICENSE.md](https://gitea.your-land.de/your-land/yl_canned_food/src/LICENSE.md)
|
||||
|
||||
* Code MIT Developername
|
||||
* Textures CC0 Styxcolor
|
||||
* Screenshot CC0 Styxcolor
|
||||
|
||||
## Thank you
|
||||
|
||||
* Original canned_food author: https://github.com/h-v-smacker
|
||||
* AspireMint
|
||||
* Styxcolor
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
yl_canned_food.settings = {}
|
||||
|
||||
yl_canned_food.settings.debug = minetest.settings:get_bool("yl_canned_food.debug",false)
|
||||
|
||||
yl_canned_food.settings.freeze = minetest.settings:get_bool("yl_canned_food.freeze",false)
|
||||
|
||||
yl_canned_food.settings.legacy = minetest.settings:get_bool("yl_canned_food.legacy",false)
|
||||
|
||||
yl_canned_food.settings.duration = minetest.settings:get("yl_canned_food.duration") or 600
|
||||
|
||||
yl_canned_food.settings.max_light = minetest.settings:get("yl_canned_food.max_light") or 5
|
||||
|
||||
yl_canned_food.settings.chance = minetest.settings:get("yl_canned_food.chance") or 33
|
||||
@@ -0,0 +1,46 @@
|
||||
This file holds a couple of editors notes regarding the mod.
|
||||
|
||||
Todo's can be noted here, known issues, the path to ressources or general annotations.
|
||||
|
||||
Original item names:
|
||||
|
||||
canned_food:apple_jam
|
||||
canned_food:banana_jam
|
||||
canned_food:blackberry_jam
|
||||
canned_food:blueberry_jam
|
||||
canned_food:canned_beans
|
||||
canned_food:canned_beetroot
|
||||
canned_food:canned_beetroot_plus
|
||||
canned_food:canned_cabbage
|
||||
canned_food:canned_cabbage_plus
|
||||
canned_food:canned_carrot
|
||||
canned_food:canned_carrot_plus
|
||||
canned_food:canned_chili_pepper
|
||||
canned_food:canned_chili_pepper_plus
|
||||
canned_food:canned_coconut
|
||||
canned_food:canned_corn
|
||||
canned_food:canned_cucumber
|
||||
canned_food:canned_cucumber_plus
|
||||
canned_food:canned_garlic_cloves
|
||||
canned_food:canned_garlic_cloves_plus
|
||||
canned_food:canned_mushrooms
|
||||
canned_food:canned_mushrooms_plus
|
||||
canned_food:canned_onion
|
||||
canned_food:canned_onion_plus
|
||||
canned_food:canned_peas
|
||||
canned_food:canned_pineapple
|
||||
canned_food:canned_potato
|
||||
canned_food:canned_potato_plus
|
||||
canned_food:canned_pumpkin
|
||||
canned_food:canned_tomato
|
||||
canned_food:canned_tomato_plus
|
||||
canned_food:dandelion_jam
|
||||
canned_food:grape_jam
|
||||
canned_food:honey_jar
|
||||
canned_food:melon_jam
|
||||
canned_food:orange_jam
|
||||
canned_food:pine_nuts_jar
|
||||
canned_food:raspberry_jam
|
||||
canned_food:rhubarb_jam
|
||||
canned_food:rose_jam
|
||||
canned_food:strawberry_jam
|
||||
@@ -0,0 +1,7 @@
|
||||
yl_canned_food.information = {}
|
||||
yl_canned_food.information.version = "1.0.0"
|
||||
yl_canned_food.information.author = "AliasAlreadyTaken"
|
||||
yl_canned_food.information.license = "MIT"
|
||||
yl_canned_food.information.name = "yl_canned_food"
|
||||
yl_canned_food.information.source = "https://gitea.your-land.de/your-land/yl_canned_food"
|
||||
yl_canned_food.information.additional = yl_canned_food.t("information_additional")
|
||||
@@ -0,0 +1,25 @@
|
||||
-- Version 1.0.0
|
||||
-- Author AliasAlreadyTaken
|
||||
-- License MIT
|
||||
|
||||
-- Changelog
|
||||
|
||||
local mod_start_time = minetest.get_us_time()
|
||||
minetest.log("action", "[MOD] yl_canned_food loading")
|
||||
|
||||
yl_canned_food = {}
|
||||
yl_canned_food.error = {}
|
||||
yl_canned_food.modname = minetest.get_current_modname()
|
||||
yl_canned_food.modstorage = minetest.get_mod_storage()
|
||||
yl_canned_food.modpath = minetest.get_modpath("yl_canned_food") .. DIR_DELIM
|
||||
yl_canned_food.worldpath = minetest.get_worldpath() .. DIR_DELIM
|
||||
|
||||
dofile(yl_canned_food.modpath .. "texts.lua")
|
||||
dofile(yl_canned_food.modpath .. "information.lua")
|
||||
dofile(yl_canned_food.modpath .. "config.lua")
|
||||
dofile(yl_canned_food.modpath .. "internal.lua")
|
||||
--dofile(yl_canned_food.modpath .. "initialize.lua")
|
||||
dofile(yl_canned_food.modpath .. "items.lua")
|
||||
|
||||
local mod_end_time = (minetest.get_us_time() - mod_start_time) / 1000000
|
||||
minetest.log("action", "[MOD] yl_canned_food loaded in [" .. mod_end_time .. "s]")
|
||||
@@ -0,0 +1,106 @@
|
||||
-- log
|
||||
--
|
||||
local function log(text)
|
||||
local logmessage = yl_canned_food.t("log_prefix", yl_canned_food.modname,
|
||||
text)
|
||||
if (yl_canned_food.settings.debug == true) then
|
||||
minetest.log("action", logmessage)
|
||||
end
|
||||
return logmessage
|
||||
end
|
||||
|
||||
function yl_canned_food.log(text) return log(text) end
|
||||
|
||||
-- get_node_definition
|
||||
--
|
||||
|
||||
local function get_node_definition(additonal_values)
|
||||
local t = {
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
|
||||
},
|
||||
groups = {
|
||||
attached_node = 1,
|
||||
dig_immediate = 3,
|
||||
canned_food = 1,
|
||||
vessel = 1
|
||||
}
|
||||
}
|
||||
for k, v in pairs(additonal_values) do t[k] = v end
|
||||
return t
|
||||
end
|
||||
|
||||
function yl_canned_food.get_node_definition(additonal_values)
|
||||
return get_node_definition(additonal_values)
|
||||
end
|
||||
|
||||
local function can_set(pos)
|
||||
if (yl_canned_food.settings.freeze == true) then return false end
|
||||
local light = minetest.get_node_light(pos)
|
||||
local roll = math.random() * 100
|
||||
if ((light and (light > yl_canned_food.settings.max_light)) or
|
||||
(roll > yl_canned_food.settings.chance)) then return false end
|
||||
return true
|
||||
end
|
||||
|
||||
function yl_canned_food.can_set(pos) return can_set(pos) end
|
||||
|
||||
-- register_food
|
||||
--
|
||||
|
||||
local function register_food(itemstring, itemdesc, origin)
|
||||
|
||||
local stages = {}
|
||||
|
||||
table.insert(stages, {
|
||||
stage_name = origin .. ":" .. itemstring[1],
|
||||
-- next_stages = origin .. ":" .. itemstring[2],
|
||||
next_stages = {
|
||||
{
|
||||
origin .. ":" .. itemstring[2], 1,
|
||||
{can_set = yl_canned_food.can_set}, nil
|
||||
}
|
||||
},
|
||||
duration = tonumber(yl_canned_food.settings.duration) or 600,
|
||||
tiles = {"yl_canned_food_" .. itemstring[1] .. ".png"},
|
||||
description = itemdesc[1],
|
||||
node_definition = yl_canned_food.get_node_definition({
|
||||
inventory_image = "yl_canned_food_" .. itemstring[1] .. ".png"
|
||||
}),
|
||||
overwrite = false,
|
||||
restart = true
|
||||
})
|
||||
|
||||
table.insert(stages, {
|
||||
stage_name = origin .. ":" .. itemstring[2],
|
||||
tiles = {"yl_canned_food_" .. itemstring[2] .. ".png"},
|
||||
description = itemdesc[2],
|
||||
node_definition = yl_canned_food.get_node_definition({
|
||||
inventory_image = "yl_canned_food_" .. itemstring[2] .. ".png"
|
||||
})
|
||||
})
|
||||
|
||||
local success, good, bad, total, reasons =
|
||||
yl_api_nodestages.register_stages(stages)
|
||||
|
||||
if (success == false) then
|
||||
yl_canned_food.log("action", "item = " .. dump(itemstring[1]))
|
||||
yl_canned_food.log("action", "success = " .. dump(success))
|
||||
yl_canned_food.log("action", "good = " .. dump(good))
|
||||
yl_canned_food.log("action", "bad = " .. dump(bad))
|
||||
yl_canned_food.log("action", "total = " .. dump(total))
|
||||
yl_canned_food.log("action", "reasons = " .. dump(reasons))
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function yl_canned_food.register_food(itemstring, itemdesc, origin)
|
||||
return register_food(itemstring, itemdesc, origin)
|
||||
end
|
||||
@@ -0,0 +1,200 @@
|
||||
if (yl_canned_food.settings.legacy == true) then
|
||||
return
|
||||
end
|
||||
|
||||
local origin = "yl_canned_food"
|
||||
|
||||
local foods = {
|
||||
apple_jam = {
|
||||
source = "apple_jam",
|
||||
target = "apple_jam_plus",
|
||||
source_desc = "Apple jam",
|
||||
target_desc = "Old Apple jam"
|
||||
},
|
||||
banana_jam = {
|
||||
source = "banana_jam",
|
||||
target = "banana_jam_plus",
|
||||
source_desc = "Banana jam",
|
||||
target_desc = "Old Banana jam"
|
||||
},
|
||||
blackberry_jam = {
|
||||
source = "blackberry_jam",
|
||||
target = "blackberry_jam_plus",
|
||||
source_desc = "Blackberry jam",
|
||||
target_desc = "Old Blackberry jam"
|
||||
},
|
||||
blueberry_jam = {
|
||||
source = "blueberry_jam",
|
||||
target = "blueberry_jam_plus",
|
||||
source_desc = "Blueberry jam",
|
||||
target_desc = "Old blueberry jam"
|
||||
},
|
||||
canned_beans = {
|
||||
source = "canned_beans",
|
||||
target = "canned_beans_plus",
|
||||
source_desc = "Canned beans",
|
||||
target_desc = "Pickled beans"
|
||||
},
|
||||
canned_beetroot = {
|
||||
source = "canned_beetroot",
|
||||
target = "canned_beetroot_plus",
|
||||
source_desc = "Canned beetroot",
|
||||
target_desc = "Pickled beetroot"
|
||||
},
|
||||
canned_cabbage = {
|
||||
source = "canned_cabbage",
|
||||
target = "canned_cabbage_plus",
|
||||
source_desc = "Canned cabbage",
|
||||
target_desc = "Sauerkraut"
|
||||
},
|
||||
canned_carrot = {
|
||||
source = "canned_carrot",
|
||||
target = "canned_carrot_plus",
|
||||
source_desc = "Canned carrots",
|
||||
target_desc = "Pickled carrot sticks"
|
||||
},
|
||||
canned_chili_pepper = {
|
||||
source = "canned_chili_pepper",
|
||||
target = "canned_chili_pepper_plus",
|
||||
source_desc = "Canned chili pepper",
|
||||
target_desc = "Pickled chili pepper"
|
||||
},
|
||||
canned_coconut = {
|
||||
source = "canned_coconut",
|
||||
target = "canned_coconut_plus",
|
||||
source_desc = "Canned coconut",
|
||||
target_desc = "Pickled coconut"
|
||||
},
|
||||
canned_corn = {
|
||||
source = "canned_corn",
|
||||
target = "canned_corn_plus",
|
||||
source_desc = "Canned corn",
|
||||
target_desc = "Pickled corn"
|
||||
},
|
||||
canned_cucumber = {
|
||||
source = "canned_cucumber",
|
||||
target = "canned_cucumber_plus",
|
||||
source_desc = "Canned cucumbers",
|
||||
target_desc = "Pickles"
|
||||
},
|
||||
canned_garlic_cloves = {
|
||||
source = "canned_garlic_cloves",
|
||||
target = "canned_garlic_cloves_plus",
|
||||
source_desc = "Canned Garlic Cloves",
|
||||
target_desc = "Pickled Garlic Cloves"
|
||||
},
|
||||
canned_mushrooms = {
|
||||
source = "canned_mushrooms",
|
||||
target = "canned_mushrooms_plus",
|
||||
source_desc = "Canned mushrooms",
|
||||
target_desc = "Salted mushrooms"
|
||||
},
|
||||
canned_onion = {
|
||||
source = "canned_onion",
|
||||
target = "canned_onion_plus",
|
||||
source_desc = "Canned onions",
|
||||
target_desc = "Pickled onions"
|
||||
},
|
||||
canned_peas = {
|
||||
source = "canned_peas",
|
||||
target = "canned_peas_plus",
|
||||
source_desc = "Canned peas",
|
||||
target_desc = "Pickled peas"
|
||||
},
|
||||
canned_pineapple = {
|
||||
source = "canned_pineapple",
|
||||
target = "canned_pineapple_plus",
|
||||
source_desc = "Canned pineapple rings",
|
||||
target_desc = "Pickled pineapple rings"
|
||||
},
|
||||
canned_potato = {
|
||||
source = "canned_potato",
|
||||
target = "canned_potato_plus",
|
||||
source_desc = "Canned potatoes",
|
||||
target_desc = "Mexican pickled potatoes"
|
||||
},
|
||||
canned_pumpkin = {
|
||||
source = "canned_pumpkin",
|
||||
target = "canned_pumpkin_plus",
|
||||
source_desc = "Canned pumpkin puree",
|
||||
target_desc = "Pickled pumpkin puree"
|
||||
},
|
||||
canned_tomato = {
|
||||
source = "canned_tomato",
|
||||
target = "canned_tomato_plus",
|
||||
source_desc = "Canned tomatoes",
|
||||
target_desc = "Marinated tomatoes"
|
||||
},
|
||||
dandelion_jam = {
|
||||
source = "dandelion_jam",
|
||||
target = "dandelion_jam_plus",
|
||||
source_desc = "Dandelion jam",
|
||||
target_desc = "Old dandelion jam"
|
||||
},
|
||||
grape_jam = {
|
||||
source = "grape_jam",
|
||||
target = "grape_jam_plus",
|
||||
source_desc = "Grape jam",
|
||||
target_desc = "Old Grape jam"
|
||||
},
|
||||
honey_jar = {
|
||||
source = "honey_jar",
|
||||
target = "honey_jar_plus",
|
||||
source_desc = "A jar of honey",
|
||||
target_desc = "A jar of aged honey"
|
||||
},
|
||||
lemon_jam = {
|
||||
source = "lemon_jam",
|
||||
target = "lemon_jam_plus",
|
||||
source_desc = "Lemon jam",
|
||||
target_desc = "Old lemon jam"
|
||||
},
|
||||
melon_jam = {
|
||||
source = "melon_jam",
|
||||
target = "melon_jam_plus",
|
||||
source_desc = "Melon jam",
|
||||
target_desc = "Old melon jam"
|
||||
},
|
||||
orange_jam = {
|
||||
source = "orange_jam",
|
||||
target = "orange_jam_plus",
|
||||
source_desc = "Orange jam",
|
||||
target_desc = "Old orange jam"
|
||||
},
|
||||
pine_nuts_jar = {
|
||||
source = "pine_nuts_jar",
|
||||
target = "pine_nuts_jar_plus",
|
||||
source_desc = "A jar of pine nuts",
|
||||
target_desc = "A jar of salted pine nuts"
|
||||
},
|
||||
raspberry_jam = {
|
||||
source = "raspberry_jam",
|
||||
target = "raspberry_jam_plus",
|
||||
source_desc = "Raspberry jam",
|
||||
target_desc = "Old raspberry jam"
|
||||
},
|
||||
rhubarb_jam = {
|
||||
source = "rhubarb_jam",
|
||||
target = "rhubarb_jam_plus",
|
||||
source_desc = "Rhubarb jam",
|
||||
target_desc = "Old rhubarb jam"
|
||||
},
|
||||
rose_jam = {
|
||||
source = "rose_jam",
|
||||
target = "rose_jam_plus",
|
||||
source_desc = "Rose petal jam",
|
||||
target_desc = "Old rose petal jam"
|
||||
},
|
||||
strawberry_jam = {
|
||||
source = "strawberry_jam",
|
||||
target = "strawberry_jam_plus",
|
||||
source_desc = "Strawberry jam",
|
||||
target_desc = "Old strawberry jam"
|
||||
}
|
||||
}
|
||||
|
||||
for _,v in pairs(foods) do
|
||||
local itemstring = {v.source, v.target}
|
||||
local itemdesc = {v.source_desc, v.target_desc}
|
||||
yl_canned_food.register_food(itemstring, itemdesc, origin)
|
||||
end
|
||||
@@ -0,0 +1,200 @@
|
||||
if (yl_canned_food.settings.legacy ~= true) then
|
||||
return
|
||||
end
|
||||
|
||||
local origin = "canned_food"
|
||||
|
||||
local foods = {
|
||||
apple_jam = {
|
||||
source = "apple_jam",
|
||||
target = "apple_jam_plus",
|
||||
source_desc = "Apple jam",
|
||||
target_desc = "Old Apple jam"
|
||||
},
|
||||
banana_jam = {
|
||||
source = "banana_jam",
|
||||
target = "banana_jam_plus",
|
||||
source_desc = "Banana jam",
|
||||
target_desc = "Old Banana jam"
|
||||
},
|
||||
blackberry_jam = {
|
||||
source = "blackberry_jam",
|
||||
target = "blackberry_jam_plus",
|
||||
source_desc = "Blackberry jam",
|
||||
target_desc = "Old Blackberry jam"
|
||||
},
|
||||
blueberry_jam = {
|
||||
source = "blueberry_jam",
|
||||
target = "blueberry_jam_plus",
|
||||
source_desc = "Blueberry jam",
|
||||
target_desc = "Old blueberry jam"
|
||||
},
|
||||
canned_beans = {
|
||||
source = "canned_beans",
|
||||
target = "canned_beans_plus",
|
||||
source_desc = "Canned beans",
|
||||
target_desc = "Pickled beans"
|
||||
},
|
||||
canned_beetroot = {
|
||||
source = "canned_beetroot",
|
||||
target = "canned_beetroot_plus",
|
||||
source_desc = "Canned beetroot",
|
||||
target_desc = "Pickled beetroot"
|
||||
},
|
||||
canned_cabbage = {
|
||||
source = "canned_cabbage",
|
||||
target = "canned_cabbage_plus",
|
||||
source_desc = "Canned cabbage",
|
||||
target_desc = "Sauerkraut"
|
||||
},
|
||||
canned_carrot = {
|
||||
source = "canned_carrot",
|
||||
target = "canned_carrot_plus",
|
||||
source_desc = "Canned carrots",
|
||||
target_desc = "Pickled carrot sticks"
|
||||
},
|
||||
canned_chili_pepper = {
|
||||
source = "canned_chili_pepper",
|
||||
target = "canned_chili_pepper_plus",
|
||||
source_desc = "Canned chili pepper",
|
||||
target_desc = "Pickled chili pepper"
|
||||
},
|
||||
canned_coconut = {
|
||||
source = "canned_coconut",
|
||||
target = "canned_coconut_plus",
|
||||
source_desc = "Canned coconut",
|
||||
target_desc = "Pickled coconut"
|
||||
},
|
||||
canned_corn = {
|
||||
source = "canned_corn",
|
||||
target = "canned_corn_plus",
|
||||
source_desc = "Canned corn",
|
||||
target_desc = "Pickled corn"
|
||||
},
|
||||
canned_cucumber = {
|
||||
source = "canned_cucumber",
|
||||
target = "canned_cucumber_plus",
|
||||
source_desc = "Canned cucumbers",
|
||||
target_desc = "Pickles"
|
||||
},
|
||||
canned_garlic_cloves = {
|
||||
source = "canned_garlic_cloves",
|
||||
target = "canned_garlic_cloves_plus",
|
||||
source_desc = "Canned Garlic Cloves",
|
||||
target_desc = "Pickled Garlic Cloves"
|
||||
},
|
||||
canned_mushrooms = {
|
||||
source = "canned_mushrooms",
|
||||
target = "canned_mushrooms_plus",
|
||||
source_desc = "Canned mushrooms",
|
||||
target_desc = "Salted mushrooms"
|
||||
},
|
||||
canned_onion = {
|
||||
source = "canned_onion",
|
||||
target = "canned_onion_plus",
|
||||
source_desc = "Canned onions",
|
||||
target_desc = "Pickled onions"
|
||||
},
|
||||
canned_peas = {
|
||||
source = "canned_peas",
|
||||
target = "canned_peas_plus",
|
||||
source_desc = "Canned peas",
|
||||
target_desc = "Pickled peas"
|
||||
},
|
||||
canned_pineapple = {
|
||||
source = "canned_pineapple",
|
||||
target = "canned_pineapple_plus",
|
||||
source_desc = "Canned pineapple rings",
|
||||
target_desc = "Pickled pineapple rings"
|
||||
},
|
||||
canned_potato = {
|
||||
source = "canned_potato",
|
||||
target = "canned_potato_plus",
|
||||
source_desc = "Canned potatoes",
|
||||
target_desc = "Mexican pickled potatoes"
|
||||
},
|
||||
canned_pumpkin = {
|
||||
source = "canned_pumpkin",
|
||||
target = "canned_pumpkin_plus",
|
||||
source_desc = "Canned pumpkin puree",
|
||||
target_desc = "Pickled pumpkin puree"
|
||||
},
|
||||
canned_tomato = {
|
||||
source = "canned_tomato",
|
||||
target = "canned_tomato_plus",
|
||||
source_desc = "Canned tomatoes",
|
||||
target_desc = "Marinated tomatoes"
|
||||
},
|
||||
dandelion_jam = {
|
||||
source = "dandelion_jam",
|
||||
target = "dandelion_jam_plus",
|
||||
source_desc = "Dandelion jam",
|
||||
target_desc = "Old dandelion jam"
|
||||
},
|
||||
grape_jam = {
|
||||
source = "grape_jam",
|
||||
target = "grape_jam_plus",
|
||||
source_desc = "Grape jam",
|
||||
target_desc = "Old Grape jam"
|
||||
},
|
||||
honey_jar = {
|
||||
source = "honey_jar",
|
||||
target = "honey_jar_plus",
|
||||
source_desc = "A jar of honey",
|
||||
target_desc = "A jar of aged honey"
|
||||
},
|
||||
lemon_jam = {
|
||||
source = "lemon_jam",
|
||||
target = "lemon_jam_plus",
|
||||
source_desc = "Lemon jam",
|
||||
target_desc = "Old lemon jam"
|
||||
},
|
||||
melon_jam = {
|
||||
source = "melon_jam",
|
||||
target = "melon_jam_plus",
|
||||
source_desc = "Melon jam",
|
||||
target_desc = "Old melon jam"
|
||||
},
|
||||
orange_jam = {
|
||||
source = "orange_jam",
|
||||
target = "orange_jam_plus",
|
||||
source_desc = "Orange jam",
|
||||
target_desc = "Old orange jam"
|
||||
},
|
||||
pine_nuts_jar = {
|
||||
source = "pine_nuts_jar",
|
||||
target = "pine_nuts_jar_plus",
|
||||
source_desc = "A jar of pine nuts",
|
||||
target_desc = "A jar of salted pine nuts"
|
||||
},
|
||||
raspberry_jam = {
|
||||
source = "raspberry_jam",
|
||||
target = "raspberry_jam_plus",
|
||||
source_desc = "Raspberry jam",
|
||||
target_desc = "Old raspberry jam"
|
||||
},
|
||||
rhubarb_jam = {
|
||||
source = "rhubarb_jam",
|
||||
target = "rhubarb_jam_plus",
|
||||
source_desc = "Rhubarb jam",
|
||||
target_desc = "Old rhubarb jam"
|
||||
},
|
||||
rose_jam = {
|
||||
source = "rose_jam",
|
||||
target = "rose_jam_plus",
|
||||
source_desc = "Rose petal jam",
|
||||
target_desc = "Old rose petal jam"
|
||||
},
|
||||
strawberry_jam = {
|
||||
source = "strawberry_jam",
|
||||
target = "strawberry_jam_plus",
|
||||
source_desc = "Strawberry jam",
|
||||
target_desc = "Old strawberry jam"
|
||||
}
|
||||
}
|
||||
|
||||
for _,v in pairs(foods) do
|
||||
local itemstring = {v.source, v.target}
|
||||
local itemdesc = {v.source_desc, v.target_desc}
|
||||
yl_canned_food.register_food(itemstring, itemdesc, origin)
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
dofile(yl_canned_food.modpath .. "item_foods.lua")
|
||||
dofile(yl_canned_food.modpath .. "item_legacy.lua")
|
||||
@@ -0,0 +1,5 @@
|
||||
name = yl_canned_food
|
||||
description = Adds canned food
|
||||
depends = yl_api_nodestages
|
||||
author = AliasAlreadyTaken
|
||||
title = Canned Food
|
||||
|
After Width: | Height: | Size: 1.5 MiB |
@@ -0,0 +1,31 @@
|
||||
[category]
|
||||
|
||||
# Debug
|
||||
# Set this to true to enable debug mode, it will output some more values to log
|
||||
# Optional, default is false
|
||||
yl_canned_food.debug (Debug mode) bool false
|
||||
|
||||
# Freeze mode
|
||||
# Set this to true to enable freeze mode, which will prevent the nodes from changing into their next_stages
|
||||
# Optional, default is false
|
||||
yl_canned_food.freeze (Freeze mode) bool false
|
||||
|
||||
# Enables legacy naming mode
|
||||
# Set to true if you need drop-in replacement for canned_food. Set to false if you want uniform naming
|
||||
# Optional, default false
|
||||
yl_canned_food.legacy (Enables legacy naming mode) bool false
|
||||
|
||||
# Duration
|
||||
# Set this to a time in seconds. This time is necessary to go from the first to the second stage.
|
||||
# Optional, default 600
|
||||
yl_canned_food.duration (Duration) float 600 1
|
||||
|
||||
# Maximum light
|
||||
# Set this to a light level between 0 and 15, above which the canned_food cannot enter second stage.
|
||||
# Optional, default 5
|
||||
yl_canned_food.max_light (Maximum light) int 5 0 15
|
||||
|
||||
# Chance
|
||||
# Set this to a chance in percent. Example: chance of 33 means one in three will go to the next stage, the remaining restart their timer.
|
||||
# Optional, default 33
|
||||
yl_canned_food.chance (Chance) float 33 1 100
|
||||
@@ -0,0 +1,27 @@
|
||||
local S = minetest.get_translator(yl_canned_food.modname)
|
||||
|
||||
local texts = {}
|
||||
|
||||
function yl_canned_food.t(key, ...) return S(texts[key], ...) or "" end
|
||||
|
||||
-- Fixed texts
|
||||
|
||||
texts["log_prefix"] = "[MOD] @1 : @2"
|
||||
|
||||
-- Translateable texts
|
||||
|
||||
texts["information_additional"] = "Adds canned food"
|
||||
|
||||
-- Errormessages
|
||||
|
||||
texts["error_not_a_string"] = "@1 not a string"
|
||||
texts["error_player_not_online"] = "@1 not an online player"
|
||||
texts["error_not_a_colorspec"] = "@1 not a ColorSpec"
|
||||
texts["error_not_a_position"] = "@1 not a position"
|
||||
texts["error_function_not_available"] = "@1 not available"
|
||||
|
||||
texts["error_cannot_open_file"] = "Error opening file: @1"
|
||||
texts["error_cannot_read_file"] = "Error reading file: @1"
|
||||
|
||||
texts["error_name_not_found"] = "Name not found: @1"
|
||||
texts["error_priv_not_found"] = "Priv not found: @1"
|
||||
|
After Width: | Height: | Size: 653 B |
|
After Width: | Height: | Size: 696 B |
|
After Width: | Height: | Size: 690 B |
|
After Width: | Height: | Size: 726 B |
|
After Width: | Height: | Size: 775 B |
|
After Width: | Height: | Size: 801 B |
|
After Width: | Height: | Size: 678 B |
|
After Width: | Height: | Size: 715 B |
|
After Width: | Height: | Size: 620 B |
|
After Width: | Height: | Size: 652 B |
|
After Width: | Height: | Size: 723 B |
|
After Width: | Height: | Size: 750 B |
|
After Width: | Height: | Size: 769 B |
|
After Width: | Height: | Size: 800 B |
|
After Width: | Height: | Size: 675 B |
|
After Width: | Height: | Size: 712 B |
|
After Width: | Height: | Size: 725 B |
|
After Width: | Height: | Size: 755 B |
|
After Width: | Height: | Size: 670 B |
|
After Width: | Height: | Size: 708 B |
|
After Width: | Height: | Size: 735 B |
|
After Width: | Height: | Size: 770 B |
|
After Width: | Height: | Size: 729 B |
|
After Width: | Height: | Size: 758 B |
|
After Width: | Height: | Size: 632 B |
|
After Width: | Height: | Size: 669 B |
|
After Width: | Height: | Size: 695 B |
|
After Width: | Height: | Size: 728 B |
|
After Width: | Height: | Size: 673 B |
|
After Width: | Height: | Size: 710 B |
|
After Width: | Height: | Size: 611 B |
|
After Width: | Height: | Size: 656 B |
|
After Width: | Height: | Size: 746 B |
|
After Width: | Height: | Size: 782 B |
|
After Width: | Height: | Size: 669 B |
|
After Width: | Height: | Size: 706 B |
|
After Width: | Height: | Size: 703 B |
|
After Width: | Height: | Size: 731 B |
|
After Width: | Height: | Size: 693 B |
|
After Width: | Height: | Size: 719 B |
|
After Width: | Height: | Size: 731 B |
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 756 B |
|
After Width: | Height: | Size: 786 B |
|
After Width: | Height: | Size: 680 B |
|
After Width: | Height: | Size: 719 B |
|
After Width: | Height: | Size: 656 B |
|
After Width: | Height: | Size: 687 B |
|
After Width: | Height: | Size: 732 B |
|
After Width: | Height: | Size: 756 B |
|
After Width: | Height: | Size: 724 B |
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 761 B |
|
After Width: | Height: | Size: 800 B |
|
After Width: | Height: | Size: 687 B |
|
After Width: | Height: | Size: 722 B |
|
After Width: | Height: | Size: 697 B |
|
After Width: | Height: | Size: 726 B |
|
After Width: | Height: | Size: 780 B |
|
After Width: | Height: | Size: 810 B |
|
After Width: | Height: | Size: 799 B |
|
After Width: | Height: | Size: 823 B |
|
After Width: | Height: | Size: 531 B |
|
After Width: | Height: | Size: 559 B |