Bump squirrelid to 0.3.0, Deprecated PaperProfileServer (replaced by squirrelid)

This commit is contained in:
JOO200 2021-06-13 21:38:40 +02:00 committed by wizjany
parent 093e282e13
commit 621c1289b3
6 changed files with 22 additions and 16 deletions

View File

@ -35,7 +35,7 @@ fun Project.applyLibrariesConfiguration() {
group = "${rootProject.group}.worldguard-libs"
val relocations = mapOf(
"com.sk89q.squirrelid" to "com.sk89q.worldguard.util.profile"
"org.enginehub.squirrelid" to "com.sk89q.worldguard.util.profile"
)
tasks.register<ShadowJar>("jar") {

View File

@ -98,7 +98,7 @@ fun Project.applyShadowConfiguration() {
relocate("org.flywaydb", "com.sk89q.worldguard.internal.flywaydb") {
include(dependency("org.flywaydb:flyway-core:3.0"))
}
relocate("com.sk89q.squirrelid", "com.sk89q.worldguard.util.profile")
relocate("org.enginehub.squirrelid", "com.sk89q.worldguard.util.profile")
exclude("com.google.code.findbugs:jsr305")
}
exclude("GradleStart**")

View File

@ -3,7 +3,7 @@ object Versions {
// const val AUTO_VALUE = "1.6.5"
const val WORLDEDIT = "7.2.6-SNAPSHOT"
const val JUNIT = "5.7.0"
const val SQUIRRELID = "0.2.0"
const val SQUIRRELID = "0.3.0"
const val GUAVA = "21.0"
const val MOCKITO = "3.7.7"
}

View File

@ -31,7 +31,7 @@ import com.sk89q.worldguard.LocalPlayer;
import com.sk89q.worldguard.WorldGuard;
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import com.sk89q.worldguard.util.profile.resolver.PaperProfileService;
import com.sk89q.worldguard.util.profile.resolver.PaperPlayerService;
import com.sk89q.worldguard.bukkit.protection.events.flags.FlagContextCreateEvent;
import com.sk89q.worldguard.bukkit.session.BukkitSessionManager;
import com.sk89q.worldguard.bukkit.util.report.PerformanceReport;
@ -251,7 +251,7 @@ public class BukkitWorldGuardPlatform implements WorldGuardPlatform {
List<ProfileService> services = new ArrayList<>();
if (PaperLib.isPaper()) {
// Paper has a shared cache
services.add(PaperProfileService.getInstance());
services.add(PaperPlayerService.getInstance());
} else {
services.add(BukkitPlayerService.getInstance());
}

View File

@ -19,14 +19,19 @@
package com.sk89q.worldguard.util.profile.resolver;
//import com.destroystokyo.paper.profile.PlayerProfile;
import com.sk89q.worldguard.util.profile.Profile;
import io.papermc.lib.PaperLib;
import org.bukkit.Bukkit;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.UUID;
/**
* @deprecated Use {@link com.sk89q.worldguard.util.profile.resolver.PaperPlayerService} instead
*/
@Deprecated(forRemoval = true)
public final class PaperProfileService extends SingleRequestService {
private static final PaperPlayerService SUPER = PaperPlayerService.getInstance();
private static final PaperProfileService INSTANCE = new PaperProfileService();
private PaperProfileService() {
@ -37,18 +42,19 @@ public final class PaperProfileService extends SingleRequestService {
@Override
public int getIdealRequestLimit() {
return Integer.MAX_VALUE;
return SUPER.getIdealRequestLimit();
}
@Override
@Nullable
public Profile findByName(String name) {
/* PlayerProfile profile = Bukkit.createProfile(name);
if (profile.completeFromCache()) {
//noinspection ConstantConditions - completeFromCache guarantees non-null on success
return new Profile(profile.getId(), profile.getName());
}*/
return null;
public Profile findByName(String name) throws IOException, InterruptedException {
return SUPER.findByName(name);
}
@Nullable
@Override
public Profile findByUuid(UUID uuid) throws IOException, InterruptedException {
return SUPER.findByUuid(uuid);
}
public static PaperProfileService getInstance() {

View File

@ -1,6 +1,6 @@
applyLibrariesConfiguration()
dependencies {
"shade"("com.sk89q:squirrelid:${Versions.SQUIRRELID}")
"shade"("org.enginehub:squirrelid:${Versions.SQUIRRELID}")
"shade"("org.khelekore:prtree:1.5.0")
}