use of me.deecaad.core.file.serializers.LocationAdjuster in project MechanicsMain by WeaponMechanics.
the class FireworkMechanic method serialize.
@Override
@Nonnull
public FireworkMechanic serialize(SerializeData data) throws SerializerException {
ItemStack fireworkItem = data.of("Item").assertExists().serializeNonStandardSerializer(new ItemSerializer());
if (!(fireworkItem.getItemMeta() instanceof FireworkMeta)) {
throw data.exception(null, "Item Type should be a firework when using a Firework Mechanic");
}
LocationAdjuster locationAdjuster = data.of("Location_Adjuster").serialize(LocationAdjuster.class);
return new FireworkMechanic(locationAdjuster, fireworkItem);
}
Aggregations