Skip to content

Package com.mojang.realmsclient

Part 1/1


RealmsAvailability

  • Full name: com.mojang.realmsclient.RealmsAvailability
  • Package: com.mojang.realmsclient
  • Source: clientOnlycom/mojang/realmsclient/RealmsAvailability.java
  • Type: class
  • Modifiers: public

com.mojang.realmsclient.RealmsAvailability#get()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsAvailability.java:27
  • Modifiers: public static
  • Return: CompletableFuture<RealmsAvailability.Result>

คืออะไร

อ่านค่า get

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: shouldRefresh(), check(). คืนค่า: future.

Parameters

  • ไม่มี

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

CompletableFuture<RealmsAvailability.Result> result = RealmsAvailability.get();

RealmsAvailability$Result

  • Full name: com.mojang.realmsclient.RealmsAvailability$Result
  • Package: com.mojang.realmsclient
  • Source: clientOnlycom/mojang/realmsclient/RealmsAvailability.java
  • Type: record
  • Modifiers: public

com.mojang.realmsclient.RealmsAvailability$Result#createErrorScreen(Screen)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsAvailability.java:77
  • Modifiers: public
  • Return: Screen

คืออะไร

สร้าง Error Screen

ทำงานยังไง

แยกกรณีด้วย switch. เรียกต่อ: translatable(), requireNonNull(). สร้างออบเจ็กต์: RealmsClientOutdatedScreen, RealmsParentalConsentScreen, RealmsGenericErrorScreen. คืนค่า: switch (this.type) { case SUCCESS -> null.

Parameters

  • Screen screen

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

RealmsAvailability.Result instance = ...;
Screen screen = ...;
Screen result = instance.createErrorScreen(screen);

com.mojang.realmsclient.RealmsAvailability$Result#Result(RealmsAvailability.Type)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsAvailability.java:69
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

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

Parameters

  • RealmsAvailability.Type type

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

RealmsAvailability.Type type = ...;
RealmsAvailability.Result instance = new RealmsAvailability.Result(type);

com.mojang.realmsclient.RealmsAvailability$Result#Result(RealmsServiceException)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsAvailability.java:73
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

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

Parameters

  • RealmsServiceException realmsServiceException

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

RealmsServiceException realmsServiceException = ...;
RealmsAvailability.Result instance = new RealmsAvailability.Result(realmsServiceException);

RealmsMainScreen

  • Full name: com.mojang.realmsclient.RealmsMainScreen
  • Package: com.mojang.realmsclient
  • Source: clientOnlycom/mojang/realmsclient/RealmsMainScreen.java
  • Type: class
  • Modifiers: public
  • Extends: RealmsScreen

com.mojang.realmsclient.RealmsMainScreen#getGameModeComponent(int,boolean)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:680
  • Modifiers: public static
  • Return: Component

คืออะไร

อ่านค่า Game Mode Component

ทำงานยังไง

เรียกต่อ: translatable(), withColor(), byId(), getLongDisplayName(). คืนค่า: (Component)(bl ? Component.translatable("gameMode.hardcore").withColor(-65536) : GameType.byId(i).getLongDisplayName()).

Parameters

  • int i
  • boolean bl

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

Component result = RealmsMainScreen.getGameModeComponent(0, true);

com.mojang.realmsclient.RealmsMainScreen#getNarrationMessage()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:552
  • Modifiers: public
  • Return: Component

คืออะไร

อ่านค่า Narration Message

ทำงานยังไง

แยกกรณีด้วย switch. เรียกต่อ: joinForNarration(). คืนค่า: (Component)(switch (this.activeLayoutState) { case LOADING -> CommonComponents.joinForNarration(new Component[]{super.getNarrationMessage(), LOADING_TEXT}).

Parameters

  • ไม่มี

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

RealmsMainScreen instance = ...;
Component result = instance.getNarrationMessage();

com.mojang.realmsclient.RealmsMainScreen#getVersionComponent(String,boolean)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:672
  • Modifiers: public static
  • Return: Component

คืออะไร

อ่านค่า Version Component

ทำงานยังไง

คืนค่า: getVersionComponent(string, bl ? -8355712 : -2142128).

Parameters

  • String string
  • boolean bl

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

Component result = RealmsMainScreen.getVersionComponent("value", true);

com.mojang.realmsclient.RealmsMainScreen#getVersionComponent(String,int)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:676
  • Modifiers: public static
  • Return: Component

คืออะไร

อ่านค่า Version Component

ทำงานยังไง

เรียกต่อ: isBlank(), literal(), withColor(). คืนค่า: (Component)(StringUtils.isBlank(string) ? CommonComponents.EMPTY : Component.literal(string).withColor(i)).

Parameters

  • String string
  • int i

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

Component result = RealmsMainScreen.getVersionComponent("value", 0);

com.mojang.realmsclient.RealmsMainScreen#init()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:173
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ init ตาม implementation ของ RealmsMainScreen

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: serverList, realmSelectionList, pendingInvitesButton, newsButton, playButton, configureButton. เรียกต่อ: RealmSelectionList(), translatable(), NotificationButton(), setScreen(), confirmLinkNow(), notificationCount(), readFile(), writeFile(). สร้างออบเจ็กต์: RealmsServerList, RealmsMainScreen.RealmSelectionList, RealmsMainScreen.NotificationButton, RealmsPendingInvitesScreen.

Parameters

  • ไม่มี

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

RealmsMainScreen instance = ...;
instance.init();

com.mojang.realmsclient.RealmsMainScreen#isSnapshot()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:224
  • Modifiers: public static
  • Return: boolean

คืออะไร

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

ทำงานยังไง

คืนค่า: SNAPSHOT && snapshotToggle.

Parameters

  • ไม่มี

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

boolean result = RealmsMainScreen.isSnapshot();

com.mojang.realmsclient.RealmsMainScreen#onClose()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:236
  • Modifiers: public
  • Return: void

คืออะไร

จัดการเหตุการณ์ Close

ทำงานยังไง

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

Parameters

  • ไม่มี

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

RealmsMainScreen instance = ...;
instance.onClose();

com.mojang.realmsclient.RealmsMainScreen#play(RealmsServer,Screen)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:585
  • Modifiers: public static
  • Return: void

คืออะไร

ดำเนินการ play ตาม implementation ของ RealmsMainScreen

ทำงานยังไง

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

Parameters

  • RealmsServer realmsServer
  • Screen screen

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

RealmsServer realmsServer = ...;
Screen screen = ...;
RealmsMainScreen.play(realmsServer, screen);

com.mojang.realmsclient.RealmsMainScreen#play(RealmsServer,Screen,boolean)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:589
  • Modifiers: public static
  • Return: void

คืออะไร

ดำเนินการ play ตาม implementation ของ RealmsMainScreen

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch. เรียกต่อ: isSnapshot(), isMinigameActive(), getInstance(), setScreen(), confirmToPlay(), translatable(), withColor(), literal(). สร้างออบเจ็กต์: RealmsLongRunningMcoTaskScreen, GetServerDetailsTask, PopupScreen.Builder.

Parameters

  • RealmsServer realmsServer
  • Screen screen
  • boolean bl

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

RealmsServer realmsServer = ...;
Screen screen = ...;
RealmsMainScreen.play(realmsServer, screen, true);

com.mojang.realmsclient.RealmsMainScreen#RealmsMainScreen(Screen)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:167
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: lastScreen, inviteNarrationLimiter. เรียกต่อ: create().

Parameters

  • Screen screen

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

Screen screen = ...;
RealmsMainScreen instance = new RealmsMainScreen(screen);

com.mojang.realmsclient.RealmsMainScreen#refreshPendingInvites()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:358
  • Modifiers: public static
  • Return: void

คืออะไร

ดำเนินการ refreshPendingInvites ตาม implementation ของ RealmsMainScreen

ทำงานยังไง

เรียกต่อ: getInstance(), realmsDataFetcher(), reset().

Parameters

  • ไม่มี

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

RealmsMainScreen.refreshPendingInvites();

com.mojang.realmsclient.RealmsMainScreen#refreshServerList()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:362
  • Modifiers: public static
  • Return: void

คืออะไร

ดำเนินการ refreshServerList ตาม implementation ของ RealmsMainScreen

ทำงานยังไง

เรียกต่อ: getInstance(), realmsDataFetcher(), reset().

Parameters

  • ไม่มี

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

RealmsMainScreen.refreshServerList();

com.mojang.realmsclient.RealmsMainScreen#render(GuiGraphics,int,int,float)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:561
  • Modifiers: public
  • Return: void

คืออะไร

เรนเดอร์ render

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch. เรียกต่อ: isSnapshot(), drawString(), getCurrentVersion(), getName(), renderDiamond(), renderEnvironment().

Parameters

  • GuiGraphics guiGraphics
  • int i
  • int j
  • float f

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

RealmsMainScreen instance = ...;
GuiGraphics guiGraphics = ...;
instance.render(guiGraphics, 0, 0, 0.0F);

com.mojang.realmsclient.RealmsMainScreen#repositionElements()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:228
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ repositionElements ตาม implementation ของ RealmsMainScreen

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: updateSize(), arrangeElements().

Parameters

  • ไม่มี

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

@Override
protected void repositionElements() {
    super.repositionElements();
}

com.mojang.realmsclient.RealmsMainScreen#resetScreen()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:547
  • Modifiers: public
  • Return: void

คืออะไร

รีเซ็ต Screen

ทำงานยังไง

เรียกต่อ: setSelected(), refreshServerList().

Parameters

  • ไม่มี

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

RealmsMainScreen instance = ...;
instance.resetScreen();

com.mojang.realmsclient.RealmsMainScreen#tick()

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/RealmsMainScreen.java:350
  • Modifiers: public
  • Return: void

คืออะไร

ประมวลผล tick tick

ทำงานยังไง

ตรวจเงื่อนไขด้วย if.

Parameters

  • ไม่มี

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

RealmsMainScreen instance = ...;
instance.tick();

Unit

  • Full name: com.mojang.realmsclient.Unit
  • Package: com.mojang.realmsclient
  • Source: clientOnlycom/mojang/realmsclient/Unit.java
  • Type: enum
  • Modifiers: public

com.mojang.realmsclient.Unit#convertTo(long,Unit)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/Unit.java:30
  • Modifiers: public static
  • Return: double

คืออะไร

แปลง To

ทำงานยังไง

เรียกต่อ: pow(), ordinal(). คืนค่า: unit == B ? l : l / Math.pow(1024.0, unit.ordinal()).

Parameters

  • long l
  • Unit unit

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

Unit unit = ...;
double result = Unit.convertTo(0L, unit);

com.mojang.realmsclient.Unit#getLargest(long)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/Unit.java:16
  • Modifiers: public static
  • Return: Unit

คืออะไร

อ่านค่า Largest

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการจัดการ exception. เรียกต่อ: log(), valueOf(), charAt(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • long l

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

Unit result = Unit.getLargest(0L);

com.mojang.realmsclient.Unit#humanReadable(long)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/Unit.java:34
  • Modifiers: public static
  • Return: String

คืออะไร

ดำเนินการ humanReadable ตาม implementation ของ Unit

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: log(), charAt(), format(), pow(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • long l

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

String result = Unit.humanReadable(0L);

com.mojang.realmsclient.Unit#humanReadable(long,Unit)

  • Origin: clientOnly
  • Source: com/mojang/realmsclient/Unit.java:45
  • Modifiers: public static
  • Return: String

คืออะไร

ดำเนินการ humanReadable ตาม implementation ของ Unit

ทำงานยังไง

เรียกต่อ: format(), convertTo(), name(). คืนค่า: String.format(Locale.ROOT, "%." + (unit == GB ? "1" : "0") + "f %s", convertTo(l, unit), unit.name()).

Parameters

  • long l
  • Unit unit

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

Unit unit = ...;
String result = Unit.humanReadable(0L, unit);