Skip to content

Package net.minecraft.client.multiplayer.prediction

Part 1/1


BlockStatePredictionHandler

  • Full name: net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler
  • Package: net.minecraft.client.multiplayer.prediction
  • Source: clientOnlynet/minecraft/client/multiplayer/prediction/BlockStatePredictionHandler.java
  • Type: class
  • Modifiers: public
  • Implements: AutoCloseable

net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler#close()

  • Origin: clientOnly
  • Source: net/minecraft/client/multiplayer/prediction/BlockStatePredictionHandler.java:60
  • Modifiers: public
  • Return: void

คืออะไร

ปิด close

ทำงานยังไง

แก้ state: isPredicting.

Parameters

  • ไม่มี

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

BlockStatePredictionHandler instance = ...;
instance.close();

net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler#currentSequence()

  • Origin: clientOnly
  • Source: net/minecraft/client/multiplayer/prediction/BlockStatePredictionHandler.java:65
  • Modifiers: public
  • Return: int

คืออะไร

ดำเนินการ currentSequence ตาม implementation ของ BlockStatePredictionHandler

ทำงานยังไง

คืนค่า: this.currentSequenceNr.

Parameters

  • ไม่มี

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

BlockStatePredictionHandler instance = ...;
int result = instance.currentSequence();

net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler#endPredictionsUpTo(int,ClientLevel)

  • Origin: clientOnly
  • Source: net/minecraft/client/multiplayer/prediction/BlockStatePredictionHandler.java:40
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ endPredictionsUpTo ตาม implementation ของ BlockStatePredictionHandler

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: long2ObjectEntrySet(), iterator(), hasNext(), next(), getValue(), of(), getLongKey(), remove().

Parameters

  • int i
  • ClientLevel clientLevel

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

BlockStatePredictionHandler instance = ...;
ClientLevel clientLevel = ...;
instance.endPredictionsUpTo(0, clientLevel);

net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler#isPredicting()

  • Origin: clientOnly
  • Source: net/minecraft/client/multiplayer/prediction/BlockStatePredictionHandler.java:69
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

คืนค่า: this.isPredicting.

Parameters

  • ไม่มี

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

BlockStatePredictionHandler instance = ...;
boolean result = instance.isPredicting();

net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler#retainKnownServerState(BlockPos,BlockState,LocalPlayer)

  • Origin: clientOnly
  • Source: net/minecraft/client/multiplayer/prediction/BlockStatePredictionHandler.java:20
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ retainKnownServerState ตาม implementation ของ BlockStatePredictionHandler

ทำงานยังไง

เรียกต่อ: compute(), asLong(), setSequence(), ServerVerifiedState(), position(). สร้างออบเจ็กต์: BlockStatePredictionHandler.ServerVerifiedState.

Parameters

  • BlockPos blockPos
  • BlockState blockState
  • LocalPlayer localPlayer

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

BlockStatePredictionHandler instance = ...;
BlockPos blockPos = ...;
BlockState blockState = ...;
LocalPlayer localPlayer = ...;
instance.retainKnownServerState(blockPos, blockState, localPlayer);

net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler#startPredicting()

  • Origin: clientOnly
  • Source: net/minecraft/client/multiplayer/prediction/BlockStatePredictionHandler.java:54
  • Modifiers: public
  • Return: BlockStatePredictionHandler

คืออะไร

เริ่ม Predicting

ทำงานยังไง

แก้ state: currentSequenceNr, isPredicting. คืนค่า: this.

Parameters

  • ไม่มี

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

BlockStatePredictionHandler instance = ...;
BlockStatePredictionHandler result = instance.startPredicting();

net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler#updateKnownServerState(BlockPos,BlockState)

  • Origin: clientOnly
  • Source: net/minecraft/client/multiplayer/prediction/BlockStatePredictionHandler.java:30
  • Modifiers: public
  • Return: boolean

คืออะไร

อัปเดต Known Server State

ทำงานยังไง

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

Parameters

  • BlockPos blockPos
  • BlockState blockState

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

BlockStatePredictionHandler instance = ...;
BlockPos blockPos = ...;
BlockState blockState = ...;
boolean result = instance.updateKnownServerState(blockPos, blockState);

PredictiveAction

  • Full name: net.minecraft.client.multiplayer.prediction.PredictiveAction
  • Package: net.minecraft.client.multiplayer.prediction
  • Source: clientOnlynet/minecraft/client/multiplayer/prediction/PredictiveAction.java
  • Type: interface
  • Modifiers: public

net.minecraft.client.multiplayer.prediction.PredictiveAction#predict(int)

  • Origin: clientOnly
  • Source: net/minecraft/client/multiplayer/prediction/PredictiveAction.java:11
  • Modifiers: ``
  • Return: Packet<ServerGamePacketListener>

คืออะไร

ดำเนินการ predict ตาม implementation ของ PredictiveAction

ทำงานยังไง

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

Parameters

  • int i

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

PredictiveAction instance = ...;
Packet<ServerGamePacketListener> result = instance.predict(0);