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 aSimpleDetectionLogic
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<? extends SpawnDetectionLogic> codec()
Gets the codec for this detection logicfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
shouldReplaceSpawn
(net.neoforged.neoforge.event.entity.EntityJoinLevelEvent event) Checks if the spawn should be replacedfinal String
toString()
Returns a string representation of this record class.net.minecraft.core.HolderSet
<net.minecraft.world.entity.EntityType<?>> types()
Returns the value of thetypes
record component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
SimpleDetectionLogic
public SimpleDetectionLogic(net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> types) Creates an instance of aSimpleDetectionLogic
record class.- Parameters:
types
- the value for thetypes
record component
-
-
Method Details
-
codec
Description copied from interface:SpawnDetectionLogic
Gets the codec for this detection logic- Specified by:
codec
in interfaceSpawnDetectionLogic
- Returns:
- The codec
-
shouldReplaceSpawn
public boolean shouldReplaceSpawn(net.neoforged.neoforge.event.entity.EntityJoinLevelEvent event) Description copied from interface:SpawnDetectionLogic
Checks if the spawn should be replaced- Specified by:
shouldReplaceSpawn
in 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 thetypes
record component.- Returns:
- the value of the
types
record component
-