mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-11-14 19:34:58 -05:00
Fix potential IndexOutOfBounds error with BlockDestructionPacket
This commit is contained in:
parent
bcd83c673a
commit
69709912fe
1 changed files with 1 additions and 3 deletions
|
@ -1,7 +1,5 @@
|
|||
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.level;
|
||||
|
||||
import com.github.steveice10.mc.protocol.data.MagicValues;
|
||||
import com.github.steveice10.mc.protocol.data.UnmappedValueException;
|
||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
|
||||
import com.github.steveice10.mc.protocol.data.game.entity.player.BlockBreakStage;
|
||||
import com.github.steveice10.packetlib.io.NetInput;
|
||||
|
@ -26,7 +24,7 @@ public class ClientboundBlockDestructionPacket implements Packet {
|
|||
this.breakerEntityId = in.readVarInt();
|
||||
this.position = Position.read(in);
|
||||
int stage = in.readUnsignedByte();
|
||||
if (stage >= 0 && stage <= 10) {
|
||||
if (stage >= 0 && stage < 10) {
|
||||
this.stage = BlockBreakStage.STAGES[stage];
|
||||
} else {
|
||||
this.stage = BlockBreakStage.RESET;
|
||||
|
|
Loading…
Reference in a new issue