mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-05 00:43:56 +01:00
85f704e537
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
55 lines
1.8 KiB
Java
55 lines
1.8 KiB
Java
package org.bukkit;
|
|
|
|
import com.google.common.base.Preconditions;
|
|
import com.google.common.collect.Lists;
|
|
import java.util.Locale;
|
|
import org.bukkit.util.OldEnum;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
/**
|
|
* Represents a fluid type.
|
|
*/
|
|
public interface Fluid extends OldEnum<Fluid>, Keyed {
|
|
|
|
// Paper start - Generated/Fluid
|
|
// @GeneratedFrom 1.21.3
|
|
Fluid EMPTY = getFluid("empty");
|
|
|
|
Fluid FLOWING_LAVA = getFluid("flowing_lava");
|
|
|
|
Fluid FLOWING_WATER = getFluid("flowing_water");
|
|
|
|
Fluid LAVA = getFluid("lava");
|
|
|
|
Fluid WATER = getFluid("water");
|
|
// Paper end - Generated/Fluid
|
|
|
|
@NotNull
|
|
private static Fluid getFluid(@NotNull String key) {
|
|
return Registry.FLUID.getOrThrow(NamespacedKey.minecraft(key));
|
|
}
|
|
|
|
/**
|
|
* @param name of the fluid.
|
|
* @return the fluid with the given name.
|
|
* @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead.
|
|
*/
|
|
@NotNull
|
|
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
|
|
static Fluid valueOf(@NotNull String name) {
|
|
Fluid fluid = Bukkit.getUnsafe().get(Registry.FLUID, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
|
|
Preconditions.checkArgument(fluid != null, "No fluid found with the name %s", name);
|
|
return fluid;
|
|
}
|
|
|
|
/**
|
|
* @return an array of all known fluids.
|
|
* @deprecated use {@link Registry#iterator()}.
|
|
*/
|
|
@NotNull
|
|
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
|
|
static Fluid[] values() {
|
|
return Lists.newArrayList(Registry.FLUID).toArray(new Fluid[0]);
|
|
}
|
|
}
|