Skip to content

Commit 14dee15

Browse files
committed
Fix tests. Revert Paper-specific code.
1 parent 1fe87fe commit 14dee15

File tree

3 files changed

+10
-25
lines changed

3 files changed

+10
-25
lines changed

pom.xml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@
112112
</profiles>
113113

114114
<repositories>
115-
<repository>
116-
<id>papermc</id>
117-
<url>https://repo.papermc.io/repository/maven-public/</url>
118-
</repository>
119-
<repository>
115+
<repository>
120116
<id>spigot-repo</id>
121117
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
122118
</repository>
119+
<repository>
120+
<id>papermc</id>
121+
<url>https://repo.papermc.io/repository/maven-public/</url>
122+
</repository>
123123
<repository>
124124
<id>bentoboxworld</id>
125125
<url>https://repo.codemc.org/repository/bentoboxworld/</url>
@@ -144,20 +144,6 @@
144144
</repositories>
145145

146146
<dependencies>
147-
<!-- Paper API -->
148-
<dependency>
149-
<groupId>io.papermc.paper</groupId>
150-
<artifactId>paper-api</artifactId>
151-
<version>${paper.version}</version>
152-
<scope>provided</scope>
153-
</dependency>
154-
<!-- PaperLib -->
155-
<dependency>
156-
<groupId>io.papermc</groupId>
157-
<artifactId>paperlib</artifactId>
158-
<version>1.0.6</version>
159-
<scope>compile</scope>
160-
</dependency>
161147
<!-- Spigot API -->
162148
<dependency>
163149
<groupId>org.spigotmc</groupId>

src/main/java/world/bentobox/boxed/AdvancementsManager.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,9 @@ public int getScore(Advancement a) {
250250
}
251251
if (advConfig.getBoolean("settings.automatic-scoring")) {
252252
if (!a.getKey().getKey().contains("recipes") && a.getDisplay() != null) {
253-
int score = 1;
254-
while (a.getParent() != null) {
255-
score++;
256-
}
257-
return score;
253+
float x = a.getDisplay().getX();
254+
float y = a.getDisplay().getY();
255+
return (int) Math.round(Math.sqrt(x * x + y * y));
258256
} else {
259257
return 0;
260258
}

src/test/java/world/bentobox/boxed/mocks/ServerMocks.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
public final class ServerMocks {
2626

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

@@ -66,7 +67,7 @@ public final class ServerMocks {
6667
doReturn(key).when(keyed).getKey();
6768
return keyed;
6869
});
69-
}).when(registry).get(notNull());
70+
}).when(registry).get((NamespacedKey) notNull());
7071
return registry;
7172
})).when(mock).getRegistry(notNull());
7273

0 commit comments

Comments
 (0)