Skip to content

Commit

Permalink
Revert back code
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Jul 20, 2024
1 parent 1b5b1ae commit e5ef4ea
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.function.BiConsumer;
import java.util.function.Function;
Expand Down Expand Up @@ -906,7 +905,11 @@ private void writeBitSet(ByteBuf buf, BitSet bitSet) {

public LevelEvent readLevelEvent(ByteBuf buf) {
int id = buf.readInt();
return Objects.requireNonNullElseGet(LevelEventType.from(id), () -> new UnknownLevelEvent(id));
LevelEventType type = LevelEventType.from(id);
if (type != null) {
return type;
}
return new UnknownLevelEvent(id);
}

public void writeLevelEvent(ByteBuf buf, LevelEvent event) {
Expand Down

0 comments on commit e5ef4ea

Please sign in to comment.