Record Class AdvancedOpenScreenPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.AdvancedOpenScreenPayload
- Record Components:
windowId
- The window ID to use for the screen.- The menu type to open.
name
- The name of the screen.additionalData
- The additional data to pass to the screen.
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
,ClientDispatchPayload
@Internal
public record AdvancedOpenScreenPayload(int windowId, net.minecraft.world.inventory.MenuType<?> menuType, net.minecraft.network.chat.Component name, byte[] additionalData)
extends Record
implements ClientDispatchPayload
A custom payload that allows for opening screens with additional data.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B extends net.minecraft.network.FriendlyByteBuf>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B extends net.minecraft.network.FriendlyByteBuf,
T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
The field for theadditionalData
record component.private final net.minecraft.world.inventory.MenuType
<?> The field for themenuType
record component.private final net.minecraft.network.chat.Component
The field for thename
record component.static final net.minecraft.network.codec.StreamCodec
<net.minecraft.network.RegistryFriendlyByteBuf, AdvancedOpenScreenPayload> static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type
<AdvancedOpenScreenPayload> private final int
The field for thewindowId
record component. -
Constructor Summary
ConstructorsConstructorDescriptionAdvancedOpenScreenPayload
(int windowId, net.minecraft.world.inventory.MenuType<?> menuType, net.minecraft.network.chat.Component name, byte[] additionalData) Creates an instance of aAdvancedOpenScreenPayload
record class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns the value of theadditionalData
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.net.minecraft.world.inventory.MenuType
<?> menuType()
Returns the value of themenuType
record component.net.minecraft.network.chat.Component
name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type
<AdvancedOpenScreenPayload> type()
int
windowId()
Returns the value of thewindowId
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
windowId
private final int windowIdThe field for thewindowId
record component. -
name
private final net.minecraft.network.chat.Component nameThe field for thename
record component. -
additionalData
private final byte[] additionalDataThe field for theadditionalData
record component. -
TYPE
public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<AdvancedOpenScreenPayload> TYPE -
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,AdvancedOpenScreenPayload> STREAM_CODEC
-
-
Constructor Details
-
AdvancedOpenScreenPayload
public AdvancedOpenScreenPayload(int windowId, net.minecraft.world.inventory.MenuType<?> menuType, net.minecraft.network.chat.Component name, byte[] additionalData) Creates an instance of aAdvancedOpenScreenPayload
record class.- Parameters:
windowId
- the value for thewindowId
record componentmenuType
- the value for themenuType
record componentname
- the value for thename
record componentadditionalData
- the value for theadditionalData
record component
-
-
Method Details
-
type
public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<AdvancedOpenScreenPayload> type()- Specified by:
type
in interfacenet.minecraft.network.protocol.common.custom.CustomPacketPayload
-
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 '=='. -
windowId
public int windowId()Returns the value of thewindowId
record component.- Returns:
- the value of the
windowId
record component
-
name
public net.minecraft.network.chat.Component name()Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
additionalData
public byte[] additionalData()Returns the value of theadditionalData
record component.- Returns:
- the value of the
additionalData
record component
-