Package org.moddingx.libx.base
Class FluidBase
java.lang.Object
org.moddingx.libx.base.FluidBase
- All Implemented Interfaces:
net.minecraft.world.level.ItemLike
,Registerable
@PlainRegisterable
public class FluidBase
extends Object
implements net.minecraft.world.level.ItemLike, Registerable
A
Registerable
that registers a fluid type
, source and flowing fluid
,
a liquid block
and a bucket item
.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.moddingx.libx.registration.Registerable
Registerable.EntryCollector
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal net.minecraft.world.item.Item
asItem()
protected ClientExtensionInfo.Fluid
createClientExtensions
(net.minecraft.resources.ResourceLocation id) Creates theclient extensions
for this fluid.static FluidBase.Builder
Creates a new fluid builder for setting the basic fluid properties to be passed in the constructor.final net.minecraft.world.item.BucketItem
Gets thebucket item
for thisFluidBase
.final net.minecraft.world.level.material.Fluid
Gets theflowing fluid
for thisFluidBase
.final net.minecraft.world.level.material.Fluid
getFluid()
Gets thesource fluid
for thisFluidBase
.final net.neoforged.neoforge.fluids.FluidType
Gets thefluid type
for thisFluidBase
.final net.minecraft.world.level.block.LiquidBlock
Gets theliquid block
for thisFluidBase
.final net.minecraft.world.level.material.Fluid
Gets thesource fluid
for thisFluidBase
.void
registerAdditional
(RegistrationContext ctx, Registerable.EntryCollector builder) Registers additional objects.void
Similar toRegisterable.registerAdditional(RegistrationContext, EntryCollector)
but only invoked on the client.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moddingx.libx.registration.Registerable
setupClient, setupCommon
-
Field Details
-
mod
-
-
Constructor Details
-
FluidBase
-
-
Method Details
-
createClientExtensions
protected ClientExtensionInfo.Fluid createClientExtensions(net.minecraft.resources.ResourceLocation id) Creates theclient extensions
for this fluid. The default implementation creates client extensions that have no special properties, use a still texture located at[namespace]:block/[path]
and a flowing texture located at[namespace]:block/[path]_flowing
. -
registerAdditional
@OverridingMethodsMustInvokeSuper public void registerAdditional(RegistrationContext ctx, Registerable.EntryCollector builder) Description copied from interface:Registerable
Registers additional objects. Those may beRegisterable
as well. These objects will be registered with the id of this object and optionally a name suffix.- Specified by:
registerAdditional
in interfaceRegisterable
-
registerClientAdditional
@OverridingMethodsMustInvokeSuper public void registerClientAdditional(RegistrationContext ctx, Registerable.EntryCollector builder) Description copied from interface:Registerable
Similar toRegisterable.registerAdditional(RegistrationContext, EntryCollector)
but only invoked on the client.- Specified by:
registerClientAdditional
in interfaceRegisterable
-
getFluidType
Gets thefluid type
for thisFluidBase
. -
getFluid
Gets thesource fluid
for thisFluidBase
. This is the same asgetSourceFluid()
. One should prefer this method overgetSourceFluid()
when needing a representative for the wholefluid type
, for example when creatingfluid stacks
. -
getSourceFluid
Gets thesource fluid
for thisFluidBase
. This is the same asgetFluid()
. One should prefer this method overgetFluid()
when a distinction between source and flowing fluids is to be made. -
getFlowingFluid
Gets theflowing fluid
for thisFluidBase
. -
getLiquidBlock
Gets theliquid block
for thisFluidBase
. -
getBucketItem
Gets thebucket item
for thisFluidBase
. -
asItem
- Specified by:
asItem
in interfacenet.minecraft.world.level.ItemLike
-
fluidBuilder
Creates a new fluid builder for setting the basic fluid properties to be passed in the constructor.
-