Skip to content

Commit

Permalink
wip: start updating to 24w34a
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gabizou committed Aug 25, 2024
1 parent 42dc372 commit a9e5275
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 99 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/spongepowered/api/data/Keys.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -656,7 +655,7 @@ public final class Keys {
* The carvers of a {@link Biome} used during world generation.
* Readonly
*/
public static final Key<MapValue<CarvingStep, List<Carver>>> CARVERS = Keys.mapKey(ResourceKey.sponge("carvers"), TypeToken.get(CarvingStep.class), new TypeToken<List<Carver>>() {});
public static final Key<ListValue<Carver>> CARVERS = Keys.listKey(ResourceKey.sponge("carvers"), Carver.class);

/**
* The current casting time of a {@link Spellcaster}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public interface Zombie extends Monster {
*
* @return Whether this zombie is an adult or not
*/
@Override
default Value.Mutable<Boolean> adult() {
return this.requireValue(Keys.IS_ADULT).asMutable();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -306,8 +305,6 @@ public final class RegistryTypes {

public static final DefaultedRegistryType<CatType> CAT_TYPE = RegistryTypes.minecraftKeyInGame("cat_variant");

public static final DefaultedRegistryType<CarvingStep> CARVING_STEP = RegistryTypes.spongeKeyInGame("carving_step");

public static final DefaultedRegistryType<ChatVisibility> CHAT_VISIBILITY = RegistryTypes.spongeKeyInGame("chat_visibility");

public static final DefaultedRegistryType<ChestAttachmentType> CHEST_ATTACHMENT_TYPE = RegistryTypes.spongeKeyInGame("chest_attachment_type");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ interface Builder extends DataPackEntryBuilder<WorldType, WorldTypeTemplate, Bui
* @param pack The data
* @return This builder, for chaining
*/
@Override
Builder fromDataPack(DataView pack) throws IOException;

Builder from(WorldType type);

@Override
Builder pack(DataPack<WorldTypeTemplate> pack);
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/spongepowered/api/world/biome/Biome.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -116,7 +115,7 @@ default TemperatureModifier temperatureModifier() {
*
* @return The carvers
*/
default Map<CarvingStep, List<Carver>> carvers() {
default List<Carver> carvers() {
return this.require(Keys.CARVERS);
}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ static Builder builder() {
*
* @return The block palette
*/
@Override
Palette<BlockState, BlockType> blockPalette();

/**
Expand Down

0 comments on commit a9e5275

Please sign in to comment.