Record Class ForgeEnergyContainer
java.lang.Object
java.lang.Record
earth.terrarium.botarium.forge.energy.ForgeEnergyContainer
- All Implemented Interfaces:
net.minecraftforge.common.capabilities.ICapabilityProvider
public record ForgeEnergyContainer(BotariumEnergyBlock<?> containerGetter, net.minecraft.world.level.block.entity.BlockEntity entity)
extends Record
implements net.minecraftforge.common.capabilities.ICapabilityProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record -
Constructor Summary
ConstructorsConstructorDescriptionForgeEnergyContainer(BotariumEnergyBlock<?> containerGetter, net.minecraft.world.level.block.entity.BlockEntity entity) Creates an instance of aForgeEnergyContainerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontainerGetterrecord component.net.minecraft.world.level.block.entity.BlockEntityentity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.<T> @NotNull net.minecraftforge.common.util.LazyOptional<T>getCapability(@NotNull net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable net.minecraft.core.Direction arg) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
-
Constructor Details
-
ForgeEnergyContainer
public ForgeEnergyContainer(BotariumEnergyBlock<?> containerGetter, net.minecraft.world.level.block.entity.BlockEntity entity) Creates an instance of aForgeEnergyContainerrecord class.- Parameters:
containerGetter- the value for thecontainerGetterrecord componententity- the value for theentityrecord component
-
-
Method Details
-
getCapability
@NotNull public <T> @NotNull net.minecraftforge.common.util.LazyOptional<T> getCapability(@NotNull @NotNull net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable @Nullable net.minecraft.core.Direction arg) - Specified by:
getCapabilityin interfacenet.minecraftforge.common.capabilities.ICapabilityProvider
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
containerGetter
Returns the value of thecontainerGetterrecord component.- Returns:
- the value of the
containerGetterrecord component
-
entity
public net.minecraft.world.level.block.entity.BlockEntity entity()Returns the value of theentityrecord component.- Returns:
- the value of the
entityrecord component
-