From 314af6d000db584916594ee83b27c8477f78538d Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Tue, 3 Jul 2018 11:26:00 -0300 Subject: [PATCH] Brackets. --- .../ViaVersion/api/protocol/ProtocolPipeline.java | 6 ++++-- .../ViaVersion/api/protocol/ProtocolRegistry.java | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java index 1ec75ba67..f89881bab 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java +++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java @@ -58,9 +58,11 @@ public class ProtocolPipeline extends Protocol { protocol.init(userConnection); // Move base Protocols to the end, so the login packets can be modified by other protocols List toMove = new ArrayList<>(); - for (Protocol p : protocolList) - if (ProtocolRegistry.isBaseProtocol(p)) + for (Protocol p : protocolList) { + if (ProtocolRegistry.isBaseProtocol(p)) { toMove.add(p); + } + } protocolList.removeAll(toMove); protocolList.addAll(toMove); } else { diff --git a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java index 3ba69210a..4e0883eae 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java +++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java @@ -225,16 +225,20 @@ public class ProtocolRegistry { } public static Protocol getBaseProtocol(int serverVersion) { - for (Pair, Protocol> rangeProtocol : Lists.reverse(baseProtocols)) - if (rangeProtocol.getKey().contains(serverVersion)) + for (Pair, Protocol> rangeProtocol : Lists.reverse(baseProtocols)) { + if (rangeProtocol.getKey().contains(serverVersion)) { return rangeProtocol.getValue(); + } + } throw new IllegalStateException("No Base Protocol for " + serverVersion); } public static boolean isBaseProtocol(Protocol protocol) { - for (Pair, Protocol> p : baseProtocols) - if (p.getValue() == protocol) + for (Pair, Protocol> p : baseProtocols) { + if (p.getValue() == protocol) { return true; + } + } return false; }