Record Class EndSpikeFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.EndSpikeFeature
- All Implemented Interfaces:
Feature
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<EndSpikeFeature> The field for thecrystalBeamTargetrecord component.private final booleanThe field for thecrystalInvulnerablerecord component.private static final intprivate static final LoadingCache<Long, List<EndSpikeFeature.EndSpike>> private static final intprivate final List<EndSpikeFeature.EndSpike> The field for thespikesrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionEndSpikeFeature(List<EndSpikeFeature.EndSpike> spikes, boolean crystalInvulnerable, Optional<BlockPos> crystalBeamTarget) Creates an instance of aEndSpikeFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<EndSpikeFeature> codec()Returns the value of thecrystalBeamTargetrecord component.booleanReturns the value of thecrystalInvulnerablerecord component.final booleanIndicates whether some other object is "equal to" this one.static List<EndSpikeFeature.EndSpike> getSpikesForLevel(WorldGenLevel level) final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) private voidplaceSpike(ServerLevelAccessor level, RandomSource random, EndSpikeFeature.EndSpike spike) spikes()Returns the value of thespikesrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
spikes
The field for thespikesrecord component. -
crystalInvulnerable
private final boolean crystalInvulnerableThe field for thecrystalInvulnerablerecord component. -
crystalBeamTarget
-
NUMBER_OF_SPIKES
private static final int NUMBER_OF_SPIKES- See Also:
-
SPIKE_DISTANCE
private static final int SPIKE_DISTANCE- See Also:
-
SPIKE_CACHE
-
CODEC
-
-
Constructor Details
-
EndSpikeFeature
public EndSpikeFeature(List<EndSpikeFeature.EndSpike> spikes, boolean crystalInvulnerable, Optional<BlockPos> crystalBeamTarget) Creates an instance of aEndSpikeFeaturerecord class.- Parameters:
spikes- the value for thespikesrecord componentcrystalInvulnerable- the value for thecrystalInvulnerablerecord componentcrystalBeamTarget- the value for thecrystalBeamTargetrecord component
-
-
Method Details
-
getSpikesForLevel
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
placeSpike
private void placeSpike(ServerLevelAccessor level, RandomSource random, EndSpikeFeature.EndSpike spike) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
spikes
Returns the value of thespikesrecord component.- Returns:
- the value of the
spikesrecord component
-
crystalInvulnerable
public boolean crystalInvulnerable()Returns the value of thecrystalInvulnerablerecord component.- Returns:
- the value of the
crystalInvulnerablerecord component
-
crystalBeamTarget
-