Giter VIP home page Giter VIP logo

blockcrafter's Introduction

Blockcrafter

by Moritz Hilscher

Blockcrafter is a tool to render Minecraft block images for Mapcrafter.

Installation

Blockcrafter requires Python 3 and the packages numpy, vispy and Pillow.

From source

Just run pip3 install . in the directory.

If you want to work with Blockcrafter, run pip3 install --user -e .. This installs Blockcrafter locally but you can still edit the cloned sources. Make sure that ~/.local/bin is in your path.

Docker

Just pull the docker image mapcrafter/blockcrafter.

Usage

Blockcrafter provides the script blockcrafter-export to render Minecraft block images and export them for Mapcrafter.

Installation with pip, run:

blockcrafter-export <arguments>

With docker, you have to run:

docker run --rm -v $(pwd):/wd -w /wd -e LOCAL_USER_ID=$(id -u $(whoami)) blockcrafter <arguments>

(--rm makes docker delete the container after running it. -v $(pwd):/wd mounts the current directory into the container, -w /wd sets the working directory inside the container, and also your user ID is passed to the container so it's like Blockcrafter is running in your current directory as your user.)

Example

You need to get a Minecraft client jar file of at least version 1.13. Then you can run blockcrafter-export (or the equivalent docker command):

blockcrafter-export -a 1.13.1.jar -o blocks -v isometric -t 12 -r 0

This makes Blockcrafter export the Minecraft 1.13.1 block images of isometric render view with texture size 12px and rotation 0 (top-left) to the directory blocks/. You can also export block images of multiple render views / texture sizes / rotations by just passing multiple -v/-t/-r arguments. Blockcrafter will then export block images for all configurations render views x texture sizes x rotations. See below for a reference of all options.

Command line options

Main options you will be using

-a <asset>, --asset=<asset> required: Input Minecraft asset. Can be path to Minecraft client jar, to a resource pack zip, or to a directory of any of these unpacked. If you want to use a custom texture pack, it's important that you pass the Minecraft assets first and then the texture pack, for example -a 1.13.1.jar -a texturepack.zip.

-o <directory>, --output-dir=<directory> required: Output directory where Blockcrafter should export block images to. This is where you want to point Mapcrafter to with the map option block_dir.

-v <view>, --view=<view>: Render view to export block images for, must be one of isometric, topdown, or side. You can use this option multiple times to export block images for multiple views, for example -v isometric -v topdown. If you don't specify this option, block images are exported for all views.

-t <size>, --texture-size=<size>: Texture size to export block images for. Like --view, you can use this option multiple times. Defaults to -t 12 -t 16.

-r <rotation>, --rotation=<rotation>: Rotation to export block images for. Like --view and --texture-size, you can use this option multiple times. Defaults to -r 0 -r 1 -r 2 -r 3. Rotation indices stand for rotations top-left, top-right, bottom-right, and bottom-left.

Additional options

--osmesa: Use osmesa software OpenGL rendering. This is enabled per default when running Blockcrafter in the docker container.

-b <wildcard>, --blocks=<wildcard>: You can specify a wildcard to render only certain blocks, useful for debugging certain block images. The wildcard is applied for blockstate names such as minecraft:oak-fence. You can use the option multiple times to match multiple groups of blockstates.

--no-render: Don't render any block image, just write out the .txt block info file again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.