Record Class BoxPlaybackArea
java.lang.Object
java.lang.Record
de.mrjulsen.dragnsounds.api.playback.BoxPlaybackArea
- All Implemented Interfaces:
IPlaybackArea
public record BoxPlaybackArea(net.minecraft.world.phys.Vec3 root, double x1, double y1, double z1, double x2, double y2, double z2)
extends Record
implements IPlaybackArea
This implementation of
IPlaybackArea
checks if the player is inside a box relative to the given root position.-
Constructor Summary
ConstructorDescriptionBoxPlaybackArea
(net.minecraft.world.phys.Vec3 root, double x1, double y1, double z1, double x2, double y2, double z2) Creates an instance of aBoxPlaybackArea
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canPlayForPlayer
(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player) Check if the player matches the criteria.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static BoxPlaybackArea
of
(net.minecraft.core.BlockPos root, net.minecraft.core.BlockPos a, net.minecraft.core.BlockPos b) static BoxPlaybackArea
of
(net.minecraft.world.phys.Vec3 root, net.minecraft.core.BlockPos a, net.minecraft.core.BlockPos b) static BoxPlaybackArea
of
(net.minecraft.world.phys.Vec3 root, net.minecraft.world.phys.Vec3 a, net.minecraft.world.phys.Vec3 b) net.minecraft.world.phys.Vec3
root()
Returns the value of theroot
record component.final String
toString()
Returns a string representation of this record class.double
x1()
Returns the value of thex1
record component.double
x2()
Returns the value of thex2
record component.double
y1()
Returns the value of they1
record component.double
y2()
Returns the value of they2
record component.double
z1()
Returns the value of thez1
record component.double
z2()
Returns the value of thez2
record component.
-
Constructor Details
-
BoxPlaybackArea
public BoxPlaybackArea(net.minecraft.world.phys.Vec3 root, double x1, double y1, double z1, double x2, double y2, double z2) Creates an instance of aBoxPlaybackArea
record class.- Parameters:
root
- the value for theroot
record componentx1
- the value for thex1
record componenty1
- the value for they1
record componentz1
- the value for thez1
record componentx2
- the value for thex2
record componenty2
- the value for they2
record componentz2
- the value for thez2
record component
-
-
Method Details
-
of
public static BoxPlaybackArea of(net.minecraft.world.phys.Vec3 root, net.minecraft.world.phys.Vec3 a, net.minecraft.world.phys.Vec3 b) -
of
public static BoxPlaybackArea of(net.minecraft.world.phys.Vec3 root, net.minecraft.core.BlockPos a, net.minecraft.core.BlockPos b) -
of
public static BoxPlaybackArea of(net.minecraft.core.BlockPos root, net.minecraft.core.BlockPos a, net.minecraft.core.BlockPos b) -
canPlayForPlayer
public boolean canPlayForPlayer(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player) Description copied from interface:IPlaybackArea
Check if the player matches the criteria.- Specified by:
canPlayForPlayer
in interfaceIPlaybackArea
- Parameters:
level
- The current world level.player
- The player to check.- Returns:
true
if the player matches the given criteria,false
otherwise.
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
root
public net.minecraft.world.phys.Vec3 root()Returns the value of theroot
record component.- Returns:
- the value of the
root
record component
-
x1
public double x1()Returns the value of thex1
record component.- Returns:
- the value of the
x1
record component
-
y1
public double y1()Returns the value of they1
record component.- Returns:
- the value of the
y1
record component
-
z1
public double z1()Returns the value of thez1
record component.- Returns:
- the value of the
z1
record component
-
x2
public double x2()Returns the value of thex2
record component.- Returns:
- the value of the
x2
record component
-
y2
public double y2()Returns the value of they2
record component.- Returns:
- the value of the
y2
record component
-
z2
public double z2()Returns the value of thez2
record component.- Returns:
- the value of the
z2
record component
-