Record Class Listener

java.lang.Object
java.lang.Record
icu.suc.kkw557.realinvisibility.fabric.internal.Listener
All Implemented Interfaces:
icu.suc.mc.serverevents.ServerEvents.Connection.Send.Modify, icu.suc.mc.serverevents.ServerEvents.LivingEntity.Effect.Add, icu.suc.mc.serverevents.ServerEvents.LivingEntity.Effect.Remove, net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents.Unload, net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents.Disconnect, net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents.Join

public record Listener(Set<Integer> tracked, Set<icu.suc.kkw557.realinvisibility.common.Setting> settings) extends Record implements net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents.Join, net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents.Disconnect, icu.suc.mc.serverevents.ServerEvents.LivingEntity.Effect.Add, icu.suc.mc.serverevents.ServerEvents.LivingEntity.Effect.Remove, net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents.Unload, icu.suc.mc.serverevents.ServerEvents.Connection.Send.Modify
  • Constructor Summary

    Constructors
    Constructor
    Description
    Listener(Set<icu.suc.kkw557.realinvisibility.common.Setting> settings)
     
    Listener(Set<Integer> tracked, Set<icu.suc.kkw557.realinvisibility.common.Setting> settings)
    Creates an instance of a Listener record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addEffect(@NotNull net.minecraft.world.entity.LivingEntity affectedEntity, @NotNull net.minecraft.world.effect.MobEffectInstance effect, @Nullable net.minecraft.world.entity.Entity sourceEntity)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull net.minecraft.network.protocol.Packet<?>
    modifySend(@Nullable net.minecraft.network.PacketListener packetListener, @NotNull net.minecraft.network.protocol.Packet<?> packet)
     
    void
    onPlayDisconnect(@NotNull net.minecraft.server.network.ServerGamePacketListenerImpl handler, @NotNull net.minecraft.server.MinecraftServer server)
     
    void
    onPlayReady(@NotNull net.minecraft.server.network.ServerGamePacketListenerImpl handler, @NotNull net.fabricmc.fabric.api.networking.v1.PacketSender sender, @NotNull net.minecraft.server.MinecraftServer server)
     
    void
    onUnload(@NotNull net.minecraft.world.entity.Entity entity, @NotNull net.minecraft.server.level.ServerLevel world)
     
    boolean
    removeEffect(@NotNull net.minecraft.world.entity.LivingEntity entity, @Nullable net.minecraft.world.effect.MobEffectInstance effect)
     
    Set<icu.suc.kkw557.realinvisibility.common.Setting>
    Returns the value of the settings record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the tracked record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Listener

      public Listener(Set<icu.suc.kkw557.realinvisibility.common.Setting> settings)
    • Listener

      public Listener(Set<Integer> tracked, Set<icu.suc.kkw557.realinvisibility.common.Setting> settings)
      Creates an instance of a Listener record class.
      Parameters:
      tracked - the value for the tracked record component
      settings - the value for the settings record component
  • Method Details

    • onPlayReady

      public void onPlayReady(@NotNull @NotNull net.minecraft.server.network.ServerGamePacketListenerImpl handler, @NotNull @NotNull net.fabricmc.fabric.api.networking.v1.PacketSender sender, @NotNull @NotNull net.minecraft.server.MinecraftServer server)
      Specified by:
      onPlayReady in interface net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents.Join
    • onPlayDisconnect

      public void onPlayDisconnect(@NotNull @NotNull net.minecraft.server.network.ServerGamePacketListenerImpl handler, @NotNull @NotNull net.minecraft.server.MinecraftServer server)
      Specified by:
      onPlayDisconnect in interface net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents.Disconnect
    • addEffect

      public boolean addEffect(@NotNull @NotNull net.minecraft.world.entity.LivingEntity affectedEntity, @NotNull @NotNull net.minecraft.world.effect.MobEffectInstance effect, @Nullable @Nullable net.minecraft.world.entity.Entity sourceEntity)
      Specified by:
      addEffect in interface icu.suc.mc.serverevents.ServerEvents.LivingEntity.Effect.Add
    • removeEffect

      public boolean removeEffect(@NotNull @NotNull net.minecraft.world.entity.LivingEntity entity, @Nullable @Nullable net.minecraft.world.effect.MobEffectInstance effect)
      Specified by:
      removeEffect in interface icu.suc.mc.serverevents.ServerEvents.LivingEntity.Effect.Remove
    • onUnload

      public void onUnload(@NotNull @NotNull net.minecraft.world.entity.Entity entity, @NotNull @NotNull net.minecraft.server.level.ServerLevel world)
      Specified by:
      onUnload in interface net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents.Unload
    • modifySend

      @NotNull public @NotNull net.minecraft.network.protocol.Packet<?> modifySend(@Nullable @Nullable net.minecraft.network.PacketListener packetListener, @NotNull @NotNull net.minecraft.network.protocol.Packet<?> packet)
      Specified by:
      modifySend in interface icu.suc.mc.serverevents.ServerEvents.Connection.Send.Modify
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • tracked

      public Set<Integer> tracked()
      Returns the value of the tracked record component.
      Returns:
      the value of the tracked record component
    • settings

      public Set<icu.suc.kkw557.realinvisibility.common.Setting> settings()
      Returns the value of the settings record component.
      Returns:
      the value of the settings record component