package net.minecraft.core.component; import org.jspecify.annotations.Nullable; public interface DataComponentGetter { @Nullable T get(DataComponentType type); default T getOrDefault(final DataComponentType type, final T defaultValue) { T value = this.get(type); return value != null ? value : defaultValue; } @Nullable default TypedDataComponent getTyped(final DataComponentType type) { T value = this.get(type); return value != null ? new TypedDataComponent<>(type, value) : null; } }