GithubHelp home page GithubHelp logo

pmimporter's Introduction

pmimporter

  • Summary: Import world maps into PocketMine-MP
  • WebSite: github

Overview

  • nbtdump - Dump the contents of NBT files
  • level - manipulate some level.dat settings
  • check - read world maps and analyze the block, object composition
  • convert - main conversion tool

Description

A collection of tools used for importing world maps for use with PocketMine-MP.

It supports the following formats:

  • McRegion: Minecraft PC Edition pre1.2
  • Anvil: Minecraft PC Edition v1.2 and better
  • PMF: PocketMine v1.3. READ-ONLY format.
  • mcpe0.2.0: Minecraft PE finite worlds. READ-ONLY format.
  • LevelDB: Minecraft PE v0.9.0 (or better) infinite worlds.

When importing maps it will by default check the used blocks to make sure that only blocks supported by Minecraft PE are generated. It does this by either mapping these blocks or removing them. This conversion/fitering can be disabled or tweaked with an user provided rules file. Similarly, Tiles and Entities that are not supported by Minecraft PE are eliminated. This is done because using these on a Minecraft PE client that does not support them would cause the game to crash.

Command Usage

In general, the command usage is:

  • path-to-php-executable path-to-pmimporter.phar sub-command [options]

Sub-commands

convert

This is the main map importing command.

convert [options] srcpath dstpath

The srcpath is a path to a folder tha contains a Minecraft/PocketMine world.

The dstpath is a path to the destination Minecraft/PocketMine world. If dstpath does not exist a new world will be created. If it exists, chunks will be imported into the existing world.

Options:

  • --format=format
    • sets the output format if the destination is a new map. Defaults to mcregion. Possible options: anvil, mcregion, LevelDB.
  • --threads=cores
    • Will spawn cores threads to process chunks.
  • --yoff=offset
    • Offset blocks by the given offset number of blocks. If the number is negative, the world will be shifted down. If the number is positive, the world will be shifted up.
  • --adjchunk=x,z
    • When writing chunks, these will be shifted by x and/or z chunks.
  • --rules=file
    • Read additional translation rules from file.
  • --x=n, --min-x=min, --max-x=max
    • Will limit the imported chunk region by the specified min and max x values (inclusive). The --x option is a shortcut for specifying --min-x and --max-x both equal to n.
      • The default is to process all chunks
      • NOTE: Limits are applied before the adjchunk shifts are calculated.
  • --z=n, --min-z=min, --max-z=max
    • Will limit the imported chunk region by the specified min and max z values (inclusive). The --z option is a shortcut for specifying --min-z and --max-z both equal to n.
      • The default is to process all chunks
      • NOTE: Limits are applied before the adjchunk shifts are calculated.
  • --convert, --no-convert
    • enable or disable block conversions/filtering. --convert is the default.
  • --clobber, --no-clobber
    • If importing chunks to an existing world, if --clobber is specified, existing chunks will be overwritten. The default is --no-clobber so existing chunks will be skipped.

check

Analyze the number of chunks, blocks, etc in a world map.

check [options] worldpath

worldpath is a folder containing the world to analyze.

Options:

  • --check-chunks, --no-check-chunks
    • Will compute the block/entity make-up of selected chunks. The default is --no-check-chunks.
  • --x=n, --min-x=min, --max-x=max
    • Will limit the processed chunk region by the specified min and max x values (inclusive). The --x option is a shortcut for specifying --min-x and --max-x both equal to n.
      • The default is to process all chunks
      • NOTE: Limits are applied before the adjchunk shifts are calculated.
  • --z=n, --min-z=min, --max-z=max
    • Will limit the processed chunk region by the specified min and max z values (inclusive). The --z option is a shortcut for specifying --min-z and --max-z both equal to n.
      • The default is to process all chunks
      • NOTE: Limits are applied before the adjchunk shifts are calculated.

level

Displays and modifies certain level attributes.

level [options] worldpath

Will display (and modify) attributes for the specified world.

Options:

  • --spawn=x,y,z
    • Sets the world spawn point.
  • --name=text
    • Sets the Level name.
  • --seed=integer
    • Sets the random Seed.
  • --generator=name
    • Sets the terrain generator. PocketMine by default only supports flat and normal.
  • --preset=txt
    • Sets the Terrain generator preset string. Ignored by the normal generator. Used by flat.
  • --fixname
    • Will set the Level name string to the worldpath folder's name.

nbtdump

Dumps the contents of an NBT formatted file. Usually the level.dat file in the world folder.

nbtdump nbt_file

Installation

Requirements:

  • This software is only supported on Linux
  • PHP v5.6.xx, version used by PocketMine-MP. This one contains most dependancies. Note that depending on the PHP binary being used the LevelDB format may or may not be supported.

Download pmimporter.phar and use. It does not need to be installed.

Configure translation

You can configure the translation by providing a rules file and passing it to covert with the --rules option. The format of rules.txt is as follows:

  • comments, start with ; or #.
  • source-block = target-block is a translation rule. Any block of type source-block is converted to target-block.

There is a default set of conversion rules, but you can tweak it by using --rules.

FAQ

  • Q: Why it takes so long?
  • A: Because my programming skills suck.
  • Q: Does it support LevelDB files (Pocket Edition v0.9.0 infinite worlds)?
  • A: There is experimental support for that. Your PHP installation needs to have a compatible leveldb.
  • Q: Why tall builds seem to be chopped off at te top?
  • A: That is a limitation of Pocket Edition. It only supports chunks that are up to 128 blocks high, while the PC edition Anvil worlds can support up to 256 blocks high. You can shift worlds down by using the --yoff option. So if you use --yoff=-40 that will move the build down 40 blocks. BE CAREFUL NOT TO REMOVE THE GROUND
  • Q: Why I see some blocks that are not in the original map?
  • A: These have to do with how the translation happens. There are blocks that are not supported by Minecraft Pocket Edition. These need to be map to a block supported by MCPE. You can tweak this by modifying the conversion rules.

References

Issues and Bugs

  • PMF1.3 Entities from this format are not imported. Note that since there are very few PMF1.3 maps around, this is something that will probably not be fixed.
  • When converting Anvil to non-Anvil formats, maps are silently truncated to be less than 128 blocks high, unless. Currently Anvil is the only map format that support 256 blocks high worlds.

Todo

  • Testing
    • conversion
      • features
reading\writing anvil mcregion LevelDB
mcregion
anvil
LevelDB
McPe020
PMF1.3

Changes

  • 2.0: ???
    • removed commands: entities, dumpchunk
    • syntax of sub-commands changed
    • PocketMine-MP plugin has been discontinued
    • Major speed improvements
    • Imports chunks into existing maps.
      • Added PHP7 compatibility
      • Initial LevelDB support
      • Can now output Anvil worlds
      • This release only supported on LINUX.
      • Include/Exclude chunks (Requested by @vertx)
  • 1.5upd2: Update
    • Added new blocks since 0.10
  • 1.5upd1: Bugfix
    • Minor fix in plugin code
  • 1.5: Bugfix
    • BugFixes in MCPE0.2.0 format.
    • BugFixes with region offsests on negative values
    • Tweaked builds and subcommand names
  • 1.4: Maintenance release
    • pmentities fix typos
    • minor text info tweaks
    • Added pmentity to dump entity data
    • Added region settings to MCPE0.2.0 and PMF1.3 formats.
    • Fixed offset functionality.
    • Filter out Dropped Item entities.
  • 1.3: OldSkool fixes
    • Added support for Tiles to PMF maps.
    • Added support for Tiles and Entities fo MCPE 0.2.0 maps.
    • Fixed HeightMap calculations in PMF and MCPE 0.2.0 formats
    • Added settings capability to tweak conversion.
    • Merged ImportMap and pmimporter into a single Phar file.
  • 1.2: Fixes
    • pmcheck: show height map statistics.
    • pmconvert: offset y coordinates
  • 1.1: OldSkool release
    • Added support for maps from Minecraft Pocket Edition 0.2.0 - 0.8.1
    • Added support for PMF maps from PocketMine v1.3.
  • 1.0 : First release

Copyright

Some of the code used in this program come from PocketMine-MP, licensed under GPL.

pmimporter  
Copyright (C) 2015 Alejandro Liu  
All Rights Reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

pmimporter's People

Contributors

alejandroliu avatar

Watchers

One Legged Bar Bird avatar

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.