Skip to content

Commit 42a97f9

Browse files
committed
Add missing Taggable types
1 parent 4aed36d commit 42a97f9

File tree

7 files changed

+63
-7
lines changed

7 files changed

+63
-7
lines changed

src/main/java/org/spongepowered/api/data/type/FrogType.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@
2424
*/
2525
package org.spongepowered.api.data.type;
2626

27+
import org.spongepowered.api.registry.DefaultedRegistryType;
28+
import org.spongepowered.api.registry.RegistryTypes;
29+
import org.spongepowered.api.tag.DefaultedTaggable;
2730
import org.spongepowered.api.util.annotation.CatalogedBy;
2831

2932
@CatalogedBy(FrogTypes.class)
30-
public interface FrogType {
33+
public interface FrogType extends DefaultedTaggable<FrogType> {
34+
35+
@Override
36+
default DefaultedRegistryType<FrogType> registryType() {
37+
return RegistryTypes.FROG_TYPE;
38+
}
3139
}

src/main/java/org/spongepowered/api/effect/sound/SoundType.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@
2727
import net.kyori.adventure.sound.Sound;
2828
import org.spongepowered.api.ResourceKeyed;
2929
import org.spongepowered.api.Sponge;
30+
import org.spongepowered.api.registry.DefaultedRegistryType;
31+
import org.spongepowered.api.registry.RegistryTypes;
32+
import org.spongepowered.api.tag.DefaultedTaggable;
3033
import org.spongepowered.api.util.ResourceKeyedBuilder;
3134
import org.spongepowered.api.util.annotation.CatalogedBy;
3235

3336
/**
3437
* Represents a sound that can be heard on clients.
3538
*/
3639
@CatalogedBy(SoundTypes.class)
37-
public interface SoundType extends ResourceKeyed, Sound.Type {
40+
public interface SoundType extends DefaultedTaggable<SoundType>, ResourceKeyed, Sound.Type {
3841

3942
/**
4043
* Creates a new {@link Builder} for building SoundTypes.
@@ -45,6 +48,11 @@ static Builder builder() {
4548
return Sponge.game().builderProvider().provide(Builder.class);
4649
}
4750

51+
@Override
52+
default DefaultedRegistryType<SoundType> registryType() {
53+
return RegistryTypes.SOUND_TYPE;
54+
}
55+
4856
/**
4957
* Builds a SoundType, primarily for sending custom sounds to the client.
5058
*/

src/main/java/org/spongepowered/api/statistic/Statistic.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
*/
2525
package org.spongepowered.api.statistic;
2626

27+
import org.spongepowered.api.registry.DefaultedRegistryType;
28+
import org.spongepowered.api.registry.RegistryTypes;
2729
import org.spongepowered.api.scoreboard.criteria.Criterion;
30+
import org.spongepowered.api.tag.DefaultedTaggable;
2831
import org.spongepowered.api.util.annotation.CatalogedBy;
2932

3033
import java.text.NumberFormat;
@@ -34,7 +37,7 @@
3437
* Represents some statistic in minecraft.
3538
*/
3639
@CatalogedBy(Statistics.class)
37-
public interface Statistic {
40+
public interface Statistic extends DefaultedTaggable<Statistic> {
3841

3942
/**
4043
* Returns the objective {@link Criterion} for this statistic.
@@ -51,6 +54,11 @@ public interface Statistic {
5154
*/
5255
NumberFormat format();
5356

57+
@Override
58+
default DefaultedRegistryType<Statistic> registryType() {
59+
return RegistryTypes.STATISTIC;
60+
}
61+
5462
/**
5563
* Represents a {@link Statistic} instance of a {@link StatisticCategory.Typed}.
5664
*

src/main/java/org/spongepowered/api/statistic/StatisticCategory.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@
2525
package org.spongepowered.api.statistic;
2626

2727
import io.leangen.geantyref.TypeToken;
28+
import org.spongepowered.api.registry.DefaultedRegistryType;
29+
import org.spongepowered.api.registry.RegistryTypes;
30+
import org.spongepowered.api.tag.DefaultedTaggable;
2831
import org.spongepowered.api.util.annotation.CatalogedBy;
2932

3033
import java.util.Collection;
3134

3235
@CatalogedBy(StatisticCategories.class)
33-
public interface StatisticCategory {
36+
public interface StatisticCategory extends DefaultedTaggable<StatisticCategory> {
3437

3538
/**
3639
* Gets all the {@link Statistic}s that are listed
@@ -40,6 +43,11 @@ public interface StatisticCategory {
4043
*/
4144
Collection<? extends Statistic> statistics();
4245

46+
@Override
47+
default DefaultedRegistryType<StatisticCategory> registryType() {
48+
return RegistryTypes.STATISTIC_CATEGORY;
49+
}
50+
4351
/**
4452
* Represents a {@link StatisticCategory} that owns
4553
* {@link Statistic}s for all the {@link T values}

src/main/java/org/spongepowered/api/world/generation/carver/CarverType.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525
package org.spongepowered.api.world.generation.carver;
2626

2727
import org.spongepowered.api.data.persistence.DataView;
28+
import org.spongepowered.api.registry.DefaultedRegistryType;
29+
import org.spongepowered.api.registry.RegistryTypes;
30+
import org.spongepowered.api.tag.DefaultedTaggable;
2831
import org.spongepowered.api.util.annotation.CatalogedBy;
2932

3033
/**
3134
* A type of {@link Carver}.
3235
*/
3336
@CatalogedBy(CarverTypes.class)
34-
public interface CarverType {
37+
public interface CarverType extends DefaultedTaggable<CarverType> {
3538

3639
/**
3740
* Returns the configured carver
@@ -40,4 +43,9 @@ public interface CarverType {
4043
* @return The configured carver
4144
*/
4245
Carver configure(DataView config) throws IllegalArgumentException;
46+
47+
@Override
48+
default DefaultedRegistryType<CarverType> registryType() {
49+
return RegistryTypes.CARVER_TYPE;
50+
}
4351
}

src/main/java/org/spongepowered/api/world/generation/feature/PlacementModifierType.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525
package org.spongepowered.api.world.generation.feature;
2626

2727
import org.spongepowered.api.data.persistence.DataView;
28+
import org.spongepowered.api.registry.DefaultedRegistryType;
29+
import org.spongepowered.api.registry.RegistryTypes;
30+
import org.spongepowered.api.tag.DefaultedTaggable;
2831
import org.spongepowered.api.util.annotation.CatalogedBy;
2932

3033
/**
3134
* A type of {@link PlacementModifier}.
3235
*/
3336
@CatalogedBy(PlacementModifierTypes.class)
34-
public interface PlacementModifierType {
37+
public interface PlacementModifierType extends DefaultedTaggable<PlacementModifierType> {
3538

3639
/**
3740
* Returns the placement modifier.
@@ -42,4 +45,9 @@ public interface PlacementModifierType {
4245
* @throws IllegalArgumentException when the configuration is not valid for this type of placement modifier
4346
*/
4447
PlacementModifier configure(DataView config) throws IllegalArgumentException;
48+
49+
@Override
50+
default DefaultedRegistryType<PlacementModifierType> registryType() {
51+
return RegistryTypes.PLACEMENT_MODIFIER;
52+
}
4553
}

src/main/java/org/spongepowered/api/world/generation/structure/jigsaw/ProcessorType.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
package org.spongepowered.api.world.generation.structure.jigsaw;
2626

2727
import org.spongepowered.api.data.persistence.DataView;
28+
import org.spongepowered.api.registry.DefaultedRegistryType;
29+
import org.spongepowered.api.registry.RegistryTypes;
30+
import org.spongepowered.api.tag.DefaultedTaggable;
2831
import org.spongepowered.api.util.annotation.CatalogedBy;
2932

3033
import java.io.IOException;
@@ -33,7 +36,7 @@
3336
* A type of {@link Processor}.
3437
*/
3538
@CatalogedBy(ProcessorTypes.class)
36-
public interface ProcessorType {
39+
public interface ProcessorType extends DefaultedTaggable<ProcessorType> {
3740

3841
/**
3942
* Returns the configured processor.
@@ -42,4 +45,9 @@ public interface ProcessorType {
4245
* @return The configured processor
4346
*/
4447
Processor configure(DataView config) throws IOException;
48+
49+
@Override
50+
default DefaultedRegistryType<ProcessorType> registryType() {
51+
return RegistryTypes.PROCESSOR_TYPE;
52+
}
4553
}

0 commit comments

Comments
 (0)