Skip to content

5.0 Manicule

Latest

Choose a tag to compare

@Flashing-Blinkenlights Flashing-Blinkenlights released this 18 Feb 09:56
· 2 commits to master since this release
aef6ffb

The 5.0 Manicule update focuses on pointing new and experienced users in the right direction and making the whole experience more user-friendly and accessible.

These changes can be grouped into 8 sections:

  1. Beginner Example
  2. Interface Revamped
  3. Geometric Shapes
  4. Biome Detection
  5. Block Groups
  6. Utilities
  7. Restructured Package
  8. Breaking Changes

As always we would love to hear your thoughts on Discord or in the form of GitHub Issues!

1. Beginner Example

Newcomers to GDPC are greeted by Start_Here.py, a heavily commented sample script showing them how to build a simple village.
It contains examples and hints on:

  • Neatly structuring Python code
  • Requesting the build area
  • Using World Slices for heightmaps
  • Placing geometric shapes
  • Placing doors
  • Writing a simple book and placing it on a lectern

2. Interface Revamped

interfaceUtils has been renamed to interface and massively enhanced:

  • block parameter in place... functions: if a list of block IDs is provided, placement will be fully randomised with the IDs provided allowing for quick and easy build texturing
  • replace parameter in place... functions: if a list of block IDs is provided, blocks will only be placed if the current block's ID is in the list for easy, filtered replacement of blocks
  • Configurable block buffer for faster block placement
  • Configurable block cache for reading block IDs faster
  • Block placement flags (e.g. disable block updates)
  • Automatic block-placed-outside-build-area checking
  • New Interface class for block placement:
    • Local coordinate systems
    • Separately configurable block flag, buffer and cache systems
  • Seperate direct_interface module for access to HTTP request wrappers (use not recommended)

3. Geometric Shapes

All-new geometry module allows for the quick placement of geometric shapes including:

  • Point-to-point lines (may be chained)
  • 2D polygons
  • 3D areas (akin to the /fill command)
  • Cylinders (with position, height, radius, axis, tube and hollow options)
  • Elliptical cylinders (with corner-to-corner coordinates and axis, tube and hollow options)
  • Placing blocks at a list of coordinates
  • Support for block and replace lists

4. Biome Detection

WorldSlice instances can now return biome names for a given location:

  • Method for biome of a single block (with inaccuracies of +/- 2 blocks due to biome blending)
  • Method for returning all biomes in a chunk
  • Method for returning largest biome in a chunk
    lookup.py also contains BIOMES, a dictionary for allowing easy conversion of biome IDs to biome names.

5. Block Groups

lookup.py contains a plethora of block groups and other useful information, which may be easily integrated into your code:

if getBlock(x, y, z) in lookup.ARTIFICIAL:
    print("Village detected!")

dx, dy, dz = lookup.DIRECTION2VECTOR['bottom']
if getBlock(x, y, z) in lookup.SIGNS and getBlock(x+dx, y+dy, z+dz) in lookup.AIR:
    print("It's a sign from the Gods!")

for colour in lookup.COLORS:
    placeBlock(x, y, z, colour+"_wool")
for wood in lookup.WOODS:
    placeBlock(x, y, z, wood+"_slab{type:double}")

if getBlock(x, y, z) not in lookup.TRANSPARENT:
    placeBlock(x, y+1, z, lookup.FLOWERS)

6. Utilities

Various utilities have been added, including:

  • lookup.py detects and provides the current Minecraft version, as well as warning incompatibilities
  • Easy book creation with styles, justifications and more
  • Placing signs, lecterns and blocks with inventories
  • Returning a list of coordinates in a 2D or 3D space
  • Coordinate normalisation (two random corner coordinates in, a smallest and a largest coordinate out)
  • Checking for a Python sequence (splice-able object)

7. Restructured Package

The entire package has been restructured to make usage more modular, and can now be imported via PIP!
Certain scripts are not included in the package, such as the example, so it is now possible to download and modify them without facing compatibility issues or merge conflicts.

8. Breaking changes

Since there were a lot of clean-ups and various changes to more stable and future-proof solutions, code running on GDPC 4.0 will be largely incompatible with the 5.0 Manicule update.
The main sources of change are:

  • Anything involving interfaceUtils or mapUtils
  • example.py has been entirely rewritten and replaced by Start_Here.py
  • Move of everything into the package-based structure
    Compatibility will be guaranteed throughout 5.x and there will likely be much fewer incompatibilities down the road.

Feedback and Issues

Please make use of the GitHub issues, commenting on features you'd like to see and bugs you've found, it would greatly help us make this project even better!