Skip to content

Commit 6dec077

Browse files
committed
Rework Tags
Tags are no longer a registry type
1 parent 0059bec commit 6dec077

File tree

14 files changed

+282
-423
lines changed

14 files changed

+282
-423
lines changed

src/main/java/org/spongepowered/api/registry/Registry.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,20 @@ default <V extends T> Optional<V> findValue(final RegistryKey<T> key) {
122122
*/
123123
<V extends T> V value(ResourceKey key);
124124

125-
<V extends T> Set<V> taggedValues(Tag<T> key);
125+
/**
126+
* Returns the registered types associated with given tag.
127+
* @param tag The tag
128+
*
129+
* @return The registered types associated with given tag
130+
*/
131+
<V extends T> Set<V> taggedValues(Tag<T> tag);
132+
133+
/**
134+
* Gets the tags associated with this registry.
135+
*
136+
* @return The tags associated with this registry
137+
*/
138+
<V extends T> Stream<Tag<V>> tags();
126139

127140
/**
128141
* {@link Registry#value(ResourceKey)}, provided for convenience when using {@link RegistryKey}.

src/main/java/org/spongepowered/api/registry/RegistryTypes.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,8 @@
137137
import org.spongepowered.api.service.economy.Currency;
138138
import org.spongepowered.api.service.economy.account.AccountDeletionResultType;
139139
import org.spongepowered.api.service.economy.transaction.TransactionType;
140-
import org.spongepowered.api.state.BooleanStateProperty;
141-
import org.spongepowered.api.state.EnumStateProperty;
142-
import org.spongepowered.api.state.IntegerStateProperty;
143140
import org.spongepowered.api.statistic.Statistic;
144141
import org.spongepowered.api.statistic.StatisticCategory;
145-
import org.spongepowered.api.tag.Tag;
146-
import org.spongepowered.api.tag.TagType;
147142
import org.spongepowered.api.util.mirror.Mirror;
148143
import org.spongepowered.api.util.orientation.Orientation;
149144
import org.spongepowered.api.util.rotation.Rotation;
@@ -237,8 +232,6 @@ public final class RegistryTypes {
237232

238233
public static final DefaultedRegistryType<BellAttachmentType> BELL_ATTACHMENT_TYPE = RegistryTypes.spongeKeyInGame("bell_attachment_type");
239234

240-
public static final DefaultedRegistryType<Tag<BlockType>> BLOCK_TYPE_TAGS = RegistryTypes.spongeKeyInGame("block_type_tags");
241-
242235
public static final DefaultedRegistryType<BoatType> BOAT_TYPE = RegistryTypes.spongeKeyInGame("boat_type");
243236

244237
public static final DefaultedRegistryType<BodyPart> BODY_PART = RegistryTypes.spongeKeyInGame("body_part");
@@ -289,16 +282,12 @@ public final class RegistryTypes {
289282

290283
public static final DefaultedRegistryType<DyeColor> DYE_COLOR = RegistryTypes.spongeKeyInGame("dye_color");
291284

292-
public static final DefaultedRegistryType<Tag<EntityType<@NonNull ?>>> ENTITY_TYPE_TAGS = RegistryTypes.spongeKeyInGame("entity_type_tags");
293-
294285
public static final DefaultedRegistryType<EquipmentGroup> EQUIPMENT_GROUP = RegistryTypes.spongeKeyInGame("equipment_group");
295286

296287
public static final DefaultedRegistryType<EquipmentType> EQUIPMENT_TYPE = RegistryTypes.spongeKeyInGame("equipment_type");
297288

298289
public static final DefaultedRegistryType<FireworkShape> FIREWORK_SHAPE = RegistryTypes.spongeKeyInGame("firework_shape");
299290

300-
public static final DefaultedRegistryType<Tag<FluidType>> FLUID_TYPE_TAGS = RegistryTypes.spongeKeyInGame("fluid_type_tags");
301-
302291
public static final DefaultedRegistryType<FoxType> FOX_TYPE = RegistryTypes.spongeKeyInGame("fox_type");
303292

304293
public static final DefaultedRegistryType<GameMode> GAME_MODE = RegistryTypes.spongeKeyInGame("game_mode");
@@ -325,8 +314,6 @@ public final class RegistryTypes {
325314

326315
public static final DefaultedRegistryType<ItemTier> ITEM_TIER = RegistryTypes.spongeKeyInGame("item_tier");
327316

328-
public static final DefaultedRegistryType<Tag<ItemType>> ITEM_TYPE_TAGS = RegistryTypes.spongeKeyInGame("item_type_tags");
329-
330317
public static final DefaultedRegistryType<JigsawBlockOrientation> JIGSAW_BLOCK_ORIENTATION = RegistryTypes.spongeKeyInGame("jigsaw_block_orientation");
331318

332319
public static final DefaultedRegistryType<LightType> LIGHT_TYPE = RegistryTypes.spongeKeyInGame("light_type");
@@ -413,8 +400,6 @@ public final class RegistryTypes {
413400

414401
public static final DefaultedRegistryType<StructureMode> STRUCTURE_MODE = RegistryTypes.spongeKeyInGame("structure_mode");
415402

416-
public static final DefaultedRegistryType<TagType<@NonNull ?>> TAG_TYPES = RegistryTypes.spongeKeyInGame("tag_type");
417-
418403
public static final DefaultedRegistryType<TaskPriority> TASK_PRIORITY = RegistryTypes.spongeKeyInGame("task_priority");
419404

420405
public static final DefaultedRegistryType<TeleportHelperFilter> TELEPORT_HELPER_FILTER = RegistryTypes.spongeKeyInGame("teleport_helper_filter");

src/main/java/org/spongepowered/api/state/BooleanStateProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030
@SuppressWarnings("unused")
3131
public final class BooleanStateProperties {
32+
3233
private BooleanStateProperties() {
3334
}
3435

src/main/java/org/spongepowered/api/state/EnumStateProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
*/
5252
@SuppressWarnings("unused")
5353
public final class EnumStateProperties {
54+
5455
private EnumStateProperties() {
5556
}
5657

src/main/java/org/spongepowered/api/state/IntegerStateProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030
@SuppressWarnings("unused")
3131
public final class IntegerStateProperties {
32+
3233
private IntegerStateProperties() {
3334
}
3435

0 commit comments

Comments
 (0)