From 44857814d3ce80343bf5b1c4f59e315c0be96a07 Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Sun, 25 Aug 2024 13:06:00 -0700 Subject: [PATCH] wip: start updating to 24w34a A lot doesn't compile with some registries having changed. Some kinds have migrated to records, moving away from enums. This poses some slight problem with representing the kinds themselves for API usage. --- src/main/java/org/spongepowered/api/data/Keys.java | 3 +-- .../spongepowered/api/registry/RegistryTypes.java | 3 --- .../org/spongepowered/api/world/biome/Biome.java | 3 +-- .../api/world/generation/carver/CarvingStep.java | 3 --- .../api/world/generation/carver/CarvingSteps.java | 12 ------------ 5 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/spongepowered/api/data/Keys.java b/src/main/java/org/spongepowered/api/data/Keys.java index cc9a70bc0a..0d6a38083c 100644 --- a/src/main/java/org/spongepowered/api/data/Keys.java +++ b/src/main/java/org/spongepowered/api/data/Keys.java @@ -265,7 +265,6 @@ import org.spongepowered.api.world.explosion.Explosion; import org.spongepowered.api.world.generation.ChunkGenerator; import org.spongepowered.api.world.generation.carver.Carver; -import org.spongepowered.api.world.generation.carver.CarvingStep; import org.spongepowered.api.world.generation.config.WorldGenerationConfig; import org.spongepowered.api.world.generation.feature.DecorationStep; import org.spongepowered.api.world.generation.feature.PlacedFeature; @@ -656,7 +655,7 @@ public final class Keys { * The carvers of a {@link Biome} used during world generation. * Readonly */ - public static final Key>> CARVERS = Keys.mapKey(ResourceKey.sponge("carvers"), TypeToken.get(CarvingStep.class), new TypeToken>() {}); + public static final Key> CARVERS = Keys.listKey(ResourceKey.sponge("carvers"), Carver.class); /** * The current casting time of a {@link Spellcaster}. diff --git a/src/main/java/org/spongepowered/api/registry/RegistryTypes.java b/src/main/java/org/spongepowered/api/registry/RegistryTypes.java index 4b1c9a8767..a108e65405 100644 --- a/src/main/java/org/spongepowered/api/registry/RegistryTypes.java +++ b/src/main/java/org/spongepowered/api/registry/RegistryTypes.java @@ -165,7 +165,6 @@ import org.spongepowered.api.world.gamerule.GameRule; import org.spongepowered.api.world.generation.carver.Carver; import org.spongepowered.api.world.generation.carver.CarverType; -import org.spongepowered.api.world.generation.carver.CarvingStep; import org.spongepowered.api.world.generation.config.flat.FlatGeneratorConfig; import org.spongepowered.api.world.generation.config.noise.DensityFunction; import org.spongepowered.api.world.generation.config.noise.Noise; @@ -306,8 +305,6 @@ public final class RegistryTypes { public static final DefaultedRegistryType CAT_TYPE = RegistryTypes.minecraftKeyInGame("cat_variant"); - public static final DefaultedRegistryType CARVING_STEP = RegistryTypes.spongeKeyInGame("carving_step"); - public static final DefaultedRegistryType CHAT_VISIBILITY = RegistryTypes.spongeKeyInGame("chat_visibility"); public static final DefaultedRegistryType CHEST_ATTACHMENT_TYPE = RegistryTypes.spongeKeyInGame("chest_attachment_type"); diff --git a/src/main/java/org/spongepowered/api/world/biome/Biome.java b/src/main/java/org/spongepowered/api/world/biome/Biome.java index 15051bf235..afd1c20497 100644 --- a/src/main/java/org/spongepowered/api/world/biome/Biome.java +++ b/src/main/java/org/spongepowered/api/world/biome/Biome.java @@ -42,7 +42,6 @@ import org.spongepowered.api.world.biome.spawner.NaturalSpawnCost; import org.spongepowered.api.world.biome.spawner.NaturalSpawner; import org.spongepowered.api.world.generation.carver.Carver; -import org.spongepowered.api.world.generation.carver.CarvingStep; import org.spongepowered.api.world.generation.feature.DecorationStep; import org.spongepowered.api.world.generation.feature.PlacedFeature; @@ -116,7 +115,7 @@ default TemperatureModifier temperatureModifier() { * * @return The carvers */ - default Map> carvers() { + default List carvers() { return this.require(Keys.CARVERS); } diff --git a/src/main/java/org/spongepowered/api/world/generation/carver/CarvingStep.java b/src/main/java/org/spongepowered/api/world/generation/carver/CarvingStep.java index f83e599d45..353c40bb04 100644 --- a/src/main/java/org/spongepowered/api/world/generation/carver/CarvingStep.java +++ b/src/main/java/org/spongepowered/api/world/generation/carver/CarvingStep.java @@ -24,12 +24,9 @@ */ package org.spongepowered.api.world.generation.carver; -import org.spongepowered.api.util.annotation.CatalogedBy; - /** * A carving step for {@link Carver carvers} */ -@CatalogedBy(CarvingSteps.class) public interface CarvingStep { } diff --git a/src/main/java/org/spongepowered/api/world/generation/carver/CarvingSteps.java b/src/main/java/org/spongepowered/api/world/generation/carver/CarvingSteps.java index e2707fe9d2..f50a033efa 100644 --- a/src/main/java/org/spongepowered/api/world/generation/carver/CarvingSteps.java +++ b/src/main/java/org/spongepowered/api/world/generation/carver/CarvingSteps.java @@ -37,21 +37,9 @@ @RegistryScopes(scopes = RegistryScope.GAME) public final class CarvingSteps { // @formatter:off - - public static final DefaultedRegistryReference AIR = CarvingSteps.key(ResourceKey.sponge("air")); - - public static final DefaultedRegistryReference LIQUID = CarvingSteps.key(ResourceKey.sponge("liquid")); - // @formatter:on private CarvingSteps() { } - public static Registry registry() { - return Sponge.game().registry(RegistryTypes.CARVING_STEP); - } - - private static DefaultedRegistryReference key(final ResourceKey location) { - return RegistryKey.of(RegistryTypes.CARVING_STEP, location).asDefaultedReference(Sponge::game); - } }