GithubHelp home page GithubHelp logo

powernukkit / region-manipulator Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 3.0 9.22 MB

A kotlin/java lib that allows you to read and write MCA files in a clean way

License: MIT License

Kotlin 99.70% CSS 0.30%
kotlin-library java-library mca-region anvil mca-file mca chunk minecraft-world minecraft minecraft-library

region-manipulator's Introduction

Region Manipulator

A Kotlin/Java library that allows you to read and write mca files in a simple way.

Here you can find the library documentation:

You may also want to see the changelog file to be aware of all changes in the tool that may impact you.

Adding to your project

The library is shared in the maven center, so you don't need to declare any custom repository.

Gradle

repositories {
    mavenCentral() // or jcenter()
}

dependencies {
    compile 'br.com.gamemods:region-manipulator:2.0.0'
}

Maven

<dependencies>
    <dependency>
      <groupId>br.com.gamemods</groupId>
      <artifactId>region-manipulator</artifactId>
      <version>2.0.0</version>
    </dependency>
</dependencies>

Ivy

<dependency org="br.com.gamemods" name="region-manipulator" rev="2.0.0"/>

Direct JAR

Download it from maven central.

Examples

internal fun clearEntities(from: File, to: File) {
    val region = RegionIO.readRegion(from)
    val chunk = region[ChunkPos(region.position.xPos * 32, region.position.zPos * 32)] ?: return
    chunk.level.getCompoundList("Entities").forEach { 
        println(it.getString("id") + " "+ it.getDoubleList("Pos"))
    }
    chunk.level["Entities"] = emptyListOf<NbtCompound>().toNbtList()
    RegionIO.writeRegion(to, region)
}

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.