patch: packetevents disables itself when running on an unsupported Minecraft version;
changing "packetevents 2.0 failed to inject" message;
This commit is contained in:
1 parent
1b5479f04f
commit
50c2a69449
6 files changed
+10
-9
No files matched your search
@@ -77,7 +77,7 @@ public class PlayerListMixin {
|
||||
if (!FakeChannelUtil.isFakeChannel(channelObj) &&
|
||||
(!api.isTerminated() || api.getSettings().isKickIfTerminated())) {
|
||||
// Kick the player if they're not a fake player
|
||||
player.connection.disconnect(Component.literal("PacketEvents 2.0 failed to inject"));
|
||||
player.connection.disconnect(Component.literal("PacketEvents failed to inject into a channel."));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -54,7 +54,7 @@ public class InternalBukkitListener implements Listener {
|
||||
if (!FakeChannelUtil.isFakeChannel(channel) && (!PacketEvents.getAPI().isTerminated() || PacketEvents.getAPI().getSettings().isKickIfTerminated())) {
|
||||
//Kick them, if they are not a fake player.
|
||||
FoliaScheduler.getEntityScheduler().runDelayed(player, plugin, (o) -> {
|
||||
player.kickPlayer("PacketEvents 2.0 failed to inject");
|
||||
player.kickPlayer("PacketEvents failed to inject into a channel.");
|
||||
}, null, 0);
|
||||
}
|
||||
return;
|
||||
@@ -76,7 +76,7 @@ public class InternalBukkitListener implements Listener {
|
||||
if (channel == null || !FakeChannelUtil.isFakeChannel(channel) && (!PacketEvents.getAPI().isTerminated() || PacketEvents.getAPI().getSettings().isKickIfTerminated())) {
|
||||
//Kick them, if they are not a fake player.
|
||||
FoliaScheduler.getEntityScheduler().runDelayed(player, plugin, (o) -> {
|
||||
player.kickPlayer("PacketEvents 2.0 failed to inject");
|
||||
player.kickPlayer("PacketEvents failed to inject into a channel.");
|
||||
}, null, 0);
|
||||
}
|
||||
// Set bukkit player object in the injectors
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public class SpigotChannelInjector implements ChannelInjector {
|
||||
try {
|
||||
ServerConnectionInitializer.initChannel(channel, ConnectionState.PLAY);
|
||||
} catch (Exception e) {
|
||||
PacketEvents.getAPI().getLogManager().severe("Spigot injector failed to inject into an existing channel.");
|
||||
PacketEvents.getAPI().getLogManager().severe("PacketEvents Spigot injector failed to inject into an existing channel. If you need assistance, join our Discord server: https://discord.gg/DVHxPPxHZc");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -45,8 +45,9 @@ public class ServerManagerImpl implements ServerManager {
|
||||
if (version.isNewerThan(latestVersion)) {
|
||||
//We do not support this version yet, so let us warn the user
|
||||
plugin.getLogger().warning("[packetevents] We currently do not support the Minecraft version "
|
||||
+ version + ", so things might break. PacketEvents will behave as if the Minecraft version were "
|
||||
+ latestVersion + "!");
|
||||
+ version + "! The latest Minecraft version supported by PacketEvents is " + latestVersion
|
||||
+ ". Please test the development builds, as they may already have support for your Minecraft version (hint: select the build that contains 'spigot'): https://ci.codemc.io/job/retrooper/job/packetevents/\nIf you're in need of any help, join our Discord server: https://discord.gg/DVHxPPxHZc");
|
||||
Bukkit.getPluginManager().disablePlugin(plugin);
|
||||
return ServerVersion.getLatest();
|
||||
}
|
||||
for (final ServerVersion val : ServerVersion.reversedValues()) {
|
||||
@@ -56,7 +57,7 @@ public class ServerManagerImpl implements ServerManager {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getLogger().warning("[packetevents] Your server software is preventing us from checking the Minecraft Server version. This is what we found: " + Bukkit.getBukkitVersion() + ". We will assume the Server version is " + fallbackVersion.name() + "...");
|
||||
plugin.getLogger().warning("[packetevents] Your server software is preventing us from checking the Minecraft Server version. This is what we found: " + Bukkit.getBukkitVersion() + ". We will assume the Server version is " + fallbackVersion.name() + "...\n If you need assistance, join our Discord server: https://discord.gg/DVHxPPxHZc");
|
||||
return fallbackVersion;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class InternalSpongeListener {
|
||||
// Check if it is a fake connection...
|
||||
if (!FakeChannelUtil.isFakeChannel(channel)) {
|
||||
// Kick them, if they are not a fake player.
|
||||
player.kick(Component.text("PacketEvents 2.0 failed to inject"));
|
||||
player.kick(Component.text("PacketEvents failed to inject into a channel."));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ public class SpongeChannelInjector implements ChannelInjector {
|
||||
try {
|
||||
ServerConnectionInitializer.initChannel(channel, ConnectionState.PLAY);
|
||||
} catch (Exception e) {
|
||||
PacketEvents.getAPI().getLogManager().severe("Sponge injector failed to inject into an existing channel.");
|
||||
PacketEvents.getAPI().getLogManager().severe("PacketEvents Sponge injector failed to inject into an existing channel. If you need assistance, join our Discord server: https://discord.gg/DVHxPPxHZc");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user