Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2025-01-11 15:41:01 +01:00
Blocked versions now included when server sends supported versions, javadoc fixes & simple colour for blocked-msg.
Dieser Commit ist enthalten in:
Ursprung
17f3d13267
Commit
70d91b4f87
@ -450,7 +450,10 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
|
||||
|
||||
@Override
|
||||
public SortedSet<Integer> getSupportedVersions() {
|
||||
return ProtocolRegistry.getSupportedVersions();
|
||||
SortedSet<Integer> outputSet = new TreeSet<>(ProtocolRegistry.getSupportedVersions());
|
||||
outputSet.removeAll(getConf().getBlockedProtocols());
|
||||
|
||||
return outputSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,6 +6,7 @@ import us.myles.ViaVersion.api.boss.BossBar;
|
||||
import us.myles.ViaVersion.api.boss.BossColor;
|
||||
import us.myles.ViaVersion.api.boss.BossStyle;
|
||||
import us.myles.ViaVersion.api.command.ViaVersionCommand;
|
||||
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
|
||||
|
||||
import java.util.SortedSet;
|
||||
import java.util.UUID;
|
||||
@ -114,6 +115,8 @@ public interface ViaVersionAPI {
|
||||
|
||||
/**
|
||||
* Get the supported protocol versions
|
||||
* This method removes any blocked protocol versions.
|
||||
* @see ProtocolRegistry#getSupportedVersions() for full list.
|
||||
*
|
||||
* @return a list of protocol versions
|
||||
*/
|
||||
|
@ -79,6 +79,11 @@ public class ProtocolRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the versions compatible with the server.
|
||||
*
|
||||
* @return Read-only set of the versions.
|
||||
*/
|
||||
public static SortedSet<Integer> getSupportedVersions() {
|
||||
return Collections.unmodifiableSortedSet(new TreeSet<>(supportedVersions));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package us.myles.ViaVersion.protocols.base;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -171,7 +172,7 @@ public class BaseProtocol extends Protocol {
|
||||
if (!wrapper.user().getChannel().isOpen()) return;
|
||||
|
||||
PacketWrapper disconnectPacket = new PacketWrapper(0x00, null, wrapper.user()); // Disconnect Packet
|
||||
Protocol1_9TO1_8.FIX_JSON.write(disconnectPacket, ViaVersion.getConfig().getBlockedDisconnectMsg());
|
||||
Protocol1_9TO1_8.FIX_JSON.write(disconnectPacket, ChatColor.translateAlternateColorCodes('&', ViaVersion.getConfig().getBlockedDisconnectMsg()));
|
||||
disconnectPacket.send(BaseProtocol.class);
|
||||
|
||||
wrapper.cancel();
|
||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren