mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 21:37:39 +01:00
parent
60074ffbfd
commit
9ff0ebcc6a
24
paper-api/src/main/java/org/bukkit/Fluid.java
Normal file
24
paper-api/src/main/java/org/bukkit/Fluid.java
Normal file
@ -0,0 +1,24 @@
|
||||
package org.bukkit;
|
||||
|
||||
import java.util.Locale;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public enum Fluid implements Keyed {
|
||||
|
||||
WATER,
|
||||
FLOWING_WATER,
|
||||
LAVA,
|
||||
FLOWING_LAVA;
|
||||
|
||||
private final NamespacedKey key;
|
||||
|
||||
private Fluid() {
|
||||
this.key = NamespacedKey.minecraft(this.name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
return key;
|
||||
}
|
||||
}
|
@ -158,6 +158,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
return MemoryKey.getByKey(key);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Server fluids.
|
||||
*
|
||||
* @see Fluid
|
||||
*/
|
||||
Registry<Fluid> FLUID = new SimpleRegistry<>(Fluid.class);
|
||||
|
||||
/**
|
||||
* Get the object by its key.
|
||||
|
@ -409,6 +409,18 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
* Vanilla item tag representing all furnace materials.
|
||||
*/
|
||||
Tag<Material> ITEMS_FURNACE_MATERIALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("furnace_materials"), Material.class);
|
||||
/**
|
||||
* Key for the built in fluid registry.
|
||||
*/
|
||||
String REGISTRY_FLUIDS = "fluids";
|
||||
/**
|
||||
* Vanilla fluid tag representing lava and flowing lava.
|
||||
*/
|
||||
Tag<Fluid> FLUIDS_LAVA = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("lava"), Fluid.class);
|
||||
/**
|
||||
* Vanilla fluid tag representing water and flowing water.
|
||||
*/
|
||||
Tag<Fluid> FLUIDS_WATER = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("water"), Fluid.class);
|
||||
|
||||
/**
|
||||
* Returns whether or not this tag has an entry for the specified item.
|
||||
|
Loading…
Reference in New Issue
Block a user