Package net.minecraftforge.fml
Record Class InterModComms.IMCMessage
java.lang.Object
java.lang.Record
net.minecraftforge.fml.InterModComms.IMCMessage
- Enclosing class:
- InterModComms
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Supplier<?>
The field for themessageSupplier
record component.private final String
The field for themethod
record component.private final String
The field for themodId
record component.private final String
The field for thesenderModId
record component. -
Constructor Summary
ConstructorDescriptionIMCMessage
(String senderModId, String modId, String method, Supplier<?> messageSupplier) Creates an instance of aIMCMessage
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final <T> Supplier<T>
Deprecated.final String
Deprecated.final String
getModId()
Deprecated.final String
Deprecated.final int
hashCode()
Returns a hash code value for this object.Supplier<?>
Returns the value of themessageSupplier
record component.method()
Returns the value of themethod
record component.modId()
Returns the value of themodId
record component.Returns the value of thesenderModId
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
senderModId
The field for thesenderModId
record component. -
modId
The field for themodId
record component. -
method
The field for themethod
record component. -
messageSupplier
The field for themessageSupplier
record component.
-
-
Constructor Details
-
IMCMessage
Creates an instance of aIMCMessage
record class.- Parameters:
senderModId
- the value for thesenderModId
record componentmodId
- the value for themodId
record componentmethod
- the value for themethod
record componentmessageSupplier
- the value for themessageSupplier
record component
-
-
Method Details
-
getSenderModId
Deprecated.Deprecated: usesenderModId()
- Returns:
- The modid of the sender. This is supplied by the caller, or by the active mod container context. Consider it unreliable.
-
getModId
Deprecated.Deprecated: usemodId()
- Returns:
- The modid being sent to.
-
getMethod
Deprecated.Deprecated: usemethod()
- Returns:
- The method being sent to.
-
getMessageSupplier
Deprecated.- Type Parameters:
T
- The type of the message.- Returns:
- A
Supplier
of the message. UsemessageSupplier()
-
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)
. -
senderModId
Returns the value of thesenderModId
record component.- Returns:
- the value of the
senderModId
record component
-
modId
Returns the value of themodId
record component.- Returns:
- the value of the
modId
record component
-
method
Returns the value of themethod
record component.- Returns:
- the value of the
method
record component
-
messageSupplier
Returns the value of themessageSupplier
record component.- Returns:
- the value of the
messageSupplier
record component
-