Record Class CarryOnModHooks.SaveBlockHook
java.lang.Object
java.lang.Record
tschipp.carryon.common.carry.compat.CarryOnModHooks.SaveBlockHook
- Enclosing class:
CarryOnModHooks
public static record CarryOnModHooks.SaveBlockHook(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionSaveBlockHook(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.entity.BlockEntity blockEntity) Creates an instance of aSaveBlockHookrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.entity.BlockEntityReturns the value of theblockEntityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.server.level.ServerPlayerplayer()Returns the value of theplayerrecord component.net.minecraft.core.BlockPospos()Returns the value of theposrecord component.net.minecraft.world.level.block.state.BlockStatestate()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SaveBlockHook
public SaveBlockHook(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity) Creates an instance of aSaveBlockHookrecord class.- Parameters:
player- the value for theplayerrecord componentpos- the value for theposrecord componentstate- the value for thestaterecord componentblockEntity- the value for theblockEntityrecord component
-
-
Method Details
-
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). -
player
public net.minecraft.server.level.ServerPlayer player()Returns the value of theplayerrecord component.- Returns:
- the value of the
playerrecord component
-
pos
public net.minecraft.core.BlockPos pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
state
public net.minecraft.world.level.block.state.BlockState state()Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
blockEntity
@Nullable public net.minecraft.world.level.block.entity.BlockEntity blockEntity()Returns the value of theblockEntityrecord component.- Returns:
- the value of the
blockEntityrecord component
-