Présentation
Cette bibliothèque permet d'exécuter des scripts Python dans le jeu Minetest (un jeu largement inspiré de Minecraft mais open source et gratuit).
Ce travail s'appuie sur celui de Alessandro Norfo (sprintingkiwi) https://github.com/sprintingkiwi/pycraft_lib, également inspiré de Aron Nieminen et Mojang AB pour la partie connexion.
Installation
Côté jeu
Windows:
- Télécharger une version de Minetest préconfigurée https://github.com/sprintingkiwi/pycraft_mod/releases/download/0.22/Pycraft_Minetest.exe.Il s'agit d'une version 4.16, portable.
Linux:
- Installer le jeu Minetest: https://www.minetest.net/downloads/
- Installer Lua (5.1)
- Installer Luarocks
- Dans un terminal, exécuter:
luarocks install luasocket
- Décompresser le pycraft_mod de sprintingkiwi dans le dossier mods de Minetest: https://github.com/sprintingkiwi/pycraft_mod/releases/tag/0.22
- Renommer le dossier du pycraft_mod, pour qu'il n'y ait pas de point, d'espace...
- Dans le jeu, créer un monde et activer le pycraft_mod dans la configuration.
Côté Python
- Installer la bibliothèque minetest-python-nsi
pip install minetest-python-nsi
- Importer la bibliothèque
from minetest_python_nsi import *
Utilisation
from minetest_python_nsi import *
# Connexion en local
connexion()
pos = recuperer_ma_position()
x, y, z = pos[0], pos[1], pos[2]+1
# Pose un bloc de diamant à côté du joueur
poser_bloc((x, y, z), 57)
from minetest_python_nsi import *
# Connexion à un serveur distant
# port par défaut: 4711
connexion("mon_pseudo", "mon_serveur.fr", 4711)
La documentation complète de la librairie.
Metadata
Release files for minetest-python-nsi 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| minetest_python_nsi-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for minetest_python_nsi-0.3.0-py3-none-any.whl |
Release files / minetest_python_nsi-0.3.0-py3-none-any.whl
| Download URL | minetest_python_nsi-0.3.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c39c029af08762e263104272f7a22418a385a6daf3e9da4422e66c413f07ae39
|
|
BLAKE2b-256 checksum How to use checksums |
10057e224794f5513d28fdd7a30505c137067465e7b0fea87292cdd6eab3fb94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Security for minetest-python-nsi 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.