Record Class Spectator
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.battles.controller.participants.Spectator
- All Implemented Interfaces:
BattleViewer
public record Spectator(net.minecraft.server.level.ServerPlayer player, UUID target)
extends Record
implements BattleViewer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.entity.EntityGets the entity this is representing.@Nullable net.minecraft.server.level.ServerPlayerGets the player this is representing.final inthashCode()Returns a hash code value for this object.net.minecraft.server.level.ServerPlayerplayer()Returns the value of theplayerrecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.BattleViewer
sendBattleMessage, sendBattleMessage, sendBattleMessage, sendDamagePacket, sendHealPacket, sendPacket
-
Constructor Details
-
Spectator
Creates an instance of aSpectatorrecord class.- Parameters:
player- the value for theplayerrecord componenttarget- the value for thetargetrecord component
-
-
Method Details
-
getEntity
public net.minecraft.world.entity.Entity getEntity()Description copied from interface:BattleViewerGets the entity this is representing.- Specified by:
getEntityin interfaceBattleViewer- Returns:
- The entity this is representing.
-
getPlayer
@Nullable public @Nullable net.minecraft.server.level.ServerPlayer getPlayer()Description copied from interface:BattleViewerGets the player this is representing.
Note: this method may return null if the entity is not a player.- Specified by:
getPlayerin interfaceBattleViewer- Returns:
- The player this is representing.
-
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). -
player
public net.minecraft.server.level.ServerPlayer player()Returns the value of theplayerrecord component.- Returns:
- the value of the
playerrecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-