Hotfix for checking for Velocity proxy when using Paper.

This commit is contained in:
Aust1n46 2021-08-30 15:10:53 -04:00
parent f96a305085
commit 21c72bdb44
2 changed files with 25 additions and 10 deletions

12
pom.xml
View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>mineverse.Aust1n46.chat</groupId> <groupId>mineverse.Aust1n46.chat</groupId>
<artifactId>VentureChat</artifactId> <artifactId>VentureChat</artifactId>
<version>3.1.2</version> <version>3.1.3</version>
<url>https://bitbucket.org/Aust1n46/venturechat/src/master</url> <url>https://bitbucket.org/Aust1n46/venturechat/src/master</url>
<scm> <scm>
<url>https://bitbucket.org/Aust1n46/venturechat/src/master</url> <url>https://bitbucket.org/Aust1n46/venturechat/src/master</url>
@ -115,8 +115,18 @@
<id>velocity</id> <id>velocity</id>
<url>https://repo.velocitypowered.com/snapshots/</url> <url>https://repo.velocitypowered.com/snapshots/</url>
</repository> </repository>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>com.zaxxer</groupId> <groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId> <artifactId>HikariCP</artifactId>

View File

@ -85,15 +85,20 @@ public class LoginListener implements Listener {
mcp.addListening(ch.getName()); mcp.addListening(ch.getName());
} }
} }
if(plugin.getServer().spigot().getConfig().getBoolean("settings.bungeecord")) { try {
long delayInTicks = 20L; if(plugin.getServer().spigot().getPaperConfig().getBoolean("settings.velocity-support.enabled") || plugin.getServer().spigot().getConfig().getBoolean("settings.bungeecord")) {
final MineverseChatPlayer sync = mcp; long delayInTicks = 20L;
plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() { final MineverseChatPlayer sync = mcp;
public void run() { plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
MineverseChat.synchronize(sync, false); public void run() {
} MineverseChat.synchronize(sync, false);
}, delayInTicks); }
}, delayInTicks);
}
}
catch(NoSuchMethodError exception) { // Thrown if server isn't Paper.
// Do nothing
} }
} }
} }