Fix tests. Revert Paper-specific code.

This commit is contained in:
tastybento 2024-11-23 10:09:04 -08:00
parent 1fe87fedff
commit 14dee15258
3 changed files with 10 additions and 25 deletions

24
pom.xml
View File

@ -112,14 +112,14 @@
</profiles>
<repositories>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>bentoboxworld</id>
<url>https://repo.codemc.org/repository/bentoboxworld/</url>
@ -144,20 +144,6 @@
</repositories>
<dependencies>
<!-- Paper API -->
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>${paper.version}</version>
<scope>provided</scope>
</dependency>
<!-- PaperLib -->
<dependency>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
<version>1.0.6</version>
<scope>compile</scope>
</dependency>
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>

View File

@ -250,11 +250,9 @@ public class AdvancementsManager {
}
if (advConfig.getBoolean("settings.automatic-scoring")) {
if (!a.getKey().getKey().contains("recipes") && a.getDisplay() != null) {
int score = 1;
while (a.getParent() != null) {
score++;
}
return score;
float x = a.getDisplay().getX();
float y = a.getDisplay().getY();
return (int) Math.round(Math.sqrt(x * x + y * y));
} else {
return 0;
}

View File

@ -24,6 +24,7 @@ import org.eclipse.jdt.annotation.NonNull;
public final class ServerMocks {
@SuppressWarnings({ "deprecation", "unchecked" })
public static @NonNull Server newServer() {
Server mock = mock(Server.class);
@ -66,7 +67,7 @@ public final class ServerMocks {
doReturn(key).when(keyed).getKey();
return keyed;
});
}).when(registry).get(notNull());
}).when(registry).get((NamespacedKey) notNull());
return registry;
})).when(mock).getRegistry(notNull());