-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CorrectPlayerMovePredictionPacket (#258)
- Loading branch information
Showing
5 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...mc/protocol/bedrock/codec/v712/serializer/CorrectPlayerMovePredictionSerializer_v712.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.cloudburstmc.protocol.bedrock.codec.v712.serializer; | ||
|
||
import io.netty.buffer.ByteBuf; | ||
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodecHelper; | ||
import org.cloudburstmc.protocol.bedrock.codec.v671.serializer.CorrectPlayerMovePredictionSerializer_v671; | ||
import org.cloudburstmc.protocol.bedrock.packet.CorrectPlayerMovePredictionPacket; | ||
|
||
public class CorrectPlayerMovePredictionSerializer_v712 extends CorrectPlayerMovePredictionSerializer_v671 { | ||
public static final CorrectPlayerMovePredictionSerializer_v712 INSTANCE = new CorrectPlayerMovePredictionSerializer_v712(); | ||
|
||
@Override | ||
protected void writeVehiclePrediction(ByteBuf buffer, BedrockCodecHelper helper, CorrectPlayerMovePredictionPacket packet) { | ||
super.writeVehiclePrediction(buffer, helper, packet); | ||
helper.writeOptionalNull(buffer, packet.getVehicleAngularVelocity(), ByteBuf::writeFloatLE); | ||
} | ||
|
||
@Override | ||
protected void readVehiclePrediction(ByteBuf buffer, BedrockCodecHelper helper, CorrectPlayerMovePredictionPacket packet) { | ||
super.readVehiclePrediction(buffer, helper, packet); | ||
packet.setVehicleAngularVelocity(helper.readOptional(buffer, null, ByteBuf::readFloatLE)); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/data/PredictionType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package org.cloudburstmc.protocol.bedrock.data; | ||
|
||
public enum PredictionType { | ||
VEHICLE, | ||
PLAYER | ||
PLAYER, | ||
VEHICLE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters