Record Class SimpleDetectionLogic
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.replacement.detection.SimpleDetectionLogic
- All Implemented Interfaces:
SpawnDetectionLogic
public record SimpleDetectionLogic(net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> types)
extends Record
implements SpawnDetectionLogic
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SimpleDetectionLogic> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleDetectionLogic(net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> types) Creates an instance of aSimpleDetectionLogicrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends SpawnDetectionLogic> codec()Gets the codec for this detection logicfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanshouldReplaceSpawn(net.neoforged.neoforge.event.entity.EntityJoinLevelEvent event) Checks if the spawn should be replacedfinal StringtoString()Returns a string representation of this record class.net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> types()Returns the value of thetypesrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
SimpleDetectionLogic
public SimpleDetectionLogic(net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> types) Creates an instance of aSimpleDetectionLogicrecord class.- Parameters:
types- the value for thetypesrecord component
-
-
Method Details
-
codec
Description copied from interface:SpawnDetectionLogicGets the codec for this detection logic- Specified by:
codecin interfaceSpawnDetectionLogic- Returns:
- The codec
-
shouldReplaceSpawn
public boolean shouldReplaceSpawn(net.neoforged.neoforge.event.entity.EntityJoinLevelEvent event) Description copied from interface:SpawnDetectionLogicChecks if the spawn should be replaced- Specified by:
shouldReplaceSpawnin interfaceSpawnDetectionLogic- Parameters:
event- The spawn event
-
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). -
types
public net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> types()Returns the value of thetypesrecord component.- Returns:
- the value of the
typesrecord component
-