PyBlockWorld
Eine an Minecraft angelehnte Welt aus Blöcken.
Installation
Die Installation erfolgt über pip install pyblockworld.
API
from pyblockworld import World
#
# BEISPIEL 1
#
# Eine Funktion, die beim Drücken der B-Taste aufgerufen werden soll
def b_key_pressed(world:World):
print("B pressed. Player at", world.player_position())
# Erstellen einer neuen Welt
world = World()
# Die Funktion für die build-Taste (b) wird zugewiesen
world.build_key_pressed = b_key_pressed
# Die Welt wird gestartet
world.run()
#
# BEISPIEL 2
#
# Nun werden beim Drücken der Taste ein paar Blöcke platziert.
def b_key_pressed(world:World):
# Neue Blöcke können mit setBlock gesetzt werden.
# Verfügbare Materialien stehen in World.MATERIALS und umfassen
# air, default:brick, default:stone, default:sand, default:grass
print("Block types", World.MATERIALS)
x,y,z = world.player_position()
# Einen Block platzieren
world.setBlock(x,y,z, "default:brick")
# Mehrere Blöcke auf einmal abseits des Spielers platzieren
x,y,z = x,y,z+3
world.setBlocks(x,y,z, x+3,y+3,z+3, "default:grass")
world = World()
world.build_key_pressed = b_key_pressed
world.run()
Quellen
Der Quellcode basiert auf dem Code von SensorCraft, der wiederum auf dem Code von Craft basiert.
Changelog
-
0.3.10
- Bugfix: Fehlende Bildtextur in Paket aufgenommen.
-
0.3.9
- Support für Python 3.13
-
0.3.8
- Methoden der Klasse World dokumentiert.
-
0.3.5
- Changelog eingeührt
- Support für Python 3.8
-
0.3.7
- PeristentWorld als speicherbare Welt hinzugefügt.
- Doku aktualisiert: Abschnitt Start entfernt.
- World.player_position hat das Attribut as_int, um ein Int-Tuple zu erzeugen
Metadata
Release files for pyblockworld 0.3.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyblockworld-0.3.10.tar.gz | 17.3 kB | Without provenance | Details for pyblockworld-0.3.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyblockworld-0.3.10-py3-none-any.whl | Python 3 | none | any | Details for pyblockworld-0.3.10-py3-none-any.whl |
Total release size: 33.9 kB
Release files / pyblockworld-0.3.10.tar.gz
| Download URL | pyblockworld-0.3.10.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ecf850666a66c5da1b6c58b330b7144c00a653893a3343cc6f2edbc05e47d311
|
|
BLAKE2b-256 checksum How to use checksums |
213ff0e11562f404abd0502115580e7355120b175cb304501e3ed8fa0bac2e64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.13.7 Linux/5.15.193-1-MANJARO
|
Release files / pyblockworld-0.3.10-py3-none-any.whl
| Download URL | pyblockworld-0.3.10-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9f3925674c2b50c062eb9cf752769492d72ac720f6b2cca37169fe7ee0bdc0e
|
|
BLAKE2b-256 checksum How to use checksums |
e32c2758749a64720b3855763f9cd52488988a1c509b53890ef7b9d40b38dcaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.13.7 Linux/5.15.193-1-MANJARO
|
Security for pyblockworld 0.3.10
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.