Updated Upstream (Bukkit/CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
fb23cbb3 Define surefire plugin version
d022084a Define ordering for MetadataStoreTest
99a7f6f0 PR-910: Match generic max absorption attribute name style with the rest
c7390d71 PR-909: Update tests to JUnit 5

CraftBukkit Changes:
f0661c351 PR-1230: Move unstructured PDC NBT serialisation to SNBT
452fcb599 PR-1256: Update tests to JUnit 5
This commit is contained in:
Nassim Jahnke
2023-09-24 17:16:58 +10:00
parent 63a40050bd
commit 358877e2e2
40 changed files with 292 additions and 295 deletions

View File

@@ -110,9 +110,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.NamespacedKey;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.support.AbstractTestingBase;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import java.io.PrintStream;
+import java.lang.reflect.Field;
@@ -121,9 +121,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import java.util.Map;
+import java.util.StringJoiner;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@Deprecated(forRemoval = true)
+public class ConfiguredStructureTest extends AbstractTestingBase {
@@ -133,7 +133,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ private static PrintStream out;
+
+ @BeforeClass
+ @BeforeAll
+ public static void collectStructures() throws ReflectiveOperationException {
+ out = System.out;
+ System.setOut(Bootstrap.STDOUT);
@@ -153,12 +153,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Test
+ public void testMinecraftToApi() {
+ Registry<Structure> structureRegistry = AbstractTestingBase.REGISTRY_CUSTOM.registryOrThrow(Registries.STRUCTURE);
+ assertEquals("configured structure maps should be the same size", BUILT_IN_STRUCTURES.size(), structureRegistry.size());
+ assertEquals(BUILT_IN_STRUCTURES.size(), structureRegistry.size(), "configured structure maps should be the same size");
+
+ Map<ResourceLocation, Structure> missing = new LinkedHashMap<>();
+ for (Structure feature : structureRegistry) {
+ final ResourceLocation key = structureRegistry.getKey(feature);
+ assertNotNull("Missing built-in registry key", key);
+ assertNotNull(key, "Missing built-in registry key");
+ if (key.equals(BuiltinStructures.ANCIENT_CITY.location()) || key.equals(BuiltinStructures.TRAIL_RUINS.location())) {
+ continue; // TODO remove when upstream adds "jigsaw" StructureType
+ }
@@ -167,14 +167,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ }
+
+ assertTrue(printMissing(missing), missing.isEmpty());
+ assertTrue(missing.isEmpty(), printMissing(missing));
+ }
+
+ @Test
+ public void testApiToMinecraft() {
+ Registry<Structure> structureRegistry = AbstractTestingBase.REGISTRY_CUSTOM.registryOrThrow(Registries.STRUCTURE);
+ for (NamespacedKey apiKey : DEFAULT_CONFIGURED_STRUCTURES.keySet()) {
+ assertTrue(apiKey + " does not have a minecraft counterpart", structureRegistry.containsKey(CraftNamespacedKey.toMinecraft(apiKey)));
+ assertTrue(structureRegistry.containsKey(CraftNamespacedKey.toMinecraft(apiKey)), apiKey + " does not have a minecraft counterpart");
+ }
+ }
+
@@ -188,7 +188,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return joiner.toString();
+ }
+
+ @AfterClass
+ @AfterAll
+ public static void after() {
+ System.setOut(out);
+ }