Skip to content

Package net.minecraft.network.protocol.handshake

Part 1/1


ClientIntent

  • Full name: net.minecraft.network.protocol.handshake.ClientIntent
  • Package: net.minecraft.network.protocol.handshake
  • Source: commonnet/minecraft/network/protocol/handshake/ClientIntent.java
  • Type: enum
  • Modifiers: public

net.minecraft.network.protocol.handshake.ClientIntent#byId(int)

  • Origin: common
  • Source: net/minecraft/network/protocol/handshake/ClientIntent.java:12
  • Modifiers: public static
  • Return: ClientIntent

คืออะไร

ดำเนินการ byId ตาม implementation ของ ClientIntent

ทำงานยังไง

แยกกรณีด้วย switch. สร้างออบเจ็กต์: IllegalArgumentException. คืนค่า: switch (i) { case 1 -> STATUS.

Parameters

  • int i

ตัวอย่างใช้งาน

ClientIntent result = ClientIntent.byId(0);

net.minecraft.network.protocol.handshake.ClientIntent#id()

  • Origin: common
  • Source: net/minecraft/network/protocol/handshake/ClientIntent.java:21
  • Modifiers: public
  • Return: int

คืออะไร

ดำเนินการ id ตาม implementation ของ ClientIntent

ทำงานยังไง

แยกกรณีด้วย switch. คืนค่า: switch (this) { case STATUS -> 1.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ClientIntent instance = ...;
int result = instance.id();

ClientIntentionPacket

  • Full name: net.minecraft.network.protocol.handshake.ClientIntentionPacket
  • Package: net.minecraft.network.protocol.handshake
  • Source: commonnet/minecraft/network/protocol/handshake/ClientIntentionPacket.java
  • Type: record
  • Modifiers: public
  • Implements: Packet<ServerHandshakePacketListener>

net.minecraft.network.protocol.handshake.ClientIntentionPacket#ClientIntentionPacket(int,String,int,ClientIntent)

  • Origin: common
  • Source: net/minecraft/network/protocol/handshake/ClientIntentionPacket.java:12
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ ClientIntentionPacket ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • int protocolVersion
  • String hostName
  • int port
  • ClientIntent intention

ตัวอย่างใช้งาน

ClientIntent intention = ...;
ClientIntentionPacket instance = new ClientIntentionPacket(0, "value", 0, intention);

net.minecraft.network.protocol.handshake.ClientIntentionPacket#handle(ServerHandshakePacketListener)

  • Origin: common
  • Source: net/minecraft/network/protocol/handshake/ClientIntentionPacket.java:32
  • Modifiers: public
  • Return: void

คืออะไร

จัดการ handle

ทำงานยังไง

เรียกต่อ: handleIntention().

Parameters

  • ServerHandshakePacketListener serverHandshakePacketListener

ตัวอย่างใช้งาน

ClientIntentionPacket instance = ...;
ServerHandshakePacketListener serverHandshakePacketListener = ...;
instance.handle(serverHandshakePacketListener);

net.minecraft.network.protocol.handshake.ClientIntentionPacket#isTerminal()

  • Origin: common
  • Source: net/minecraft/network/protocol/handshake/ClientIntentionPacket.java:36
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Terminal

ทำงานยังไง

คืนค่า: true.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ClientIntentionPacket instance = ...;
boolean result = instance.isTerminal();

net.minecraft.network.protocol.handshake.ClientIntentionPacket#type()

  • Origin: common
  • Source: net/minecraft/network/protocol/handshake/ClientIntentionPacket.java:27
  • Modifiers: public
  • Return: PacketType<ClientIntentionPacket>

คืออะไร

ดำเนินการ type ตาม implementation ของ ClientIntentionPacket

ทำงานยังไง

คืนค่า: HandshakePacketTypes.CLIENT_INTENTION.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ClientIntentionPacket instance = ...;
PacketType<ClientIntentionPacket> result = instance.type();

ServerHandshakePacketListener

  • Full name: net.minecraft.network.protocol.handshake.ServerHandshakePacketListener
  • Package: net.minecraft.network.protocol.handshake
  • Source: commonnet/minecraft/network/protocol/handshake/ServerHandshakePacketListener.java
  • Type: interface
  • Modifiers: public
  • Implements: ServerPacketListener

net.minecraft.network.protocol.handshake.ServerHandshakePacketListener#handleIntention(ClientIntentionPacket)

  • Origin: common
  • Source: net/minecraft/network/protocol/handshake/ServerHandshakePacketListener.java:12
  • Modifiers: ``
  • Return: void

คืออะไร

จัดการ Intention

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ClientIntentionPacket clientIntentionPacket

ตัวอย่างใช้งาน

ServerHandshakePacketListener instance = ...;
ClientIntentionPacket clientIntentionPacket = ...;
instance.handleIntention(clientIntentionPacket);

net.minecraft.network.protocol.handshake.ServerHandshakePacketListener#protocol()

  • Origin: common
  • Source: net/minecraft/network/protocol/handshake/ServerHandshakePacketListener.java:7
  • Modifiers: default
  • Return: ConnectionProtocol

คืออะไร

ดำเนินการ protocol ตาม implementation ของ ServerHandshakePacketListener

ทำงานยังไง

คืนค่า: ConnectionProtocol.HANDSHAKING.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ServerHandshakePacketListener instance = ...;
ConnectionProtocol result = instance.protocol();