Record Class Sprayed.BlockTarget
java.lang.Object
java.lang.Record
dev.jaxydog.astral.content.item.custom.Sprayed.BlockTarget
- Record Components:
world- The current world.pos- The block position.side- The sprayed side.
- All Implemented Interfaces:
Sprayed.SprayTarget
- Enclosing interface:
Sprayed
public static record Sprayed.BlockTarget(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.Direction side)
extends Record
implements Sprayed.SprayTarget
Describes the target block of a spray invocation.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionBlockTarget(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.Direction side) Creates an instance of aBlockTargetrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubledistance(Sprayed.Source source) Returns the distance of this target from the spray source.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.util.math.BlockPospos()Returns the value of theposrecord component.net.minecraft.util.math.Directionside()Returns the value of thesiderecord component.net.minecraft.block.BlockStatestate()Returns the block target's block state.final StringtoString()Returns a string representation of this record class.net.minecraft.world.Worldworld()Returns the value of theworldrecord component.
-
Constructor Details
-
BlockTarget
public BlockTarget(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.Direction side) Creates an instance of aBlockTargetrecord class.
-
-
Method Details
-
state
public net.minecraft.block.BlockState state()Returns the block target's block state.- Returns:
- The block's state.
- Since:
- 2.0.0
-
distance
Description copied from interface:Sprayed.SprayTargetReturns the distance of this target from the spray source.- Specified by:
distancein interfaceSprayed.SprayTarget- Parameters:
source- The spray source.- Returns:
- The distance.
-
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). -
world
public net.minecraft.world.World world()Returns the value of theworldrecord component.- Returns:
- the value of the
worldrecord component
-
pos
public net.minecraft.util.math.BlockPos pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
side
public net.minecraft.util.math.Direction side()Returns the value of thesiderecord component.- Returns:
- the value of the
siderecord component
-