create Linked annotation and link TerraBiome and BiomeBuilder

This commit is contained in:
dfsek
2021-07-17 10:27:15 -07:00
parent b1589ed046
commit a66641cb8a
5 changed files with 36 additions and 5 deletions

View File

@@ -0,0 +1,18 @@
package com.dfsek.terra.api.properties.annotations;
import com.dfsek.terra.api.properties.PropertyHolder;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Specifies that this property holder shares properties
* with the {@link #value()} holder.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
public @interface Linked {
Class<? extends PropertyHolder> value();
}

View File

@@ -1,9 +1,12 @@
package com.dfsek.terra.api.util.seeded;
import com.dfsek.terra.api.properties.PropertyHolder;
import com.dfsek.terra.api.properties.annotations.Linked;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.Biome;
import com.dfsek.terra.api.world.biome.TerraBiome;
public interface BiomeBuilder extends SeededBuilder<TerraBiome> {
@Linked(TerraBiome.class)
public interface BiomeBuilder extends SeededBuilder<TerraBiome>, PropertyHolder {
ProbabilityCollection<Biome> getVanillaBiomes();
}

View File

@@ -2,7 +2,9 @@ package com.dfsek.terra.api.world.biome;
import com.dfsek.terra.api.properties.PropertyHolder;
import com.dfsek.terra.api.properties.annotations.Linked;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.util.seeded.BiomeBuilder;
import com.dfsek.terra.api.world.World;
import java.util.Set;
@@ -10,6 +12,7 @@ import java.util.Set;
/**
* Represents a custom biome
*/
@Linked(BiomeBuilder.class)
public interface TerraBiome extends PropertyHolder {
/**