Record Class ConnectionEvent
java.lang.Object
java.lang.Record
com.minecolonies.api.colony.connections.ConnectionEvent
- Record Components:
id- the colony id.connectionEventType- the event type enum.
public record ConnectionEvent(int id, String name, ConnectionEventType connectionEventType)
extends Record
Connected Event Data with:
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionEvent(int id, String name, ConnectionEventType connectionEventType) Creates an instance of aConnectionEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconnectionEventTyperecord component.static ConnectionEventdeserializeByteBuf(net.minecraft.network.FriendlyByteBuf buf) static ConnectionEventdeserializeNBT(net.minecraft.nbt.CompoundTag compoundTag) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.voidserializeByteBuf(net.minecraft.network.FriendlyByteBuf buf) net.minecraft.nbt.CompoundTagfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConnectionEvent
Creates an instance of aConnectionEventrecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentconnectionEventType- the value for theconnectionEventTyperecord component
-
-
Method Details
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT() -
serializeByteBuf
public void serializeByteBuf(net.minecraft.network.FriendlyByteBuf buf) -
deserializeNBT
-
deserializeByteBuf
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
connectionEventType
Returns the value of theconnectionEventTyperecord component.- Returns:
- the value of the
connectionEventTyperecord component
-