Multipaper support

This commit is contained in:
HaHaWTH 2024-03-29 13:10:18 +08:00
parent 342d9c96ee
commit bf6de0e161
3 changed files with 25 additions and 2 deletions

18
pom.xml
View File

@ -395,6 +395,10 @@
<pattern>com.github.benmanes.caffeine</pattern>
<shadedPattern>fr.xephi.authme.libs.com.github.benmanes.caffeine</shadedPattern>
</relocation>
<relocation>
<pattern>com.github.puregero.multilib</pattern>
<shadedPattern>fr.xephi.authme.libs.com.github.puregero.multilib</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
@ -625,6 +629,12 @@
</snapshots>
</repository>
<!-- MultiLib -->
<repository>
<id>clojars</id>
<url>https://repo.clojars.org</url>
</repository>
<!-- ProtocolLib Repo -->
<repository>
<id>dmulloy2-repo-releases</id>
@ -1172,6 +1182,14 @@
<scope>compile</scope>
</dependency>
<!-- MultiLib -->
<dependency>
<groupId>com.github.puregero</groupId>
<artifactId>multilib</artifactId>
<version>1.1.13</version>
<scope>compile</scope>
</dependency>
<!-- JDBC drivers for datasource integration tests -->
<dependency>
<groupId>org.xerial</groupId>

View File

@ -29,7 +29,7 @@ import static fr.xephi.authme.datasource.SqlDataSourceUtils.logSqlException;
/**
* H2 data source.
*/
@SuppressWarnings({"checkstyle:AbbreviationAsWordInName"}) // Justification: Class name cannot be changed anymore
@SuppressWarnings({"all"}) // Justification: Class name cannot be changed anymore
public class H2 extends AbstractSqlDataSource {
private final ConsoleLogger logger = ConsoleLoggerFactory.get(H2.class);

View File

@ -1,5 +1,6 @@
package fr.xephi.authme.listener;
import com.github.puregero.multilib.MultiLib;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.api.v3.AuthMeApi;
import fr.xephi.authme.data.auth.PlayerCache;
@ -81,7 +82,11 @@ class ListenerService implements SettingsDependent {
*/
public boolean shouldCancelEvent(Player player) {
if (MultiLib.isMultiPaper()) {
if (MultiLib.isExternalPlayer(player)) {
return false;
}
}
return player != null && !checkAuth(player.getName()) && !PlayerUtils.isNpc(player);
}
public boolean shouldCancelInvEvent(Player player) {