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

net.minestom.server.entity.attribute.AttributeImpl Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.entity.attribute;

import net.minestom.server.registry.Registry;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;

record AttributeImpl(@NotNull Registry.AttributeEntry registry) implements Attribute {
    private static final Registry.Container CONTAINER = Registry.createStaticContainer(Registry.Resource.ATTRIBUTES,
            (namespace, properties) -> new AttributeImpl(Registry.attribute(namespace, properties)));

    static Attribute get(@NotNull String namespace) {
        return CONTAINER.get(namespace);
    }

    static Attribute getSafe(@NotNull String namespace) {
        return CONTAINER.getSafe(namespace);
    }

    static Attribute getId(int id) {
        return CONTAINER.getId(id);
    }

    static Collection values() {
        return CONTAINER.values();
    }

    @Override
    public String toString() {
        return name();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy