Skip to content

Commit

Permalink
Fix tests. Revert Paper-specific code.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Nov 23, 2024
1 parent 1fe87fe commit 14dee15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
24 changes: 5 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/world/bentobox/boxed/AdvancementsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,9 @@ public int getScore(Advancement a) {
}
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;
}
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/world/bentobox/boxed/mocks/ServerMocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

public final class ServerMocks {

@SuppressWarnings({ "deprecation", "unchecked" })
public static @NonNull Server newServer() {
Server mock = mock(Server.class);

Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit 14dee15

Please sign in to comment.