Record Class LocationPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.LocationPredicate
public record LocationPredicate(Optional<LocationPredicate.PositionPredicate> position, Optional<ResourceKey<Biome>> biome, Optional<ResourceKey<Structure>> structure, Optional<ResourceKey<Level>> dimension, Optional<Boolean> smokey, Optional<LightPredicate> light, Optional<BlockPredicate> block, Optional<FluidPredicate> fluid)
extends Record
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
(package private) static final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Optional<ResourceKey<Biome>>
The field for thebiome
record component.private final Optional<BlockPredicate>
The field for theblock
record component.static final com.mojang.serialization.Codec<LocationPredicate>
private final Optional<ResourceKey<Level>>
The field for thedimension
record component.private final Optional<FluidPredicate>
The field for thefluid
record component.private final Optional<LightPredicate>
The field for thelight
record component.private final Optional<LocationPredicate.PositionPredicate>
The field for theposition
record component.The field for thesmokey
record component.private final Optional<ResourceKey<Structure>>
The field for thestructure
record component. -
Constructor Summary
ConstructorDescriptionLocationPredicate
(Optional<LocationPredicate.PositionPredicate> position, Optional<ResourceKey<Biome>> biome, Optional<ResourceKey<Structure>> structure, Optional<ResourceKey<Level>> dimension, Optional<Boolean> smokey, Optional<LightPredicate> light, Optional<BlockPredicate> block, Optional<FluidPredicate> fluid) Creates an instance of aLocationPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionbiome()
Returns the value of thebiome
record component.block()
Returns the value of theblock
record component.Returns the value of thedimension
record component.final boolean
Indicates whether some other object is "equal to" this one.fluid()
Returns the value of thefluid
record component.static Optional<LocationPredicate>
fromJson
(com.google.gson.JsonElement p_52630_) final int
hashCode()
Returns a hash code value for this object.light()
Returns the value of thelight
record component.boolean
matches
(ServerLevel p_52618_, double p_52619_, double p_52620_, double p_52621_) private static Optional<LocationPredicate>
of
(Optional<LocationPredicate.PositionPredicate> p_298583_, Optional<ResourceKey<Biome>> p_299235_, Optional<ResourceKey<Structure>> p_300788_, Optional<ResourceKey<Level>> p_299843_, Optional<Boolean> p_299039_, Optional<LightPredicate> p_297467_, Optional<BlockPredicate> p_298254_, Optional<FluidPredicate> p_297912_) position()
Returns the value of theposition
record component.com.google.gson.JsonElement
smokey()
Returns the value of thesmokey
record component.Returns the value of thestructure
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
position
The field for theposition
record component. -
biome
The field for thebiome
record component. -
structure
The field for thestructure
record component. -
dimension
The field for thedimension
record component. -
smokey
The field for thesmokey
record component. -
light
The field for thelight
record component. -
block
The field for theblock
record component. -
fluid
The field for thefluid
record component. -
CODEC
-
-
Constructor Details
-
LocationPredicate
public LocationPredicate(Optional<LocationPredicate.PositionPredicate> position, Optional<ResourceKey<Biome>> biome, Optional<ResourceKey<Structure>> structure, Optional<ResourceKey<Level>> dimension, Optional<Boolean> smokey, Optional<LightPredicate> light, Optional<BlockPredicate> block, Optional<FluidPredicate> fluid) Creates an instance of aLocationPredicate
record class.- Parameters:
position
- the value for theposition
record componentbiome
- the value for thebiome
record componentstructure
- the value for thestructure
record componentdimension
- the value for thedimension
record componentsmokey
- the value for thesmokey
record componentlight
- the value for thelight
record componentblock
- the value for theblock
record componentfluid
- the value for thefluid
record component
-
-
Method Details
-
of
private static Optional<LocationPredicate> of(Optional<LocationPredicate.PositionPredicate> p_298583_, Optional<ResourceKey<Biome>> p_299235_, Optional<ResourceKey<Structure>> p_300788_, Optional<ResourceKey<Level>> p_299843_, Optional<Boolean> p_299039_, Optional<LightPredicate> p_297467_, Optional<BlockPredicate> p_298254_, Optional<FluidPredicate> p_297912_) -
matches
-
serializeToJson
public com.google.gson.JsonElement serializeToJson() -
fromJson
-
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)
. -
position
Returns the value of theposition
record component.- Returns:
- the value of the
position
record component
-
biome
Returns the value of thebiome
record component.- Returns:
- the value of the
biome
record component
-
structure
Returns the value of thestructure
record component.- Returns:
- the value of the
structure
record component
-
dimension
Returns the value of thedimension
record component.- Returns:
- the value of the
dimension
record component
-
smokey
Returns the value of thesmokey
record component.- Returns:
- the value of the
smokey
record component
-
light
Returns the value of thelight
record component.- Returns:
- the value of the
light
record component
-
block
Returns the value of theblock
record component.- Returns:
- the value of the
block
record component
-
fluid
Returns the value of thefluid
record component.- Returns:
- the value of the
fluid
record component
-