public abstract class FluidRegistry
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
FluidRegistry.FluidDelegate |
static class |
FluidRegistry.FluidRegisterEvent |
Modifier and Type | Field and Description |
---|---|
(package private) static java.util.Set<java.lang.String> |
bucketFluids |
(package private) static java.util.Set<Fluid> |
currentBucketFluids |
(package private) static com.google.common.collect.BiMap<java.lang.String,java.lang.String> |
defaultFluidName |
(package private) static java.util.Map<Fluid,FluidRegistry.FluidDelegate> |
delegates |
(package private) static com.google.common.collect.BiMap<Block,Fluid> |
fluidBlocks |
(package private) static com.google.common.collect.BiMap<Fluid,java.lang.Integer> |
fluidIDs |
(package private) static com.google.common.collect.BiMap<java.lang.Integer,java.lang.String> |
fluidNames |
(package private) static com.google.common.collect.BiMap<java.lang.String,Fluid> |
fluids |
static Fluid |
LAVA |
(package private) static com.google.common.collect.BiMap<java.lang.String,Fluid> |
masterFluidReference |
(package private) static int |
maxID |
(package private) static boolean |
universalBucketEnabled |
static Fluid |
WATER |
Modifier | Constructor and Description |
---|---|
private |
FluidRegistry() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addBucketForFluid(Fluid fluid)
Registers a fluid with the universal bucket.
|
static void |
enableUniversalBucket()
Enables the universal bucket in forge.
|
static java.util.Set<Fluid> |
getBucketFluids()
All fluids registered with the universal bucket
|
static java.lang.String |
getDefaultFluidName(Fluid key) |
static Fluid |
getFluid(java.lang.String fluidName) |
static java.lang.String |
getFluidName(Fluid fluid) |
static java.lang.String |
getFluidName(FluidStack stack) |
static FluidStack |
getFluidStack(java.lang.String fluidName,
int amount) |
static int |
getMaxID() |
static java.lang.String |
getModId(FluidStack fluidStack) |
static java.util.Map<Fluid,java.lang.Integer> |
getRegisteredFluidIDs()
Deprecated.
|
static java.util.Map<java.lang.String,Fluid> |
getRegisteredFluids()
Returns a read-only map containing Fluid Names and their associated Fluids.
|
static boolean |
hasBucket(Fluid fluid) |
static void |
initFluidIDs(com.google.common.collect.BiMap<Fluid,java.lang.Integer> newfluidIDs,
java.util.Set<java.lang.String> defaultNames)
Called by Forge to prepare the ID map for server -> client sync.
|
static boolean |
isFluidDefault(Fluid fluid)
Is the supplied fluid the current default fluid for it's name
|
static boolean |
isFluidRegistered(Fluid fluid)
Does the supplied fluid have an entry for it's name (whether or not the fluid itself is default)
|
static boolean |
isFluidRegistered(java.lang.String fluidName) |
static boolean |
isUniversalBucketEnabled() |
private static void |
loadFluidDefaults(com.google.common.collect.BiMap<Fluid,java.lang.Integer> localFluidIDs,
java.util.Set<java.lang.String> defaultNames)
Called by forge to load default fluid IDs from the world or from server -> client for syncing
DO NOT call this and expect useful behaviour.
|
static void |
loadFluidDefaults(NBTTagCompound tag) |
static Fluid |
lookupFluidForBlock(Block block) |
(package private) static IRegistryDelegate<Fluid> |
makeDelegate(Fluid fl) |
static boolean |
registerFluid(Fluid fluid)
Register a new Fluid.
|
private static java.lang.String |
uniqueName(Fluid fluid) |
static void |
validateFluidRegistry() |
static void |
writeDefaultFluidList(NBTTagCompound forgeData) |
static int maxID
static com.google.common.collect.BiMap<java.lang.String,Fluid> fluids
static com.google.common.collect.BiMap<Fluid,java.lang.Integer> fluidIDs
static com.google.common.collect.BiMap<java.lang.Integer,java.lang.String> fluidNames
static com.google.common.collect.BiMap<java.lang.String,Fluid> masterFluidReference
static com.google.common.collect.BiMap<java.lang.String,java.lang.String> defaultFluidName
static java.util.Map<Fluid,FluidRegistry.FluidDelegate> delegates
static boolean universalBucketEnabled
static java.util.Set<java.lang.String> bucketFluids
static java.util.Set<Fluid> currentBucketFluids
public static final Fluid WATER
public static final Fluid LAVA
public static void initFluidIDs(com.google.common.collect.BiMap<Fluid,java.lang.Integer> newfluidIDs, java.util.Set<java.lang.String> defaultNames)
private static void loadFluidDefaults(com.google.common.collect.BiMap<Fluid,java.lang.Integer> localFluidIDs, java.util.Set<java.lang.String> defaultNames)
localFluidIDs
- defaultNames
- public static boolean registerFluid(Fluid fluid)
fluid
- The fluid to register.private static java.lang.String uniqueName(Fluid fluid)
public static boolean isFluidDefault(Fluid fluid)
fluid
- the fluid we're testingpublic static boolean isFluidRegistered(Fluid fluid)
fluid
- the fluid we're testingpublic static boolean isFluidRegistered(java.lang.String fluidName)
public static Fluid getFluid(java.lang.String fluidName)
public static java.lang.String getFluidName(Fluid fluid)
public static java.lang.String getFluidName(FluidStack stack)
@Nullable public static FluidStack getFluidStack(java.lang.String fluidName, int amount)
public static java.util.Map<java.lang.String,Fluid> getRegisteredFluids()
@Deprecated public static java.util.Map<Fluid,java.lang.Integer> getRegisteredFluidIDs()
public static void enableUniversalBucket()
public static boolean isUniversalBucketEnabled()
public static boolean addBucketForFluid(Fluid fluid)
fluid
- The fluid that the bucket shall be able to holdpublic static java.util.Set<Fluid> getBucketFluids()
public static boolean hasBucket(Fluid fluid)
public static int getMaxID()
public static java.lang.String getDefaultFluidName(Fluid key)
@Nullable public static java.lang.String getModId(@Nullable FluidStack fluidStack)
public static void loadFluidDefaults(NBTTagCompound tag)
public static void writeDefaultFluidList(NBTTagCompound forgeData)
public static void validateFluidRegistry()
static IRegistryDelegate<Fluid> makeDelegate(Fluid fl)