3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-09 01:30:13 +01:00

Spring cleaning & make /viaver pps say when no players.

Dieser Commit ist enthalten in:
Myles 2016-06-19 22:36:15 +01:00
Ursprung 44e8056fb3
Commit 6740c5c6dc
8 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -3,7 +3,6 @@ package us.myles.ViaVersion.api;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import lombok.Data;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;

Datei anzeigen

@ -6,5 +6,6 @@ import us.myles.ViaVersion.api.data.UserConnection;
public interface HandlerConstructor { public interface HandlerConstructor {
public MessageToByteEncoder newEncodeHandler(UserConnection info, MessageToByteEncoder minecraftEncoder); public MessageToByteEncoder newEncodeHandler(UserConnection info, MessageToByteEncoder minecraftEncoder);
public ByteToMessageDecoder newDecodeHandler(UserConnection info, ByteToMessageDecoder minecraftDecoder); public ByteToMessageDecoder newDecodeHandler(UserConnection info, ByteToMessageDecoder minecraftDecoder);
} }

Datei anzeigen

@ -56,6 +56,9 @@ public class PPSSubCmd extends ViaSubCommand {
sendMessage(sender, "&cAverage: &f" + (totalPackets / clients)); sendMessage(sender, "&cAverage: &f" + (totalPackets / clients));
sendMessage(sender, "&cHighest: &f" + max); sendMessage(sender, "&cHighest: &f" + max);
} }
if (clients == 0) {
sendMessage(sender, "&cNo clients to display.");
}
for (Map.Entry<Integer, Set<String>> entry : sorted.entrySet()) for (Map.Entry<Integer, Set<String>> entry : sorted.entrySet())
sendMessage(sender, "&8[&6%s&8]: &b%s", ProtocolVersion.getProtocol(entry.getKey()).getName(), entry.getValue()); sendMessage(sender, "&8[&6%s&8]: &b%s", ProtocolVersion.getProtocol(entry.getKey()).getName(), entry.getValue());
sorted.clear(); sorted.clear();

Datei anzeigen

@ -38,7 +38,7 @@ public class ViaDecodeHandler extends ByteToMessageDecoder {
// Increment received // Increment received
boolean second = info.incrementReceived(); boolean second = info.incrementReceived();
// Check PPS // Check PPS
if(second) { if (second) {
if (((ViaVersionPlugin) ViaVersion.getInstance()).handlePPS(info)) if (((ViaVersionPlugin) ViaVersion.getInstance()).handlePPS(info))
return; return;
} }

Datei anzeigen

@ -10,8 +10,8 @@ import us.myles.ViaVersion.api.remapper.ValueTransformer;
import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.packets.State; import us.myles.ViaVersion.packets.State;
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.storage.ResourcePackTracker; import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.storage.ResourcePackTracker;
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.types.MetaList1_10Type;
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.types.Meta1_10Type; import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.types.Meta1_10Type;
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.types.MetaList1_10Type;
import java.util.List; import java.util.List;

Datei anzeigen

@ -63,7 +63,7 @@ public class BlockEntity {
updateSign(pos, lines, connection); updateSign(pos, lines, connection);
} }
} catch (Exception e) { } catch (Exception e) {
if(ViaVersion.getInstance().isDebug()) { if (ViaVersion.getInstance().isDebug()) {
System.out.println("Block Entity: " + e.getMessage() + ": " + tag); System.out.println("Block Entity: " + e.getMessage() + ": " + tag);
} }
} }

Datei anzeigen

@ -12,8 +12,6 @@ import us.myles.ViaVersion.api.remapper.ValueCreator;
import us.myles.ViaVersion.api.remapper.ValueTransformer; import us.myles.ViaVersion.api.remapper.ValueTransformer;
import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.packets.State; import us.myles.ViaVersion.packets.State;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.Protocol1_10To1_9_3_4;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter; import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8; import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.metadata.MetadataRewriter; import us.myles.ViaVersion.protocols.protocol1_9to1_8.metadata.MetadataRewriter;