Skip to content
This repository was archived by the owner on Feb 19, 2024. It is now read-only.

Commit 68971d7

Browse files
author
BuildTools
committed
Updated GitHub repository. Fixed NoSuchElementException on Forge client connection. Added permission to plugin.yml. Added new client type for Forge Modern. Changed plugin version to 2.5.9.
1 parent 216e364 commit 68971d7

6 files changed

Lines changed: 32 additions & 10 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>de.sportkanone123</groupId>
88
<artifactId>ClientDetector</artifactId>
9-
<version>2.5.8</version>
9+
<version>2.5.9</version>
1010

1111
<properties>
1212
<maven.compiler.source>8</maven.compiler.source>

src/main/java/de/sportkanone123/clientdetector/spigot/forgemod/newerversion/ForgeHandler.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ public class ForgeHandler {
4949
public static void handle(PacketLoginReceiveEvent event){
5050
if(ConfigManager.getConfig("config").getBoolean("forge.enableNewerVersionDetection")){
5151
if(event.getPacketType() == PacketType.Login.Client.LOGIN_START ) {
52-
if(ConfigManager.getConfig("config").getBoolean("forge.simulateForgeHandshake") && PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_1_13) && !ClientDetector.forgeMods.containsKey(new WrapperLoginClientLoginStart(event).getPlayerUUID().get()) && !ConfigManager.getConfig("config").getBoolean("velocity.enableVelocitySupport")) {
53-
ForgeHandshake.sendModList(event.getChannel());
54-
channelToName.put(event.getChannel(), new WrapperLoginClientLoginStart(event).getUsername());
52+
if(ConfigManager.getConfig("config").getBoolean("forge.simulateForgeHandshake") && PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_1_13)) {
53+
if (!ClientDetector.forgeMods.containsKey(event.getUser().getUUID()) && !ConfigManager.getConfig("config").getBoolean("velocity.enableVelocitySupport")) {
54+
ForgeHandshake.sendModList(event.getChannel());
55+
channelToName.put(event.getChannel(), new WrapperLoginClientLoginStart(event).getUsername());
56+
}
5557
}
56-
5758
}else if(event.getPacketType() == PacketType.Login.Client.LOGIN_PLUGIN_RESPONSE) {
5859
if(!ConfigManager.getConfig("config").getBoolean("velocity.enableVelocitySupport"))
5960
event.setCancelled(true);

src/main/java/de/sportkanone123/clientdetector/spigot/manager/ClientManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public static void load(){
4040
Tested
4141
*/
4242
ClientDetector.CLIENTS.add(new Client(Arrays.asList("FML|HS", "l:fmlhs"), "", "Forge", true, false, null, null));
43+
ClientDetector.CLIENTS.add(new Client("fml:handshake", "", "Forge Modern", true, false, null, null));
4344
ClientDetector.CLIENTS.add(new Client(Arrays.asList("5zig_Set", "l:5zig_set"), "", "5zig Mod", true, false, null, null));
4445
ClientDetector.CLIENTS.add(new Client(Arrays.asList("LABYMOD", "LMC", "labymod3:main"), "", "LabyMod", true, false, null, null));
4546
ClientDetector.CLIENTS.add(new Client("vanilla", "vanilla", "Aristois (Experimental)", false, false, null, null));

src/main/java/de/sportkanone123/clientdetector/velocity/ClientDetectorVelocity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@com.velocitypowered.api.plugin.Plugin(
2424
id = "clientdetector",
2525
name = "ClientDetector",
26-
version = "2.5.8",
26+
version = "2.5.9",
2727
description = "A simple plugin to detect and manage a player's client/mods",
2828
authors = {"Sportkanone123", "Loving11ish"}
2929
)

src/main/resources/bungee.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: ClientDetector
2-
version: 2.5.8
2+
version: '${project.version}'
33
author: Loving11ish
44
main: de.sportkanone123.clientdetector.bungeecord.ClientDetectorBungee
55
description: A simple plugin to detect and manage a player's client/mods

src/main/resources/plugin.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: ClientDetector
2-
version: 2.5.8
2+
version: '${project.version}'
33
authors: [ Sportkanone123, Loving11ish ]
44
main: de.sportkanone123.clientdetector.spigot.ClientDetector
55
description: A simple plugin to detect and manage a player's client/mods
@@ -11,7 +11,27 @@ softdepend: [PlaceholderAPI, ProtocolLib, ViaVersion]
1111

1212
commands:
1313
clientdetector:
14-
aliases: cd
14+
description: The main command that accesses all other commands for the plugin.
15+
permission: clientdetector.command
16+
aliases:
17+
- cd
1518
client:
19+
description: The command to access the client based commands.
20+
permission: clientdetector.command
1621
forge:
17-
mods:
22+
description: The command to access the Forge based commands.
23+
permission: clientdetector.command
24+
mods:
25+
description: The command to access the mods based commands.
26+
permission: clientdetector.command
27+
28+
permissions:
29+
clientdetector.*:
30+
default: op
31+
children:
32+
clientdetector.command:
33+
default: op
34+
clientdetector.bypass:
35+
default: op
36+
clientdetector.notify:
37+
default: op

0 commit comments

Comments
 (0)