Record Class PetTracker.PetInfo<P extends net.minecraft.world.entity.Entity>
java.lang.Object
java.lang.Record
com.hammy275.immersivemc.server.tracker.vrhand.PetTracker.PetInfo<P>
- Enclosing class:
PetTracker
protected static record PetTracker.PetInfo<P extends net.minecraft.world.entity.Entity>(P extends net.minecraft.world.entity.Entity pet, PettingHandler<P extends net.minecraft.world.entity.Entity> handler)
extends Record
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPetInfo(P pet, PettingHandler<P> handler) Creates an instance of aPetInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <P extends net.minecraft.world.entity.Entity>
PetTracker.PetInfo<P> create(net.minecraft.world.entity.Entity entity, PettingHandler<P> handler) final booleanIndicates whether some other object is "equal to" this one.inthandlePet(net.minecraft.server.level.ServerPlayer petter, net.minecraft.world.phys.Vec3 handPos) handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.pet()Returns the value of thepetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PetInfo
Creates an instance of aPetInforecord class.- Parameters:
pet- the value for thepetrecord componenthandler- the value for thehandlerrecord component
-
-
Method Details
-
create
public static <P extends net.minecraft.world.entity.Entity> PetTracker.PetInfo<P> create(net.minecraft.world.entity.Entity entity, PettingHandler<P> handler) -
handlePet
public int handlePet(net.minecraft.server.level.ServerPlayer petter, net.minecraft.world.phys.Vec3 handPos) -
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). -
pet
Returns the value of thepetrecord component.- Returns:
- the value of the
petrecord component
-
handler
Returns the value of thehandlerrecord component.- Returns:
- the value of the
handlerrecord component
-