All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jglrxavpok.hephaistos.mca.AnvilException.kt Maven / Gradle / Ivy

There is a newer version: 2.6.1
Show newest version
package org.jglrxavpok.hephaistos.mca

import java.lang.Exception

/**
 * Exception thrown when:
 * 1. An Anvil file is malformed (missing fields for example)
 * 2. Trying to access data not available in a RegionFile (like chunks that are not inside the file)
 */
class AnvilException(message: String, cause: Throwable?): Exception(message, cause) {

    constructor(message: String): this(message, null)

    companion object {
        fun missing(name: String): Nothing = throw AnvilException("Missing field named '$name' (or of wrong type)")
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy