net.minestom.server.registry.FluidRegistries Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
// 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));
}
}