Search in sources :

Example 1 with DelegateDataValidator

use of org.spongepowered.common.data.nbt.validation.DelegateDataValidator in project SpongeCommon by SpongePowered.

the class SpongeEntityArchetypeBuilder method entityData.

@Override
public EntityArchetype.Builder entityData(final DataView view) {
    final DataContainer container = Objects.requireNonNull(view, "Provided DataView cannot be null!").copy();
    new DelegateDataValidator(SpongeEntityArchetype.VALIDATORS, ValidationTypes.ENTITY.get()).validate(container);
    this.compound = NBTTranslator.INSTANCE.translate(container);
    SpongeEntityArchetypeBuilder.stripCompound(this.compound);
    return this;
}
Also used : DelegateDataValidator(org.spongepowered.common.data.nbt.validation.DelegateDataValidator) DataContainer(org.spongepowered.api.data.persistence.DataContainer)

Aggregations

DataContainer (org.spongepowered.api.data.persistence.DataContainer)1 DelegateDataValidator (org.spongepowered.common.data.nbt.validation.DelegateDataValidator)1