Installation de Minetest 0.4.15 + Raspberryjammod 0.20 + Blocky 201612 sous Ubuntu 22.04

Distribution de travail :

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

Liens :
https://atelier.hacktech.dev/installation-du-client-minetest-stable-0-4-15-sur-raspberry-pi-3/
https://atelier.hacktech.dev/minetest-installation-de-raspberryjammod-python/
https://atelier.hacktech.dev/compilation-de-blockly-sous-ubuntu-17-10/
https://atelier.hacktech.dev/minetest-programmation-par-bloc-blockly/

Installation de Python 2.7

util01@station40:~$ sudo apt install python2
util01@station40:~$ python2.7 --version
util01@station40:~$ Python 2.7.18

I/ Installation de Minetest.

1/ Installation des paquets de développement.

util01@station40:~$ sudo apt-get install build-essential git-core cmake libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libluajit-5.1-2 libluajit-5.1-dev  libncurses5-dev doxygen gettext-base libgettextpo-dev libopenal-dev libvorbis-dev gettext libleveldb-dev postgresql postgresql-server-dev

2/ Création du répertoire de travail.

util01@station40:~$ mkdir -p JEUX/MINETEST.415
util01@station40:~$ cd JEUX/MINETEST.415/
util01@station40:~/JEUX/MINETEST.415 $ 

3/ Téléchargement du moteur Minetest.

util01@station40:~/JEUX/MINETEST.415 $ wget https://github.com/minetest/minetest/archive/refs/tags/0.4.15.tar.gz
util01@station40:~/JEUX/MINETEST.415 $ mv 0.4.15.tar.gz minetest_0.4.15.tar.gz
util01@station40:~/JEUX/MINETEST.415 $ tar xvfz minetest_0.4.15.tar.gz
util01@station40:~/JEUX/MINETEST.415 $ mv minetest-0.4.15 minetest
util01@station40:~/JEUX/MINETEST.415 $ cd minetest

4/ Téléchargement du jeu Minetest.

util01@station40:~/JEUX/MINETEST.415 $ wget https://github.com/minetest/minetest_game/archive/refs/tags/0.4.15.tar.gz
util01@station40:~/JEUX/MINETEST.415 $ mv 0.4.15.tar.gz minetest_game_0.4.15.tar.gz
util01@station40:~/JEUX/MINETEST.415 $ tar xvfz minetest_game_0.4.15.tar.gz
util01@station40:~/JEUX/MINETEST.415 $ mv minetest_game-0.4.15 minetest_game
util01@station40:~/JEUX/MINETEST.415 $ cd minetest

5/ Configuration de la compilation.

util01@station40:~/JEUX/MINETEST.415/minetest $ cmake . -DRUN_IN_PLACE=TRUE -DBUILD_SERVER=TRUE -DENABLE_LUAJIT=TRUE -DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=TRUE -DENABLE_CURL=TRUE -DENABLE_GLES=TRUE -DCMAKE_BUILD_TYPE=Release

6/ Compilation.

util01@station40:~/JEUX/MINETEST.415/minetest $ make -j2
util01@station40:~/JEUX/MINETEST.415/minetest $ cd games/
util01@station40:~/JEUX/MINETEST.415/minetest/games $ 

7/ Installation du jeu Minetest.

util01@station40:~/JEUX/MINETEST.415/minetest/games $ ln -s ../../minetest_game_0.4.15 minetest_game
util01@station40:~/JEUX/MINETEST.415/minetest/games $ cd ..

8/ Lancement du client Minetest.

util01@station40:~/JEUX/MINETEST.415/minetest $ cd bin/
util01@station40:~/JEUX/MINETEST.415/minetest/bin $ ./minetest

II/ Installation de RaspberryJamMod Minetest.

1/ Installation des paquets de développement Lua pour le réseau.

util01@station40:~/JEUX/MINETEST.415 $ sudo apt-get install lua-sec lua-socket lua-socket-dev
util01@station40:~/JEUX/MINETEST.415$ wget http://ports.ubuntu.com/pool/universe/l/luasocket/lua-socket_3.0~rc1+git+ac3201d-6_arm64.deb
util01@station40:~/JEUX/MINETEST.415$ ar x lua-socket_3.0~rc1+git+ac3201d-6_amd64.deb 
util01@station40:~/JEUX/MINETEST.415$ tar --use-compress-program=unzstd -xvf  data.tar.zst

2/ Téléchargement du mod.

util01@station40:~/JEUX/MINETEST.415 $ wget https://github.com/arpruss/raspberryjammod-minetest/archive/0.20.tar.gz
util01@station40:~/JEUX/MINETEST.415 $ tar xvfz 0.20.tar.gz 

3/ Installation.

util01@station40:~/JEUX/MINETEST.415 $ cd minetest/mods/
util01@station40:~/JEUX/MINETEST.415/minetest/mods $ 
util01@station40:~/JEUX/MINETEST.415/minetest/mods $ ln -s ../../raspberryjammod-minetest-0.20/raspberryjammod
util01@station40:~/JEUX/MINETEST.415$ cd minetest/mods/raspberryjammod/
util01@station40:~/JEUX/MINETEST.415/minetest/mods/raspberryjammod$ 
util01@station40:~/JEUX/MINETEST.415/minetest/mods/raspberryjammod$ cp ../../../usr/lib/x86_64-linux-gnu/liblua5.1-socket.so.2.0.0 .
util01@station40:~/JEUX/MINETEST.415/minetest/mods/raspberryjammod$ ln -s liblua5.1-socket.so.2.0.0 socket.so 

util01@station40:~/JEUX/MINETEST.580/minetest/mods/raspberryjammod/socket$ ln -s liblua5.1-socket.so.2.0.0 socket.so

util01@station40:~/JEUX/MINETEST.580/minetest/mods/raspberryjammod/socket$ cd ../../../
util01@station40:~/JEUX/MINETEST.580/minetest$ 

4/ Configuration.

util01@station40:~/JEUX/MINETEST.415/minetest $ cp games/minetest_game/minetest.conf.example games/minetest_game/minetest.conf

Ouvrir :

~/JEUX/MINETEST.415/minetest/games/minetest_game/minetest.conf

Chercher :

#creative_mode = false

Remplacer par :

creative_mode = true
secure.enable_security = false
secure.trusted_mods = raspberryjammod

Ouvrir :

mods/raspberryjammod/init.lua

Chercher :

if minetest.request_insecure_environment then
   ie = minetest.request_insecure_environment()
else
   ie = _G
end

Remplacer par :

ie = _G

5/ Activation du mod dans le client Minetest.

En 'Solo', créer un monde 'plat', nommé 'plat', via le générateur de monde 'flat'.
[Configurer] ce monde en activant le mod 'raspberryjammod'.
Puis quitter le client Minetest.

6/ Créer un script de création de block.

Ouvrir :

mods/raspberryjammod/mcpipy/pillar.py

Ajouter :

import mcpi.minecraft as minecraft
import mcpi.block as block
import server
import math

# Connect to the Minecraft server
world = minecraft.Minecraft.create(server.address)

# Get the player's current position and store the coordinates
[x,y,z] = world.player.getPos()

# Set some variables to customize your pillar
height = 3 
material = block.BRICK_BLOCK

# Build the pillar. It will be "height" blocks high and located one step away from the player.
for level in range(0, height):
    world.setBlock( x+1, y+level, z+1, material )
    level = level + 1;

Action:

util01@station40:~/JEUX/MINETEST.415/minetest/mods/raspberryjammod/mcpipy $ chmod +x pillar.py 

7/ Lancer le serveur Minetest.

util01@station40:~/JEUX/MINETEST.415/minetest/bin $ ./minetestserver 

8/ Lancer le client Minetest.

util01@station40:~/JEUX/MINETEST.415/minetest/bin $ ./minetest

Se connecter au serveur Minetest via [Client].

9/ Lancer le script Python.

util01@station40:~/JEUX/MINETEST.415/minetest/mods/raspberryjammod/mcpipy $ python2.7 ./pillar.py 

Après l'exécution du script :

2024-02-05-213957_3840x1200_scrot.png

III/ Installation de Blocky.

1/ Installation du serveur web Apache.

util01@station40:~$ sudo apt-get install apache2
util01@station40:~$ cd JEUX/MINETEST.415/
util01@station40:~/JEUX/MINETEST.415 $ 

2/ Téléchargement de Google Closure Library de décembre 2016.

util01@station40:~/JEUX/MINETEST.415 $ wget https://github.com/google/closure-library/archive/refs/tags/v20161201.tar.gz
util01@station40:~/JEUX/MINETEST.415 $ tar xvfz v20161201.tar.gz 
util01@station40:~/JEUX/MINETEST.415 $ mv closure-library-20161201/ closure-library

4/ Téléchargement de Blocky pour Minecraft.

util01@station40:~/JEUX/MINETEST.415 $ wget https://github.com/arpruss/blockly-minecraft/archive/refs/heads/master.zip
util01@station40:~/JEUX/MINETEST.415$ unzip master.zip 
util01@station40:~/JEUX/MINETEST.415 $ cd blockly-minecraft-master/
util01@station40:~/JEUX/MINETEST.415/blockly-minecraft-master $ 

5/ Compilation.

util01@station40:~/JEUX/MINETEST.415/blockly-minecraft-master $ ./build.py
SUCCESS: msg/js/tr.js
SUCCESS: msg/js/de.js
...
SUCCESS: msg/js/sc.js
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "./build.py", line 162, in run
    self.gen_core()
  File "./build.py", line 193, in gen_core
    self.do_compile(params, target_filename, filenames, "")
  File "./build.py", line 258, in do_compile
    json_data = json.loads(json_str)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

SUCCESS: blockly_uncompressed.js
util01@station40:~/JEUX/MINETEST.415/blockly-minecraft-master $ 

6/ Installation.

util01@station40:~/JEUX/MINETEST.415/blockly-minecraft-master $ cd /var/www/html/
util01@station40:/var/www/html $ 
util01@station40:/var/www/html $ sudo ln -s /home/pi/JEUX/MINETEST.415/blockly-minecraft-master/ blocky

7/ Sous le navigateur Firefox 122.0, lancement de Blockly :

http://localhost/blockly/minecraft/

2024-02-05-214240_3840x1200_scrot.png