Skip to content

Commit 94ca7e4

Browse files
committed
Rework tags
1 parent 38464bc commit 94ca7e4

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
package org.spongepowered.api.registry;
2626

2727
import org.spongepowered.api.ResourceKey;
28+
import org.spongepowered.api.tag.Tag;
2829
import org.spongepowered.api.util.annotation.DoNotStore;
2930

3031
import java.util.Objects;
3132
import java.util.Optional;
33+
import java.util.Set;
3234
import java.util.stream.Stream;
3335

3436
/**
@@ -120,6 +122,8 @@ default <V extends T> Optional<V> findValue(final RegistryKey<T> key) {
120122
*/
121123
<V extends T> V value(ResourceKey key);
122124

125+
<V extends T> Set<V> taggedValues(Tag<T> key);
126+
123127
/**
124128
* {@link Registry#value(ResourceKey)}, provided for convenience when using {@link RegistryKey}.
125129
*

src/main/java/org/spongepowered/api/tag/Tag.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,6 @@
4848
* {@link BlockTypeTags#LOGS_THAT_BURN}</li>
4949
* </ul>
5050
*/
51-
public interface Tag<T> extends DefaultedRegistryValue, ResourceKeyed {
52-
53-
/**
54-
* Gets all values that are associated with this tag.
55-
*
56-
* @return All tag values
57-
*/
58-
Collection<T> values();
59-
60-
/**
61-
* Gets whether this tag contains the supplied value.
62-
*
63-
* @param value Value to check
64-
* @return Whether the value is contained in this tag.
65-
*/
66-
boolean contains(T value);
51+
public interface Tag<T> extends ResourceKeyed {
6752

6853
}

0 commit comments

Comments
 (0)