Record Class PetTicker.PetInfo<P extends net.minecraft.world.entity.Entity>
java.lang.Object
java.lang.Record
com.hammy275.immersivemc.server.ticker.hand.PetTicker.PetInfo<P>
- Enclosing class:
PetTicker
protected static record PetTicker.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>
PetTicker.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> PetTicker.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
-
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. 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
-