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

net.minestom.server.registry.FluidRegistries Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
// AUTOGENERATED by net.minestom.codegen.RegistriesGenerator
package net.minestom.server.registry;

import net.kyori.adventure.key.Key;
import net.minestom.server.fluid.Fluid;
import net.minestom.server.utils.NamespaceID;
import org.jetbrains.annotations.NotNull;

import java.util.HashMap;

/**
 * AUTOGENERATED
 */
public final class FluidRegistries {

    /**
     * Should only be used for internal code, please use the get* methods.
     */
    @Deprecated
    public static final HashMap fluids = new HashMap<>();

    /**
     * Returns the corresponding Fluid matching the given id. Returns 'EMPTY' if none match.
     */
    @NotNull
    public static Fluid getFluid(String id) {
        return getFluid(NamespaceID.from(id));
    }

    /**
     * Returns the corresponding Fluid matching the given id. Returns 'EMPTY' if none match.
     */
    @NotNull
    public static Fluid getFluid(NamespaceID id) {
        return fluids.getOrDefault(id, Fluid.EMPTY);
    }

    /**
     * Returns the corresponding Fluid matching the given key. Returns 'EMPTY' if none match.
     */
    @NotNull
    public static Fluid getFluid(Key key) {
        return getFluid(NamespaceID.from(key));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy