Class BlockStatePredictionHandler
java.lang.Object
net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private boolean
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap
<BlockStatePredictionHandler.ServerVerifiedState> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
void
endPredictionsUpTo
(int pSequence, ClientLevel pLevel) boolean
void
retainKnownServerState
(BlockPos pPos, BlockState pState, LocalPlayer pPlayer) void
retainSnapshot
(BlockPos pos, BlockSnapshot snapshot) Sets the stored BlockSnapshot on the ServerVerifiedState for the given position.boolean
updateKnownServerState
(BlockPos pPos, BlockState pState)
-
Field Details
-
serverVerifiedStates
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<BlockStatePredictionHandler.ServerVerifiedState> serverVerifiedStates -
currentSequenceNr
private int currentSequenceNr -
isPredicting
private boolean isPredicting
-
-
Constructor Details
-
BlockStatePredictionHandler
public BlockStatePredictionHandler()
-
-
Method Details
-
retainKnownServerState
-
updateKnownServerState
-
endPredictionsUpTo
-
startPredicting
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
currentSequence
public int currentSequence() -
isPredicting
public boolean isPredicting() -
retainSnapshot
Sets the stored BlockSnapshot on the ServerVerifiedState for the given position. This method is only called afterretainKnownServerState(net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, net.minecraft.client.player.LocalPlayer)
, so we are certain a map entry exists.
-