2 # Copyright (C) 2018 rubenwardy
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
18 import os, sys, datetime, inspect
20 if not "FLASK_CONFIG" in os.environ:
21 os.environ["FLASK_CONFIG"] = "../config.cfg"
23 delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
24 create_db = not (len(sys.argv) >= 2 and sys.argv[1].strip() == "-o")
25 test_data = len(sys.argv) >= 2 and sys.argv[1].strip() == "-t" or not create_db
27 # Allow finding the `app` module
28 currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
29 parentdir = os.path.dirname(currentdir)
30 sys.path.insert(0,parentdir)
32 from app.models import *
33 from app.utils import make_flask_user_password
35 def defineDummyData(licenses, tags, ruben):
37 ez.github_username = "Ezhh"
38 ez.forums_username = "Shara"
39 ez.rank = UserRank.EDITOR
42 not1 = Notification(ruben, ez, "Awards approved", "/packages/rubenwardy/awards/")
46 jeija.github_username = "Jeija"
47 jeija.forums_username = "Jeija"
54 mod.title = "Alpha Test"
55 mod.license = licenses["MIT"]
56 mod.type = PackageType.MOD
58 mod.tags.append(tags["mapgen"])
59 mod.tags.append(tags["environment"])
60 mod.repo = "https://github.com/ezhh/other_worlds"
61 mod.issueTracker = "https://github.com/ezhh/other_worlds/issues"
63 mod.short_desc = "The content library should not be used yet as it is still in alpha"
64 mod.desc = "This is the long desc"
67 rel = PackageRelease()
70 rel.url = "https://github.com/ezhh/handholds/archive/master.zip"
78 mod1.license = licenses["LGPLv2.1"]
79 mod1.type = PackageType.MOD
81 mod1.tags.append(tags["player_effects"])
82 mod1.repo = "https://github.com/rubenwardy/awards"
83 mod1.issueTracker = "https://github.com/rubenwardy/awards/issues"
85 mod1.short_desc = "Adds achievements and an API to register new ones."
87 Majority of awards are back ported from Calinou's old fork in Carbone, under same license.
90 awards.register_achievement("award_mesefind",{
91 title = "First Mese Find",
92 description = "Found some Mese!",
94 type = "dig", -- award is given when
95 node = "default:mese", -- this type of node has been dug
96 target = 1, -- this number of times
102 rel = PackageRelease()
105 rel.url = "https://github.com/rubenwardy/awards/archive/master.zip"
111 mod2.name = "mesecons"
112 mod2.title = "Mesecons"
113 mod2.tags.append(tags["tools"])
114 mod2.type = PackageType.MOD
115 mod2.license = licenses["LGPLv3"]
117 mod2.repo = "https://github.com/minetest-mods/mesecons/"
118 mod2.issueTracker = "https://github.com/minetest-mods/mesecons/issues"
120 mod2.short_desc = "Mesecons adds everything digital, from all kinds of sensors, switches, solar panels, detectors, pistons, lamps, sound blocks to advanced digital circuitry like logic gates and programmable blocks."
122 ########################################################################
123 ## __ __ _____ _____ _____ _____ _____ _ _ _____ ##
124 ## | \ / | | ___| | ___| | ___| | ___| | _ | | \ | | | ___| ##
125 ## | \/ | | |___ | |___ | |___ | | | | | | | \| | | |___ ##
126 ## | |\__/| | | ___| |___ | | ___| | | | | | | | | |___ | ##
127 ## | | | | | |___ ___| | | |___ | |___ | |_| | | |\ | ___| | ##
128 ## |_| |_| |_____| |_____| |_____| |_____| |_____| |_| \_| |_____| ##
130 ########################################################################
132 MESECONS by Jeija and contributors
136 [Mesecons](http://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay.
138 Mesecons is a mod for [Minetest](http://minetest.net/) that implements a ton of items related to digital circuitry, such as wires, buttons, lights, and even programmable controllers. Among other things, there are also pistons, solar panels, pressure plates, and note blocks.
140 Mesecons has a similar goal to Redstone in Minecraft, but works in its own way, with different rules and mechanics.
146 [DOWNLOAD IT NOW](https://github.com/minetest-mods/mesecons/archive/master.zip)
148 Now go ahead and install it like any other Minetest mod. Don't know how? Check out [the wonderful page about it](http://wiki.minetest.com/wiki/Mods) over at the Minetest Wiki. For your convenience, here's a quick summary:
150 1. If Mesecons is still in a ZIP file, extract the folder inside to somewhere on the computer.
151 2. Make sure that when you open the folder, you can directly find `README.md` in the listing. If you just see another folder, move that folder up one level and delete the old one.
152 3. Open up the Minetest mods folder - usually `/mods/`. If you see the `minetest` or folder inside of that, that is your mod folder instead.
153 4. Copy the Mesecons folder into the mods folder.
155 Don't like some parts of Mesecons? Open up the Mesecons folder and delete the subfolder containing the mod you don't want. If you didn't want movestones, for example, all you have to do is delete the `mesecons_movestones` folder and they will no longer be available.
157 There are no dependencies - it will work right after installing!
159 How do I use this thing?
160 ------------------------
161 How about a [quick overview video](https://www.youtube.com/watch?v=6kmeQj6iW5k)?
163 Or maybe a [comprehensive reference](http://mesecons.net/items.html) is your style?
165 An overview for the very newest of new beginners? How does [this one](http://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
167 Want to get more into building? Why not check out the [Mesecons Laboratory](http://uberi.mesecons.net/), a website dedicated to advanced Mesecons builders?
169 Want to contribute to Mesecons itself? Check out the [source code](https://github.com/minetest-mods/mesecons)!
171 Who wrote it anyways?
172 ---------------------
173 These awesome people made Mesecons possible!
175 | Contributor | Contribution |
176 | --------------- | -------------------------------- |
177 | Hawk777 | Code for VoxelManip caching |
178 | Jat15 | Various tweaks. |
179 | Jeija | **Main developer! Everything.** |
180 | Jordach | Noteblock sounds. |
181 | khonkhortistan | Code, recipes, textures. |
182 | Kotolegokot | Nodeboxes for items. |
183 | minerd247 | Textures. |
184 | Nore/Novatux | Code. |
185 | RealBadAngel | Fixes, improvements. |
186 | sfan5 | Code, recipes, textures. |
187 | suzenako | Piston sounds. |
188 | Uberi/Temperest | Code, textures, documentation. |
189 | VanessaE | Code, recipes, textures, design. |
190 | Whiskers75 | Logic gates implementation. |
192 There are also a whole bunch of other people helping with everything from code to testing and feedback. Mesecons would also not be possible without their help!
194 Alright, how can I use it?
195 --------------------------
196 All textures in this project are licensed under the CC-BY-SA 3.0 (Creative Commons Attribution-ShareAlike 3.0 Generic). That means you can distribute and remix them as much as you want to, under the condition that you give credit to the authors and the project, and that if you remix and release them, they must be under the same or similar license to this one.
198 All code in this project is licensed under the LGPL version 3 or later. That means you have unlimited freedom to distribute and modify the work however you see fit, provided that if you decide to distribute it or any modified versions of it, you must also use the same license. The LGPL also grants the additional freedom to write extensions for the software and distribute them without the extensions being subject to the terms of the LGPL, although the software itself retains its license.
200 No warranty is provided, express or implied, for any part of the project.
209 mod.name = "handholds"
210 mod.title = "Handholds"
211 mod.license = licenses["MIT"]
212 mod.type = PackageType.MOD
214 mod.tags.append(tags["player_effects"])
215 mod.repo = "https://github.com/ezhh/handholds"
216 mod.issueTracker = "https://github.com/ezhh/handholds/issues"
218 mod.short_desc = "Adds hand holds and climbing thingies"
219 mod.desc = "This is the long desc"
222 rel = PackageRelease()
225 rel.url = "https://github.com/ezhh/handholds/archive/master.zip"
231 mod.name = "other_worlds"
232 mod.title = "Other Worlds"
233 mod.license = licenses["MIT"]
234 mod.type = PackageType.MOD
236 mod.tags.append(tags["mapgen"])
237 mod.tags.append(tags["environment"])
238 mod.repo = "https://github.com/ezhh/other_worlds"
239 mod.issueTracker = "https://github.com/ezhh/other_worlds/issues"
241 mod.short_desc = "Adds space with asteroids and comets"
242 mod.desc = "This is the long desc"
249 mod.license = licenses["LGPLv2.1"]
250 mod.type = PackageType.MOD
252 mod.tags.append(tags["player_effects"])
253 mod.repo = "https://github.com/rubenwardy/food/"
254 mod.issueTracker = "https://github.com/rubenwardy/food/issues/"
256 mod.short_desc = "Adds lots of food and an API to manage ingredients"
257 mod.desc = "This is the long desc"
263 mod.name = "food_sweet"
264 mod.title = "Sweet Foods"
265 mod.license = licenses["CC0"]
266 mod.type = PackageType.MOD
268 mod.tags.append(tags["player_effects"])
269 mod.repo = "https://github.com/rubenwardy/food_sweet/"
270 mod.issueTracker = "https://github.com/rubenwardy/food_sweet/issues/"
272 mod.short_desc = "Adds sweet food"
273 mod.desc = "This is the long desc"
278 game1.approved = True
279 game1.name = "capturetheflag"
280 game1.title = "Capture The Flag"
281 game1.type = PackageType.GAME
282 game1.license = licenses["LGPLv2.1"]
284 game1.tags.append(tags["pvp"])
285 game1.tags.append(tags["survival"])
286 game1.tags.append(tags["multiplayer"])
287 game1.repo = "https://github.com/rubenwardy/capturetheflag"
288 game1.issueTracker = "https://github.com/rubenwardy/capturetheflag/issues"
290 game1.short_desc = "Two teams battle to snatch and return the enemy's flag, before the enemy takes their own!"
292 As seen on the Capture the Flag server (minetest.rubenwardy.com:30000)
294 Uses the CTF PvP Engine.
297 db.session.add(game1)
299 rel = PackageRelease()
302 rel.url = "https://github.com/rubenwardy/capturetheflag/archive/master.zip"
309 mod.name = "pixelbox"
310 mod.title = "PixelBOX Reloaded"
311 mod.license = licenses["CC0"]
312 mod.type = PackageType.TXP
315 mod.short_desc = "This is an update of the original PixelBOX texture pack by the brillant artist Gambit"
316 mod.desc = "This is the long desc"
319 rel = PackageRelease()
322 rel.url = "http://mamadou3.free.fr/Minetest/PixelBOX.zip"
329 for package in Package.query.filter_by(type=PackageType.MOD).all():
332 meta = metas[package.name]
334 meta = MetaPackage(package.name)
336 metas[package.name] = meta
337 package.provides.append(meta)
339 dep = Dependency(food_sweet, meta=metas["food"])
343 if delete_db and os.path.isfile("db.sqlite"):
344 os.remove("db.sqlite")
348 print("Creating database tables...")
351 print("Filling database...")
353 ruben = User("rubenwardy")
355 ruben.password = make_flask_user_password("tuckfrump")
356 ruben.github_username = "rubenwardy"
357 ruben.forums_username = "rubenwardy"
358 ruben.rank = UserRank.ADMIN
359 db.session.add(ruben)
362 for tag in ["Inventory", "Mapgen", "Building", \
363 "Mobs and NPCs", "Tools", "Player effects", \
364 "Environment", "Transport", "Maintenance", "Plants and farming", \
365 "PvP", "PvE", "Survival", "Creative", "Puzzle", "Multiplayer", "Singleplayer"]:
371 for license in ["GPLv2.1", "GPLv3", "LGPLv2.1", "LGPLv3", "AGPLv2.1", "AGPLv3",
372 "Apache", "BSD 3-Clause", "BSD 2-Clause", "CC0", "CC-BY-SA",
373 "CC-BY", "MIT", "ZLib", "Other (Free)"]:
374 row = License(license)
375 licenses[row.name] = row
378 for license in ["CC-BY-NC-SA", "Other (Non-free)"]:
379 row = License(license, False)
380 licenses[row.name] = row
384 defineDummyData(licenses, tags, ruben)