Skip to content

Package net.minecraft.client.gui.spectator

Part 1/1


PlayerMenuItem

  • Full name: net.minecraft.client.gui.spectator.PlayerMenuItem
  • Package: net.minecraft.client.gui.spectator
  • Source: clientOnlynet/minecraft/client/gui/spectator/PlayerMenuItem.java
  • Type: class
  • Modifiers: public
  • Implements: SpectatorMenuItem

net.minecraft.client.gui.spectator.PlayerMenuItem#getName()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/PlayerMenuItem.java:32
  • Modifiers: public
  • Return: Component

คืออะไร

อ่านค่า Name

ทำงานยังไง

คืนค่า: this.name.

Parameters

  • ไม่มี

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

PlayerMenuItem instance = ...;
Component result = instance.getName();

net.minecraft.client.gui.spectator.PlayerMenuItem#isEnabled()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/PlayerMenuItem.java:42
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

คืนค่า: true.

Parameters

  • ไม่มี

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

PlayerMenuItem instance = ...;
boolean result = instance.isEnabled();

net.minecraft.client.gui.spectator.PlayerMenuItem#PlayerMenuItem(GameProfile)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/PlayerMenuItem.java:21
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: profile, skin, name. เรียกต่อ: getInstance(), getSkinManager(), lookupInsecure(), literal(), getName().

Parameters

  • GameProfile gameProfile

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

GameProfile gameProfile = ...;
PlayerMenuItem instance = new PlayerMenuItem(gameProfile);

net.minecraft.client.gui.spectator.PlayerMenuItem#renderIcon(GuiGraphics,float,float)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/PlayerMenuItem.java:37
  • Modifiers: public
  • Return: void

คืออะไร

เรนเดอร์ Icon

ทำงานยังไง

เรียกต่อ: draw(), get(), white().

Parameters

  • GuiGraphics guiGraphics
  • float f
  • float g

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

PlayerMenuItem instance = ...;
GuiGraphics guiGraphics = ...;
instance.renderIcon(guiGraphics, 0.0F, 0.0F);

net.minecraft.client.gui.spectator.PlayerMenuItem#selectItem(SpectatorMenu)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/PlayerMenuItem.java:27
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ selectItem ตาม implementation ของ PlayerMenuItem

ทำงานยังไง

เรียกต่อ: getInstance(), getConnection(), send(), getId(). สร้างออบเจ็กต์: ServerboundTeleportToEntityPacket.

Parameters

  • SpectatorMenu spectatorMenu

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

PlayerMenuItem instance = ...;
SpectatorMenu spectatorMenu = ...;
instance.selectItem(spectatorMenu);

RootSpectatorMenuCategory

  • Full name: net.minecraft.client.gui.spectator.RootSpectatorMenuCategory
  • Package: net.minecraft.client.gui.spectator
  • Source: clientOnlynet/minecraft/client/gui/spectator/RootSpectatorMenuCategory.java
  • Type: class
  • Modifiers: public
  • Implements: SpectatorMenuCategory

net.minecraft.client.gui.spectator.RootSpectatorMenuCategory#getItems()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/RootSpectatorMenuCategory.java:21
  • Modifiers: public
  • Return: List<SpectatorMenuItem>

คืออะไร

อ่านค่า Items

ทำงานยังไง

คืนค่า: this.items.

Parameters

  • ไม่มี

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

RootSpectatorMenuCategory instance = ...;
List<SpectatorMenuItem> result = instance.getItems();

net.minecraft.client.gui.spectator.RootSpectatorMenuCategory#getPrompt()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/RootSpectatorMenuCategory.java:26
  • Modifiers: public
  • Return: Component

คืออะไร

อ่านค่า Prompt

ทำงานยังไง

คืนค่า: PROMPT_TEXT.

Parameters

  • ไม่มี

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

RootSpectatorMenuCategory instance = ...;
Component result = instance.getPrompt();

net.minecraft.client.gui.spectator.RootSpectatorMenuCategory#RootSpectatorMenuCategory()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/RootSpectatorMenuCategory.java:16
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

เรียกต่อ: add(). สร้างออบเจ็กต์: TeleportToPlayerMenuCategory, TeleportToTeamMenuCategory.

Parameters

  • ไม่มี

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

RootSpectatorMenuCategory instance = new RootSpectatorMenuCategory();

SpectatorMenu

  • Full name: net.minecraft.client.gui.spectator.SpectatorMenu
  • Package: net.minecraft.client.gui.spectator
  • Source: clientOnlynet/minecraft/client/gui/spectator/SpectatorMenu.java
  • Type: class
  • Modifiers: public

net.minecraft.client.gui.spectator.SpectatorMenu#exit()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:100
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ exit ตาม implementation ของ SpectatorMenu

ทำงานยังไง

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

Parameters

  • ไม่มี

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

SpectatorMenu instance = ...;
instance.exit();

net.minecraft.client.gui.spectator.SpectatorMenu#getCurrentPage()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:114
  • Modifiers: public
  • Return: SpectatorPage

คืออะไร

อ่านค่า Current Page

ทำงานยังไง

เรียกต่อ: getItems(). สร้างออบเจ็กต์: SpectatorPage. คืนค่า: new SpectatorPage(this.getItems(), this.selectedSlot).

Parameters

  • ไม่มี

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

SpectatorMenu instance = ...;
SpectatorPage result = instance.getCurrentPage();

net.minecraft.client.gui.spectator.SpectatorMenu#getItem(int)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:58
  • Modifiers: public
  • Return: SpectatorMenuItem

คืออะไร

อ่านค่า Item

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItems(), size(), firstNonNull(), get(). มีจุด return อย่างน้อย 4 จุด.

Parameters

  • int i

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

SpectatorMenu instance = ...;
SpectatorMenuItem result = instance.getItem(0);

net.minecraft.client.gui.spectator.SpectatorMenu#getItems()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:71
  • Modifiers: public
  • Return: List<SpectatorMenuItem>

คืออะไร

อ่านค่า Items

ทำงานยังไง

มีการวนลูป. เรียกต่อ: newArrayList(), add(), getItem(). คืนค่า: list.

Parameters

  • ไม่มี

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

SpectatorMenu instance = ...;
List<SpectatorMenuItem> result = instance.getItems();

net.minecraft.client.gui.spectator.SpectatorMenu#getSelectedCategory()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:85
  • Modifiers: public
  • Return: SpectatorMenuCategory

คืออะไร

อ่านค่า Selected Category

ทำงานยังไง

คืนค่า: this.category.

Parameters

  • ไม่มี

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

SpectatorMenu instance = ...;
SpectatorMenuCategory result = instance.getSelectedCategory();

net.minecraft.client.gui.spectator.SpectatorMenu#getSelectedItem()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:81
  • Modifiers: public
  • Return: SpectatorMenuItem

คืออะไร

อ่านค่า Selected Item

ทำงานยังไง

เรียกต่อ: getItem(). คืนค่า: this.getItem(this.selectedSlot).

Parameters

  • ไม่มี

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

SpectatorMenu instance = ...;
SpectatorMenuItem result = instance.getSelectedItem();

net.minecraft.client.gui.spectator.SpectatorMenu#getSelectedSlot()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:104
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Selected Slot

ทำงานยังไง

คืนค่า: this.selectedSlot.

Parameters

  • ไม่มี

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

SpectatorMenu instance = ...;
int result = instance.getSelectedSlot();

net.minecraft.client.gui.spectator.SpectatorMenu#selectCategory(SpectatorMenuCategory)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:108
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ selectCategory ตาม implementation ของ SpectatorMenu

ทำงานยังไง

แก้ state: category, selectedSlot, page.

Parameters

  • SpectatorMenuCategory spectatorMenuCategory

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

SpectatorMenu instance = ...;
SpectatorMenuCategory spectatorMenuCategory = ...;
instance.selectCategory(spectatorMenuCategory);

net.minecraft.client.gui.spectator.SpectatorMenu#selectSlot(int)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:89
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ selectSlot ตาม implementation ของ SpectatorMenu

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: selectedSlot. เรียกต่อ: getItem(), isEnabled(), selectItem().

Parameters

  • int i

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

SpectatorMenu instance = ...;
instance.selectSlot(0);

net.minecraft.client.gui.spectator.SpectatorMenu#SpectatorMenu(SpectatorMenuListener)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenu.java:53
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: category, listener. สร้างออบเจ็กต์: RootSpectatorMenuCategory.

Parameters

  • SpectatorMenuListener spectatorMenuListener

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

SpectatorMenuListener spectatorMenuListener = ...;
SpectatorMenu instance = new SpectatorMenu(spectatorMenuListener);

SpectatorMenuCategory

  • Full name: net.minecraft.client.gui.spectator.SpectatorMenuCategory
  • Package: net.minecraft.client.gui.spectator
  • Source: clientOnlynet/minecraft/client/gui/spectator/SpectatorMenuCategory.java
  • Type: interface
  • Modifiers: public

net.minecraft.client.gui.spectator.SpectatorMenuCategory#getItems()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenuCategory.java:10
  • Modifiers: ``
  • Return: List<SpectatorMenuItem>

คืออะไร

อ่านค่า Items

ทำงานยังไง

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

Parameters

  • ไม่มี

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

SpectatorMenuCategory instance = ...;
List<SpectatorMenuItem> result = instance.getItems();

net.minecraft.client.gui.spectator.SpectatorMenuCategory#getPrompt()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenuCategory.java:12
  • Modifiers: ``
  • Return: Component

คืออะไร

อ่านค่า Prompt

ทำงานยังไง

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

Parameters

  • ไม่มี

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

SpectatorMenuCategory instance = ...;
Component result = instance.getPrompt();

SpectatorMenuItem

  • Full name: net.minecraft.client.gui.spectator.SpectatorMenuItem
  • Package: net.minecraft.client.gui.spectator
  • Source: clientOnlynet/minecraft/client/gui/spectator/SpectatorMenuItem.java
  • Type: interface
  • Modifiers: public

net.minecraft.client.gui.spectator.SpectatorMenuItem#getName()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenuItem.java:12
  • Modifiers: ``
  • Return: Component

คืออะไร

อ่านค่า Name

ทำงานยังไง

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

Parameters

  • ไม่มี

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

SpectatorMenuItem instance = ...;
Component result = instance.getName();

net.minecraft.client.gui.spectator.SpectatorMenuItem#isEnabled()

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenuItem.java:16
  • Modifiers: ``
  • Return: boolean

คืออะไร

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

ทำงานยังไง

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

Parameters

  • ไม่มี

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

SpectatorMenuItem instance = ...;
boolean result = instance.isEnabled();

net.minecraft.client.gui.spectator.SpectatorMenuItem#renderIcon(GuiGraphics,float,float)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenuItem.java:14
  • Modifiers: ``
  • Return: void

คืออะไร

เรนเดอร์ Icon

ทำงานยังไง

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

Parameters

  • GuiGraphics guiGraphics
  • float f
  • float g

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

SpectatorMenuItem instance = ...;
GuiGraphics guiGraphics = ...;
instance.renderIcon(guiGraphics, 0.0F, 0.0F);

net.minecraft.client.gui.spectator.SpectatorMenuItem#selectItem(SpectatorMenu)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenuItem.java:10
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ selectItem ตาม implementation ของ SpectatorMenuItem

ทำงานยังไง

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

Parameters

  • SpectatorMenu spectatorMenu

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

SpectatorMenuItem instance = ...;
SpectatorMenu spectatorMenu = ...;
instance.selectItem(spectatorMenu);

SpectatorMenuListener

  • Full name: net.minecraft.client.gui.spectator.SpectatorMenuListener
  • Package: net.minecraft.client.gui.spectator
  • Source: clientOnlynet/minecraft/client/gui/spectator/SpectatorMenuListener.java
  • Type: interface
  • Modifiers: public

net.minecraft.client.gui.spectator.SpectatorMenuListener#onSpectatorMenuClosed(SpectatorMenu)

  • Origin: clientOnly
  • Source: net/minecraft/client/gui/spectator/SpectatorMenuListener.java:8
  • Modifiers: ``
  • Return: void

คืออะไร

จัดการเหตุการณ์ Spectator Menu Closed

ทำงานยังไง

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

Parameters

  • SpectatorMenu spectatorMenu

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

SpectatorMenuListener instance = ...;
SpectatorMenu spectatorMenu = ...;
instance.onSpectatorMenuClosed(spectatorMenu);