Record Class LockAndKeyBehavior.Simple<T extends net.minecraft.world.level.block.entity.BlockEntity>
java.lang.Object
java.lang.Record
at.minecraftschurli.mods.bibliocraft.api.lockandkey.LockAndKeyBehavior.Simple<T>
- All Implemented Interfaces:
LockAndKeyBehavior<T>
- Enclosing interface:
LockAndKeyBehavior<T extends net.minecraft.world.level.block.entity.BlockEntity>
public static record LockAndKeyBehavior.Simple<T extends net.minecraft.world.level.block.entity.BlockEntity>(Function<T extends net.minecraft.world.level.block.entity.BlockEntity, net.minecraft.world.LockCode> lockGetter, BiConsumer<T extends net.minecraft.world.level.block.entity.BlockEntity, net.minecraft.world.LockCode> lockSetter, Function<T extends net.minecraft.world.level.block.entity.BlockEntity, net.minecraft.network.chat.Component> nameGetter)
extends Record
implements LockAndKeyBehavior<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface LockAndKeyBehavior
LockAndKeyBehavior.Simple<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.network.chat.ComponentgetDisplayName(T blockEntity) Returns theBlockEntity's display name.net.minecraft.world.LockCodegetLockKey(T blockEntity) Returns theBlockEntity'sLockCode.final inthashCode()Returns a hash code value for this object.Returns the value of thelockGetterrecord component.BiConsumer<T, net.minecraft.world.LockCode> Returns the value of thelockSetterrecord component.Returns the value of thenameGetterrecord component.voidsetLockKey(T blockEntity, net.minecraft.world.LockCode lock) Sets theBlockEntity'sLockCode.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Simple
public Simple(Function<T, net.minecraft.world.LockCode> lockGetter, BiConsumer<T, net.minecraft.world.LockCode> lockSetter, Function<T, net.minecraft.network.chat.Component> nameGetter) Creates an instance of aSimplerecord class.- Parameters:
lockGetter- the value for thelockGetterrecord componentlockSetter- the value for thelockSetterrecord componentnameGetter- the value for thenameGetterrecord component
-
-
Method Details
-
getLockKey
Description copied from interface:LockAndKeyBehaviorReturns theBlockEntity'sLockCode.- Specified by:
getLockKeyin interfaceLockAndKeyBehavior<T extends net.minecraft.world.level.block.entity.BlockEntity>- Parameters:
blockEntity- theBlockEntity- Returns:
- the
BlockEntity'sLockCode.
-
setLockKey
Description copied from interface:LockAndKeyBehaviorSets theBlockEntity'sLockCode.- Specified by:
setLockKeyin interfaceLockAndKeyBehavior<T extends net.minecraft.world.level.block.entity.BlockEntity>- Parameters:
blockEntity- theBlockEntitylock- theLockCodeto set
-
getDisplayName
Description copied from interface:LockAndKeyBehaviorReturns theBlockEntity's display name.- Specified by:
getDisplayNamein interfaceLockAndKeyBehavior<T extends net.minecraft.world.level.block.entity.BlockEntity>- Parameters:
blockEntity- theBlockEntity- Returns:
- the
BlockEntity's display name.
-
toString
-
hashCode
-
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). -
lockGetter
-
lockSetter
Returns the value of thelockSetterrecord component.- Returns:
- the value of the
lockSetterrecord component
-
nameGetter
-