Skip to content

Commit d2a570e

Browse files
committed
change EquipmentCondition.byType to EquipmentType method
1 parent 278dac4 commit d2a570e

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

src/main/java/org/spongepowered/api/item/inventory/equipment/EquipmentCondition.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@
2525
package org.spongepowered.api.item.inventory.equipment;
2626

2727
import net.kyori.adventure.text.ComponentLike;
28-
import org.spongepowered.api.Sponge;
2928
import org.spongepowered.api.data.type.StringRepresentable;
3029
import org.spongepowered.api.registry.DefaultedRegistryValue;
3130
import org.spongepowered.api.util.annotation.CatalogedBy;
3231

3332
import java.util.Objects;
34-
import java.util.function.Predicate;
3533
import java.util.function.Supplier;
3634

3735
/**
@@ -40,26 +38,6 @@
4038
@CatalogedBy(EquipmentConditions.class)
4139
public interface EquipmentCondition extends DefaultedRegistryValue<EquipmentCondition>, StringRepresentable, ComponentLike {
4240

43-
/**
44-
* Returns the most specific equipment condition for the given equipment type.
45-
*
46-
* @param type The equipment type
47-
* @return The equipment condition
48-
*/
49-
static EquipmentCondition byType(final Supplier<? extends EquipmentType> type) {
50-
return EquipmentCondition.byType(Objects.requireNonNull(type, "type").get());
51-
}
52-
53-
/**
54-
* Returns the most specific equipment condition for the given equipment type.
55-
*
56-
* @param type The equipment type
57-
* @return The equipment condition
58-
*/
59-
static EquipmentCondition byType(final EquipmentType type) {
60-
return Sponge.game().factoryProvider().provide(Factory.class).byType(type);
61-
}
62-
6341
/**
6442
* Tests whether the equipment type is suitable for this condition.
6543
*
@@ -77,9 +55,4 @@ default boolean test(final Supplier<? extends EquipmentType> type) {
7755
* @return True if the equipment type is suitable for this condition
7856
*/
7957
boolean test(EquipmentType type);
80-
81-
interface Factory {
82-
83-
EquipmentCondition byType(EquipmentType type);
84-
}
8558
}

src/main/java/org/spongepowered/api/item/inventory/equipment/EquipmentType.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,11 @@ public interface EquipmentType extends DefaultedRegistryValue<EquipmentType>, St
4040
* @return The group
4141
*/
4242
EquipmentGroup group();
43+
44+
/**
45+
* Gets the most specific {@link EquipmentCondition} for this equipment type.
46+
*
47+
* @return The condition
48+
*/
49+
EquipmentCondition condition();
4350
}

0 commit comments

Comments
 (0)