-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
34 additions
and
29 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
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
19 changes: 2 additions & 17 deletions
19
...cloudburstmc/protocol/bedrock/codec/v712/serializer/PlayerArmorDamageSerializer_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 |
---|---|---|
@@ -1,27 +1,12 @@ | ||
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.v407.serializer.PlayerArmorDamageSerializer_v407; | ||
import org.cloudburstmc.protocol.bedrock.data.PlayerArmorDamageFlag; | ||
import org.cloudburstmc.protocol.bedrock.packet.PlayerArmorDamagePacket; | ||
import org.cloudburstmc.protocol.common.util.VarInts; | ||
|
||
import java.util.Set; | ||
|
||
public class PlayerArmorDamageSerializer_v712 extends PlayerArmorDamageSerializer_v407 { | ||
public static final PlayerArmorDamageSerializer_v712 INSTANCE = new PlayerArmorDamageSerializer_v712(); | ||
|
||
@Override | ||
public void deserialize(ByteBuf buffer, BedrockCodecHelper helper, PlayerArmorDamagePacket packet) { | ||
int flagsVal = buffer.readUnsignedByte(); | ||
Set<PlayerArmorDamageFlag> flags = packet.getFlags(); | ||
int[] damage = packet.getDamage(); | ||
for (int i = 0; i < FLAGS.length; i++) { | ||
if ((flagsVal & (1 << i)) != 0) { | ||
flags.add(FLAGS[i]); | ||
damage[i] = VarInts.readInt(buffer); | ||
} | ||
} | ||
protected int getMaxFlagIndex() { | ||
return 4; | ||
} | ||
} |
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
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
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
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